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
skip_before_filter :authorize, :only => [:show, :new, :create] GET /members/1/edit GET /members GET /members.xml
def validate_me @member = Member.find(params[:id]) @member.send_validation_email respond_to do |format| format.html end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n redirect_to useradmin_members_path(params[:id])\n end", "def show\n skip_authorization\n end", "def index\n #@members = member.all\n #@members = member.with_restricted_access_access\n @members = policy_scope(Member)\n end", "def index\n @pending_affiliations = Affiliation.find_all_not_approved\n @approved_affiliations = Affiliation.find_approved\n respond_to do |format|\n format.html { render :layout => 'admin' } # index.rhtml\n format.xml { render :xml => @members.to_xml }\n end\n end", "def filter_self\n if @user && !current_user.can_edit?(@user)\n respond_to do |format|\n format.html {\n render :nothing => true, :status => 403\n }\n format.json {\n render :json => {:status => 'failure'}, :status => 403\n }\n end\n end\n end", "def index\n @members = Member.where(admin: false)\n end", "def show\n restrict 'allow only admins' or begin\n @admin = Admin.find_by_id(params[:id]) || current_user\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @admin.to_xml }\n end\n end\n end", "def show\n restrict 'allow only admins' or begin\n @admin = Admin.find_by_id(params[:id]) || current_user\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @admin.to_xml }\n end\n end\n end", "def show\n # authorize Admin\n end", "def show\n authorize @user # Can only see your own profile\n end", "def show\n if @member.spammer? and (not logged_in? or (! current_user.admin and current_user != @member))\n flash[:error] = \"The user you tried to view is a suspected spammer and will not be shown. Please login as that user and edit your 'Profile' if this is a mistake.\"\n flash.keep\n return redirect_to(members_path) \n end\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @member }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @member }\n end\n end", "def show\n @user = User.find(params[:id])\n authorize @user\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "def show\n @user = User.find(params[:id])\n return access_denied unless (authorize?(permissions = [\"view_user\"]) || (authorize?(permissions = [\"view_own_user\"]) && @user.id == current_user.id))\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "def show\n @member = Member.find(params[:id])\n raise CanCan::AccessDenied if cannot? :show, @member\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "def min_up_members_action\n super\n end", "def index \n @profile = self.current_member.profile\n respond_to do |format|\n if @profile.nil?\n format.html { redirect_to new_member_profile_url(self.current_member) }\n else\n format.html { redirect_to [self.current_member, @profile]}\n end\n end\n end", "def show\n @profile = self.current_member.profile\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @profile.to_xml }\n end\n end", "def restrict_access\n render :\"/home/http_404\" unless @profile && @profile.user == current_user\n end", "def index\n \tif current_member\n \t\tredirect_to members_timeline_path\n \telse\n \t\tredirect_to member_session_path\n \tend\n end", "def show\n authorize User\n end", "def show\n authorize User\n end", "def before_filter; end", "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @member }\n end\n end", "def account\n @member = current_user.member\n @user = current_user\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end", "def new\n\tif !checkadmin? then return end #\n\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def valid_member \n unless (@member && @member.activated? && @member.authenticated?(:reset, params[:id])) \n redirect_to root_url \n end \n end", "def index\n @member = Member.find(params[:member_id])\n end", "def index\n @memberships = Membership.all\n unless current_student.try(:isAdmin?)\n render(:file => File.join(Rails.root, 'public/403'), :formats => [:html], :status => 403, :layout => false)\n end\n end", "def index\n if current_user.role_id == 1\n @members = User.all\n @checkAdmin = 1\n<<<<<<< HEAD\n=======\n @members_recent = User.order(\"created_at desc\").limit(5)\n>>>>>>> ec4ed160773dfdd524d9a2b1eef044bb87c83645\n else\n render :show\n end\n end", "def index\n # Handle bookmarked or otherwise incorrect GETs to the login action\n if request.method == :get\n redirect_to login_path\n else\n redirect_to member_home_path\n end\n end", "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @member.to_xml }\n end\n end", "def index\n respond_to do |format|\n format.html { render :layout => 'yui_t7_custom' } # index.rhtml\n format.xml { render :xml => @members.to_xml }\n end\n end", "def index\n @members = Defer { ::Member.all }\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @members }\n end\n end", "def show\n @who_member = WhoMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @who_member }\n end\n end", "def show\n admin_only\n end", "def show\n admin_only\n end", "def show\n admin_only\n end", "def show\n #@member= Member.find(params[:member_id])\n end", "def show\n #@member= Member.find(params[:member_id])\n end", "def show\n #@member= Member.find(params[:member_id])\n end", "def show\n \t@member= Member.find(params[:member_id])\n\tend", "def show\n \tauthorize! :read, @user\n end", "def place_members_only?\n false\n end", "def place_members_only?\n false\n end", "def access_inlcude_member\n @post = Post.find params[:id]\n\n unless @post.community_id == 0 \n @community = Community.find_by_id @post.community_id \n if @community.status.to_s == \"private\"\n if validate_member_for(@community,@post)\n #if true then redirect\n redirect_to RAILS_URL\n end\n end \n end\n end", "def show\n authorize!\n end", "def show\n authorize!\n end", "def show\n authorize!\n end", "def show\n authorize! :show, @user\n end", "def show\n \t@person = Person.find(params[:id])\n \t@is_admin = false\n \tactive_person = Person.find(session[:user_id])\n \troles = active_person.roles.collect {|role| role.name}\n if roles == [\"DirectCareProvider\"] && session[:user_id] != params[:id]\n flash[:notice] = \"You can only access your own profile.\"\n @person = active_person\n elsif roles.member?(\"Supervisor\") || roles.member?(\"Administrator\")\n \t@is_admin = true\n end\n end", "def index #This is the ACTION 'index', accessed via /manage/pages, as opposed to the STUB 'index', accessed via /pages\n restrict('allow only admins') or begin\n @pages = Page.find(:all)\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @pages.to_xml }\n end\n end\n end", "def access_control\n \n end", "def destroy\n\tif !checkadmin? then return end\n\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def index\n if Member.exists?(uid: current_admin.uid) == false\n redirect_to(new_member_path)\n else\n @current_member = Member.where(uid: current_admin.uid).first\n\n if @current_member.isAdmin == true\n @is_admin = true\n else\n @is_admin = false\n redirect_to(announcements_path)\n end\n end\n\n @activities = Activity.all\n end", "def show\n\t\tif current_user.is_admin\n\t\t\t@user = User.find(params[:id])\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html # show.html.erb\n\t\t\t\tformat.xml { render :xml => @user }\n\t\t\tend\n\t\telse\n\t\t\t\n\t\t\tif(current_user.id.to_i != params[:id].to_i)\n\t\t\t\tflash.now[:notice] = \"I privilegi da te posseduti non sono sufficienti a visualizzare altri utenti\"\n\t\t\tend\n\t\t\t@user = current_user\n\t\t\t\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html\n\t\t\t\tformat.xml { render :xml => @user }\n\t\t\tend\n\t\tend\n\n\tend", "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @membership }\n end\n end", "def show\n authorize EmployeeType\n end", "def only_your_profile_page\n @admin = Admin.find(params[:admin_id])\n\n if current_admin != @admin\n redirect_to sectors_path, notice: \"Access denied! You can only view your own profile page.\"\n end\n end", "def before_filter\n if current_user\n true\n end\n end", "def \n \n\n # ADMIN ONLY:\n # Deleting a Member\n # delete /members/:id\n def destroy\n # Maybe this shouldn't be allowed if member has transactions?\n # Since calculations are based on all transactions from the\n # beginning of time, deleting a member's transactions would\n # impact the other members' debts...\n Member.find(params[:id]).destroy\n flash[:success] = \"Deleted\"\n redirect_to members_path\n end", "def edit\n authorize! :edit, @profile\n end", "def index\n #Get all users but the current user\n @users = User.find(:all, :conditions => [\"id <> ?\", @currentUser.id], :order => :username)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", "def show\n authorize! :create, Administrator\n end", "def show\n @member = Member.find(params[:id])\n #@members = Member.paginate(:page => params[:page])\n @title = @member.last_name\n #respond_to do |format|\n # format.html # show.html.erb\n # format.xml { render :xml => @member }\n #end\n end", "def show\n if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n end", "def index\n @profiles = Profile.all\n authorize Profile\n end", "def run_filters\n set_user\n authorize\n end", "def profile_url\n {:controller => 'members', :action => 'profile'}\n end", "def show\n authorize @admin\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "def show\n\t\t@member = Member.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml\t{ render :xml => @member }\n\t\tend\n\tend", "def show\n # authorize @item\n end", "def show\n authorize @user\n end", "def show\n authorize @user\n end", "def self_edit_only\n #if current_user.id != Integer(params[:id]) && !current_user.is_admin\n if !can_edit\n redirect_to user_url, :notice => \"You don't have permission to do that.\"\n else\n end\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "def show\n @member_info = MemberInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @member_info }\n end\n end", "def show\n @user = User.find(params[:id])\n authorize @user\n end", "def show\n if current_user.try(:admin?)\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n else\n redirect_to :permission_error\n end\n end", "def show\n\t\tauthorize! :show, DetalleRestriccion\n end", "def show\n @affiliate = Affiliate.find(params[:id])\n if @affiliate and (current_user.is_admin or @affiliate.email == current_user.email)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @affiliate }\n end\n else\n redirect_to \"/\"\n end\n\n end", "def show\n @container = Container.find(params[:id]) \n unless current_user.nil? or @container.owner == current_user\n flash[:notice] = \"You can view only you own containers!\"\n return redirect_to(:action => \"index\")\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :layout => false }\n end\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def index\n @members = Member.all\n end", "def show\n if current_user_or_can?(:manage_users)\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end\n end", "def show\n @epu = Election.find(params[:id]).elections_participated_users.includes(:user)\n (@filterrific = initialize_filterrific(\n Member,\n params[:filterrific]\n )) || return\n @members = @filterrific.find.where(tenant_id: current_tenant.id).includes(:roles).page(params[:page])\n end", "def index\n @members = Member.where(\n current_member.the_admin? ? {} : {region_id: current_member.region_id}\n ).order(\"created_at\").paginate(:page => params[:page], :per_page => 30)\n end", "def show\n if user\n render json: user,serializer: Api::V1::MembersSerializer, :status => 201\n else\n render json: \"errors\", :status => 422\n end \n end", "def show\n enforce_view_permission(@user)\n \n end", "def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend", "def show\n # 需要验证是否公开或属于该登录成员,否则没有权限查看\n # 管理员可以查看\n if !@event.is_public && (!@_current_member || @_current_member.id != @event.member_id && @_current_member.role == 'user')\n # 没有查看权限\n @message = '没有权限查看'\n respond_to do |format|\n format.html { redirect_to root_path, alert: @message }\n format.json { render json: { message: @message, status: 'error' }, status: :unprocessable_entity }\n end\n end\n end", "def show\n\tif(filters)\n\t\tif(!session[:user_id])\n\t\t\tflash[:error] = \"Acceso denegado\"\n\t\t\tredirect_to home_path\n\t\t\treturn\n\t\tend\n\t\tif(!User.find(session[:user_id]).admin || !User.find(session[:user_id]).active)\n\t\t\tflash[:error] = \"Acceso denegado\"\n\t\t\tredirect_to home_path\n\t\t\treturn\n\t\tend\n\tend\n @user = User.find(params[:id])\n\n\tflash[:active_tab] = \"admin\"\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end" ]
[ "0.6444065", "0.63825685", "0.6350558", "0.6272049", "0.6177851", "0.6152723", "0.61238974", "0.61238974", "0.6118133", "0.60910034", "0.60751176", "0.6057838", "0.60511726", "0.5984137", "0.59630615", "0.59555984", "0.59336203", "0.5929755", "0.59128886", "0.59123147", "0.59079325", "0.59079325", "0.59058636", "0.5903392", "0.5890034", "0.5879794", "0.58681875", "0.58680505", "0.5864494", "0.5863225", "0.5861366", "0.58607864", "0.5856859", "0.5848977", "0.583634", "0.5834683", "0.5834683", "0.5834683", "0.5822832", "0.5822832", "0.5822832", "0.58189297", "0.581623", "0.5795717", "0.5795717", "0.57898724", "0.5787523", "0.5787523", "0.5787523", "0.5787164", "0.5786326", "0.5781066", "0.5779895", "0.57760686", "0.57694775", "0.57528085", "0.57509434", "0.5749304", "0.5748623", "0.5747123", "0.57434744", "0.5743036", "0.5739403", "0.5733201", "0.5727306", "0.5723124", "0.5721546", "0.5714895", "0.57127374", "0.57074916", "0.5703882", "0.5700726", "0.5694507", "0.5694203", "0.5694203", "0.5683237", "0.5679538", "0.5676094", "0.56707096", "0.5664242", "0.5661781", "0.56587493", "0.56577325", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.5656511", "0.56552184", "0.5649742", "0.5646627", "0.56423324", "0.5639757", "0.563674", "0.56287235", "0.56272125" ]
0.0
-1
GET /members/new GET /members/new.xml
def new @member = Member.new @member.email = @search_string ||= "" respond_to do |format| format.html # new.html.erb format.xml { render :xml => @member} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @member = Member.new\n @title = \"New member\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end", "def new\n\t\t@member = Member.new(:membership_id => params[:membership_id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @member }\n\t\tend\n\tend", "def new\n @member_info = MemberInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member_info }\n end\n end", "def new\n\t\t@membership = Membership.new\n\t\t@membership.members.build\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @membership }\n\t\tend\n\tend", "def new\n @who_member = WhoMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @who_member }\n end\n end", "def new\n @member = Member.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n new_url = \"#{ENV['KPASS_ENDPOINT']}/members/new?app_id=#{ENV['KPASS_APP_ID']}\"\n redirect_to new_url\n end", "def new\n @family_member = FamilyMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @family_member }\n end\n end", "def new\n\tif !checkadmin? then return end #\n\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @member = Member.new\n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @membership }\n end\n end", "def create\n @member = Member.new(params[:member])\n @member.new = false\n\n respond_to do |format|\n if @member.save\n flash[:notice] = 'Member was successfully created.'\n format.html { redirect_to members_url(@member) }\n format.xml { head :created, :location => member_url(@member) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @member.errors.to_xml }\n end\n end\n end", "def new\n @membership = Membership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @membership }\n end\n end", "def new\n @membership = Membership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @membership }\n end\n end", "def new\n @teammember = Teammember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @teammember }\n end\n end", "def new\n @nickname = Nickname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nickname }\n end\n end", "def new\n @user = User.new\n get_list\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @user }\n end\n end", "def new\n @position_member = PositionMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @position_member }\n end\n end", "def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "def new\n logger.debug(\"Create a new user\")\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @memberapp = Memberapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @memberapp }\n end\n end", "def new\n # When a http GET request to '/users/new' is received, have it render:\n # a view file with an empty form to create a new user.\n end", "def new\n @member = Member.new\n user = @member.build_user\n @roles = Role.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @member }\n end\n end", "def new\n\tputs \"\\n\\t\\t in new\\n\"\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @friend = current_user_or_guest.friends.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @friend }\n format.json { render json: @friend }\n end\n end", "def create\n puts \"Is it here!?!?!\"\n @member = Member.new(params[:member])\n respond_to do |format|\n if @member.save \n format.html { redirect_to(@member, :notice => 'Member was successfully created.') }\n format.xml { render :xml => @member, :status => :created, :location => @member }\n format.json {render :json => @member, :status => :created, :location => @member }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end", "def new\n @title = \"New Member\"\n @member = Member.new\n @member.phone = \"+375\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member }\n end\n end", "def new\n @person = Person.new\n @person.names.new\n \n respond_to do |format|\n format.html { render :layout => \"main\" } # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new_members\n @members = User.all\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "def new\n @member = Member.new\n user = @member.build_user\n @roles = Role.find(:all)\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @member }\n end\n end", "def new\n @game_member = GameMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @game_member }\n end\n end", "def new\n @node = Node.new\n @node.owner = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @committeemember = Committeemember.new\n @clubusers = User.find(:all, :order => \"surname ASC\")\n @title = \"Create New Committee Member\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @committeemember }\n end\n end", "def new\n @friend = Friend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @user }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @person }\n end\n end", "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.xml { render xml: @user}\n end\n end", "def create\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n flash[:notice] = 'Member was successfully created.'\n format.html { redirect_to(@member) }\n format.xml { render :xml => @member, :status => :created, :location => @member }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @patron = Patron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patron }\n end\n end", "def new\n @user = User.new\n render :xml => @user\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @membership_kind = MembershipKind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @membership_kind }\n end\n end", "def new\n @person = Person.new\n @title = \"people\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @member_type = MemberType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @member_type }\n end\n end", "def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end" ]
[ "0.7645127", "0.75905365", "0.75905365", "0.75905365", "0.73785937", "0.7339909", "0.73335916", "0.7262581", "0.71329445", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.71195185", "0.6980091", "0.69704103", "0.69519126", "0.69349664", "0.691522", "0.69103175", "0.69054437", "0.68934155", "0.687649", "0.68739253", "0.6868527", "0.68231535", "0.680994", "0.6796761", "0.6790837", "0.67761683", "0.676889", "0.6756086", "0.6742868", "0.67377895", "0.6736937", "0.67220914", "0.6714183", "0.6709928", "0.6701748", "0.67016774", "0.6685583", "0.66785216", "0.6675023", "0.6665091", "0.6659906", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.66459364", "0.6635524", "0.66301805", "0.6626315", "0.6624826", "0.66240746", "0.6610872", "0.6610872", "0.6608207", "0.65966755", "0.65933394", "0.65933394", "0.6592226", "0.658177", "0.658177", "0.658177", "0.658177", "0.658177", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244", "0.65800244" ]
0.70735514
16
PUT /members/1 PUT /members/1.xml
def update @member = Member.find(params[:id]) respond_to do |format| if @member.update_attributes(params[:member]) Emailer.welcome_email(@member).deliver format.html { redirect_to(@member, :notice => 'Member was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @member.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to '/members/myindex' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to member_url(@member) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors.to_xml }\n end\n end\n end", "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response 401\r\n end", "def update\n @member = Member.find(params[:id])\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = \"Los datos del socio #{@member.name} #{@member.last_name} se actualizaron satisfactoriamente\"\n format.html { redirect_to(members_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "def update\n @member_info = MemberInfo.find(params[:id])\n\n respond_to do |format|\n if @member_info.update_attributes(params[:member_info])\n format.html { redirect_to(@member_info, :notice => 'MemberInfo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member_info.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "def update\n @member = Member.find(params[:id])\n @member.new = false\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n format.html { redirect_to members_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @member.errors.to_xml }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!\n @authorize = nil\n update_plan! &&\n resp = put(\"/users/#{username}.xml\", {\n :user_key => apikey,\n \"user[first_name]\" => first_name,\n \"user[last_name]\" => last_name\n })\n end", "def update\n\t\t@member = Member.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @member.update_attributes(params[:member])\n\t\t\t\tformat.html { redirect_to(@member, :notice => 'Member was successfully updated.') }\n\t\t\t\tformat.xml\t{ head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml\t{ render :xml => @member.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n respond_to do |format|\n params.require(:member).permit(:name)\n if @member.update(member_params)\n format.html { redirect_to @member, notice: '更新しました' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: \"Member was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\tif !checkme? then return end\n\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def 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 respond_to do |format|\n if @member.update!(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @who_member = WhoMember.find(params[:id])\n\n respond_to do |format|\n if @who_member.update_attributes(params[:who_member])\n format.html { redirect_to(@who_member, :notice => 'WhoMember was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @who_member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n resource_path = \"/projects/#{project_id}/people/#{id}\"\n Request.put(resource_path, self.to_xml('person'))\n end", "def set_member\n @member = @current_enterprise.members.find(params[:id])\n end", "def test_should_update_membership\n login_as(:john)\n put :update, :id => 1, :membership => { }\n assert_response :redirect\n end", "def test_should_update_membership\n login_as(:john)\n put :update, :id => 1, :membership => { }\n assert_response :redirect\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to space_member_url(@space, @member), notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: [@space, @member] }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_members\n unless self.list_members.blank?\n #create new members\n self.list_members.each do |api_member|\n member_params = {}\n api_member.each_pair do |key, value|\n unless key == \"id\"\n if Member.attribute_names.include? key\n member_params[key] = value\n end\n end\n end\n #member already exists\n temp = Member.find_by guid: member_params[\"guid\"]\n if !!temp\n temp.attributes = member_params\n if temp.valid? \n temp.save\n else\n return \"problem updating existing member\"\n end\n else\n member = Member.new(member_params)\n if member.valid?\n member.save\n else\n return \"problem with member params\"\n end\n end\n #delete denied members\n if api_member[\"connection_status\"] != \"CONNECTED\"\n Member.find_by(guid: member_params[\"guid\"]).delete\n Member.delete_member(self.guid, member_params[\"guid\"])\n end\n end\n end\n end", "def update\n # byebug \n respond_to do |format|\n if self.current_member && self.current_member.id == params[:id].to_i\n if @member.update(member_params)\n format.json { render :show, status: :ok, location: @member }\n else\n return api_error(status: :unprocessable_entity, message: @member.errors)\n end\n else\n return api_error(status: 401, message: '没有操作权限')\n end\n end\n end", "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @creating_member = false\n\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'El miembro ha sido actualizado' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n unless @member.err\n @member.get_member_uuid\n end\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @member = Member.find(params[:id])\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n unless @member.err\n @member.get_member_uuid\n end\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(update_params)\n format.html { redirect_to @member }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to admin_member_path(@member), notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, location: @member }\n else\n @uplines = Member.where.not(id: @member.self_and_descendants.collect(&:id)).order(\"fullname\")\n format.html { render :edit }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def set_member\n member_id = params[:id]\n @member = Member.find(member_id)\n end", "def update!(**args)\n @members = args[:members] if args.key?(:members)\n @resource = args[:resource] if args.key?(:resource)\n @resource_type = args[:resource_type] if args.key?(:resource_type)\n @role = args[:role] if args.key?(:role)\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = @account.members.find(params[:id])\n end", "def update(uid, params, membership)\n data = {\n initials: (params[4].nil? ? params[5][0] : params[4].tr('^a-zA-Z', '')),\n email: (params[3].nil? ? 'unknown@nieuwedelft.nl.invalid' : params[3]),\n gender: params[9] == 'Vrouw' ? 'F' : 'M',\n phone: params[14],\n mobile: params[2],\n phone_parents: params[24],\n address: [params[10], params[11], params[12]].join(' '),\n membership: membership,\n }\n begin\n unless params[15].nil?\n data[:dateofbirth] = Date.strptime(params[15], '%d-%m-%Y').strftime('%Y-%m-%d')\n end\n rescue\n $problems.write \"#{$index}, #{data[:firstname]} #{data[:lastname]}, Birthdate ignored\\n\"\n end\n patch(\"https://people.i.bolkhuis.nl/persons/#{uid}\", data)\n\n # Send payload to operculum\n put(\"https://operculum.i.bolkhuis.nl/person/#{uid}\", {\n nickname: params[8],\n study: params[16],\n alive: params[17].nil?,\n inauguration: params[25],\n resignation_letter: params[26],\n resignation: params[27],\n })\nend", "def update\n @position_member = PositionMember.find(params[:id])\n\n respond_to do |format|\n if @position_member.update_attributes(params[:position_member])\n format.html { redirect_to(@position_member, :notice => 'Position member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @position_member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @oc_member = OcMember.find(params[:id])\n\n respond_to do |format|\n if @oc_member.update_attributes(params[:oc_member])\n format.html { redirect_to @oc_member, notice: 'Oc member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oc_member.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_member\n @member = User.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:member_id])\n end", "def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend", "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end", "def update_members(action)\n @team = MnoEnterprise::Team.find(params[:id])\n authorize! :manage_teams, @team.organization\n\n if params[:team] && params[:team][:users]\n id_list = params[:team][:users].map { |h| h[:id] }.compact\n users = @team.organization.users.where('id.in' => id_list)\n\n users.each { |u| @team.send(action, u) }\n\n MnoEnterprise::EventLogger.info('team_update', current_user.id, 'Team composition updated', @team,\n {action: action.to_s, users: users.map(&:email)})\n end\n @team.reload\n\n render 'show'\n end", "def update\n @member = Member.find_by_url_or_id(params[:id])\n\n if @member.update_attributes(params[:member])\n flash[:notice] = 'Member was successfully updated.'\n redirect_to about_path(@member.url)\n else\n render :action => \"edit\" \n end\n end", "def update\n @organization_member = OrganizationMember.find(params[:id])\n\n respond_to do |format|\n if @organization_member.update_attributes(params[:organization_member])\n format.html { redirect_to(@organization_member, :notice => 'Organization member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization_member.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end", "def update!(**args)\n @members = args[:members] if args.key?(:members)\n @role = args[:role] if args.key?(:role)\n end", "def update\n respond_to do |format|\n if @member == current_member && @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end", "def set_member\n @member = Member.find(params[:id])\n end" ]
[ "0.6269145", "0.6249128", "0.6249128", "0.6236707", "0.6228516", "0.61484236", "0.6046281", "0.6043036", "0.6031233", "0.59462476", "0.594322", "0.59085166", "0.5906704", "0.59049994", "0.5901699", "0.588197", "0.5859677", "0.58532315", "0.58532315", "0.58532315", "0.58532315", "0.58532315", "0.58280545", "0.58222216", "0.57921284", "0.57843566", "0.5766158", "0.5766158", "0.5766158", "0.5766158", "0.5766158", "0.5766158", "0.5766158", "0.5766158", "0.5766158", "0.5754095", "0.5753529", "0.57511455", "0.57511455", "0.573392", "0.5729443", "0.57171667", "0.5712346", "0.5709659", "0.57074517", "0.57028013", "0.5694356", "0.5694356", "0.5667989", "0.56283617", "0.5626296", "0.56238645", "0.5622787", "0.5618478", "0.5579433", "0.55719364", "0.55719364", "0.55719364", "0.55719364", "0.55719364", "0.5565534", "0.5564373", "0.5556131", "0.55500597", "0.55306137", "0.5520663", "0.5516495", "0.55074006", "0.5491722", "0.54898304", "0.5487178", "0.548238", "0.54796904", "0.54735464", "0.54724115", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203", "0.5465203" ]
0.5881651
16
DELETE /members/1 DELETE /members/1.xml
def destroy @member = Member.find(params[:id]) @member.destroy respond_to do |format| format.html { redirect_to(members_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @member.destroy\n\n respond_to do |format|\n flash[:notice] = \"Destroyed user\"\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member.destroy\n\n respond_to do |format|\n flash[:notice] = \"Destroyed user\"\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n logger.info(\"#{Time.now} Se elimina el miembro ##{@member.id}!\")\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.deleted = true\n @member.save\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @member_info = MemberInfo.find(params[:id])\n @member_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(member_infos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t\t@member = Member.find(params[:id])\n\t\t@member.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(members_url) }\n\t\t\tformat.xml\t{ head :ok }\n\t\tend\n\tend", "def delete(*args)\n arguments(args, required: [:org_name, :user])\n\n delete_request(\"/orgs/#{arguments.org_name}/members/#{arguments.user}\",\n arguments.params)\n end", "def delete_member path\n rewrite_members member_paths.delete(path)\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n \n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\tif !checkadmin? then return end\n\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.json { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :ok }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find_by_url_or_id(params[:id])\n @member.destroy\n\n redirect_to(members_url)\n end", "def destroy \n @oc_member = OcMember.find(params[:id])\n @oc_member.destroy\n\n respond_to do |format|\n format.html { redirect_to oc_members_url }\n format.json { head :no_content }\n end\n end", "def \n \n\n # ADMIN ONLY:\n # Deleting a Member\n # delete /members/:id\n def destroy\n # Maybe this shouldn't be allowed if member has transactions?\n # Since calculations are based on all transactions from the\n # beginning of time, deleting a member's transactions would\n # impact the other members' debts...\n Member.find(params[:id]).destroy\n flash[:success] = \"Deleted\"\n redirect_to members_path\n end", "def destroy\n @who_member = WhoMember.find(params[:id])\n @who_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(who_members_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to attends_url }\n format.json { head :no_content }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: '削除しました' }\n format.json { head :no_content }\n end\n end", "def delete\n sql = 'DELETE FROM members WHERE id = $1'\n values = [@id]\n SqlRunner.run(sql, values)\nend", "def destroy\n @position_member = PositionMember.find(params[:id])\n @position_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(position_members_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 @membre = Membre.find(params[:id])\n @membre.destroy\n\n respond_to do |format|\n format.html { redirect_to(membres_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'El miembro ha sido eliminado' }\n format.json { head :no_content }\n end\n end", "def destroy\n @membership ||= Membership.find(params[:id])\n @membership.destroy\n\n respond_to do |format|\n format.html { redirect_to memberships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n #@member = Member.find(params[:id])\n @member.destroy\n\n redirect_back_or_default(root_path)\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @family_member = FamilyMember.find(params[:id])\n @family_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(family_family_members_url(@current_family)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to admin_member_members_path, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy!\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @independent = @member.independents.find(params[:id])\n @independent.destroy\n\n respond_to do |format|\n format.html { redirect_to(member_independents_url(@member)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to memberships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to memberships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n session[:member_id] = nil\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @membre = Membre.find(params[:id])\n @membre.destroy\n\n respond_to do |format|\n format.html { redirect_to(famille_url(@famille)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @organization_member = OrganizationMember.find(params[:id])\n @organization_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(organization_members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @game_member = GameMember.find(params[:id])\n @game_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(:back, :notice => 'Game member was successfully deleted.') }\n format.xml { head :ok }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html do\n redirect_to members_url,\n notice: 'Profile was successfully deleted.'\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html do\n redirect_to members_url,\n notice: 'Member was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @aiit_member = AiitMember.find(params[:id])\n @aiit_member.destroy\n\n respond_to do |format|\n format.html { redirect_to aiit_members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to @user }\n format.json { head :no_content }\n end\n end", "def destroy\n @group_member = GroupMember.find(params[:id])\n @group_member.destroy\n\n respond_to do |format|\n format.html { redirect_to group_members_url }\n format.json { head :no_content }\n end\n end", "def _delete(type, *args)\n type = type.to_s.camelize\n metadata = args.map { |full_name| {:full_name => full_name} }\n request :delete do |soap|\n soap.body = {\n :metadata => metadata\n }.merge(attributes!(type))\n end\n end", "def destroy\n @provider = Provider.find(params[:id])\n member_id = @provider.member_id\n @provider.destroy\n\n respond_to do |format|\n format.html { redirect_to member_url(member_id) }\n format.xml { head :ok }\n format.json {render :json=> {\"resp\" => \"ok\"} }\n end\n end", "def delete(owner_id, name)\n @user.delete([@base_uri, owner_id, name].join(\"/\"))\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @elder_member.destroy\n respond_to do |format|\n format.html { redirect_to elder_members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account_membership = AccountMembership.find(params[:id])\n @account_membership.destroy\n\n respond_to do |format|\n format.html { redirect_to(account_memberships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n if @member.email == \"admin@admin.com\"\n redirect_to logged_in_user, notice: \"Cannot Delete SuperUser.\"\n else\n Booking.where(member_id: @member.id).destroy_all\n @member.destroy\n respond_to do |format|\n format.html { redirect_to members_url, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @dc_member = DcMember.find(params[:id])\n @dc_member.destroy\n\n respond_to do |format|\n format.html { redirect_to dc_members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n User.destroy(params[:id])\n flash[:notice] = \"Deleted member!\"\n redirect_to :action => :index\n end", "def destroy\n User.destroy(params[:id])\n flash[:notice] = \"Deleted member!\"\n redirect_to :action => :index\n end", "def destroy\n\t\t@room.members.destroy(params[:id])\n\t\trespond_to do |format|\n\t\t\tback_page = room_members_url\n\t\t\tback_page = URI(request.referer).path if params[:back]\n\t\t\tback_page = params[:redirect] if params[:redirect]\n\t\t\tformat.html { redirect_to back_page, notice: 'Member was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n @membership.destroy\n respond_to do |format|\n format.html { redirect_to member_url(@membership.member), notice: 'Membership was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy_member\n\n #@member = Member.find\n #@member.destroy\n respond_to do |format|\n format.html { redirect_to organizations_url }\n format.json { head :no_content }\n end\n end", "def remove_member(id, user)\n client.delete(\"#{path}/#{id}/members\", user)\n end", "def destroy\n @member.destroy\n respond_to do |format|\n format.html { redirect_to space_members_url(@space), notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.find(params[:id])\n raise CanCan::AccessDenied if cannot? :delete, @member\n @member.destroy\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@membership = Membership.find(params[:id])\n\t\t@membership.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(memberships_url, :notice => \"Membership successfully destroyed.\") }\n\t\t\tformat.xml\t{ head :ok }\n\t\tend\n\tend", "def destroy\n @person = Person.find(params[:id])\n @person.destroy if @person.users.empty?\n \n respond_to do |format|\n format.html { redirect_to(people_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @alliance_member = AllianceMember.find(params[:id])\n @alliance_member.destroy\n\n respond_to do |format|\n format.html { redirect_to(alliance_members_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @boardmember = Boardmember.find(params[:id])\n @boardmember.destroy\n\n respond_to do |format|\n format.html { redirect_to(boardmembers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @clnmember = Clnmember.find(params[:id])\n @clnmember.destroy\n\n respond_to do |format|\n format.html { redirect_to clnmembers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member = Member.where(user_id: params[:user_id], group_id: params[:group_id]).take\n @member.destroy\n redirect_to root_path, notice: 'Вы удалились из группы'\n end", "def destroy\n @dotsmember = Dotsmember.find(params[:id])\n @dotsmember.destroy\n\n respond_to do |format|\n format.html { redirect_to dotsmembers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n organization = @member.organization \n\n @member.destroy\n logger.info(\"User #{current_user.email} destroyed Member '#{@member.first_name} #{@member.last_name}' on #{@member.updated_at}\")\n respond_to do |format|\n format.html { redirect_to organization, notice: 'Member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = self.current_member.profile\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to current_member_profile_path }\n format.xml { head :ok }\n end\n end", "def del_member(_user_id)\n update!(del_members: [_user_id])\n end", "def delete_list_member(f)\n File.open f, 'r' do |file|\n file.each do |email|\n begin\n print email\n email.chomp!\n RestClient.delete(\"https://api:key-#{API_KEY}\" \\\n \"@api.mailgun.net/v3/lists/#{LIST}@#{DOMAIN_NAME}/members/#{email}\")\n rescue\n puts \"--------\\n#{email} Not found..NEXT\\n\"\n next\n end\n end\n end\nend", "def destroy\n @family_member = FamilyMember.find(params[:id])\n @family_member.destroy\n\n respond_to do |format|\n format.html { redirect_to family_members_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @family_member = FamilyMember.find(params[:id])\n @family_member.destroy\n\n respond_to do |format|\n format.html { redirect_to family_members_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7141851", "0.7141851", "0.7141851", "0.7141851", "0.70842797", "0.70696974", "0.70696974", "0.70323604", "0.69961685", "0.6849304", "0.6777742", "0.6717248", "0.6684298", "0.6666834", "0.66305155", "0.6599085", "0.6599085", "0.6592147", "0.65882736", "0.65861404", "0.65861404", "0.6572019", "0.6572019", "0.6572019", "0.6572019", "0.6572019", "0.6572019", "0.6572019", "0.65679044", "0.65679044", "0.6544078", "0.65083957", "0.6507083", "0.6501085", "0.649776", "0.64787453", "0.64431506", "0.6434861", "0.64227015", "0.6398387", "0.6395689", "0.63796294", "0.63735247", "0.6368044", "0.6327615", "0.6313631", "0.63057363", "0.6300822", "0.63001317", "0.6285648", "0.62845105", "0.62845105", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6282584", "0.6261386", "0.62601155", "0.6249381", "0.6242587", "0.62379014", "0.62375003", "0.6229516", "0.62217957", "0.6216116", "0.62142164", "0.62085253", "0.62076014", "0.6207216", "0.620274", "0.6198822", "0.61966866", "0.61949116", "0.6194349", "0.6194349", "0.6189655", "0.6185135", "0.61751676", "0.61613286", "0.61587566", "0.6156273", "0.6151828", "0.61441344", "0.6134077", "0.61319727", "0.6130217", "0.6116147", "0.6115567", "0.61092556", "0.6100882", "0.60969806", "0.607135", "0.6066672", "0.6066672" ]
0.7257433
0
Create a method that adds a new player to the players array.
def test_add_team_player @team.add_team_player("Chloe") assert_equal("Chloe",@team.players.last) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_player(new_player)\n @players << new_player\n end", "def add_new_player(new_player)\n players.push(new_player)\n end", "def add_new_player(new_player)\n @players.push(new_player)\n end", "def add_new_player(new_player)\n @players.push(new_player)\nend", "def add_player_to_players(player)\n players.push(player)\n end", "def add_player()\n @players.push(players)\n end", "def add_new_player(new_player)\n return @players.push(new_player)\nend", "def add_player(name)\n @players.push(name)\n end", "def add_player(player)\n @players[@players.count + 1] = player\n end", "def add_player(new_player)\n @team_members.push(new_player)\n end", "def add_player(player_name)\n player = Player.new(player_name)\n $players << player\n end", "def add_player(player_name)\n player = Player.new(player_name, 3)\n @players.push(player)\n end", "def add_player player\n p = player_by_id(player.id)\n if !p\n @players << player\n elsif p.name != player.name\n p.name = player.name\n end\n end", "def add_player(player_name)\n @player_names.push(player_name)\n end", "def add_player(name)\n\t\t@Player << name\n\t\tend", "def add_player(name)\n\t\t@Player << name\n\t\tend", "def add_player(id)\n\t\t@players[id]=Player.new\n\tend", "def create_player(id,name)\n @players.push(Player.new(id, name, 0))\n end", "def add_player(player)\n # Confirm user isn't already playing a game\n return errors.add(:base, 'Player is already playing a game') unless player.games.active.count == 0\n # Confirm the game is not full\n return errors.add(:base, 'Game is full') unless players.count < num_players\n # Add player\n game_players.create(player: player)\n start if players.count == num_players\n end", "def add_player(nu_player_name_str)\n @players.push(nu_player_name_str)\n end", "def add_player ( player )\n if self.players.size == 3 then \n raise \"can't add players\" \n end\n self.players << player \n self.status = self.players.size\n end", "def add_player(player, password)\n @storage.save_player(player, password)\n self.add_object(player)\n end", "def add_user_player(user)\n @player = Player.new({:ai => '', :game_id => self.id, :user_id => user.id, :money => 100, :username => user.username, :location => self.get_empty_location(), :in_pot_hand => 0, :in_pot_current => 0})\n self.players << @player\n self.save\n end", "def add_player\n @team.add_player(@player, @jersey)\n\n redirect_to team_path(@team)\n end", "def append_player(player)\n @players ||= []\n @players << player unless @players.include?(player)\n end", "def add_player\n add_remove_player :add\n end", "def create #players are in an array\n @players = [\n Player.new('Contestant 1')\n Player.new('Contestant 2')\n ]\n end", "def add_player(user)\n if self.players.count < self.max_players\n self.players.build(:user => user)\n end\n end", "def add_players\n player_count = get_int_input \"How many players will there be? \"\n return add_players if player_count <= 0\n\n @players = Array.new(player_count)\n player_count.times{ |i|\n print \"Player #{i+1}, enter your name: \"\n name = gets.strip.capitalize\n @players[i] = Player.new(name)\n collect_betting_unit(@players[i]) if $Counting_Mode\n }\n linebreak\n end", "def add(new_player)\n\t\tif @state == :OPEN\n\t\t\t@players << new_player\n\t\t\t@active_players << new_player\n\t\t\t@accepted_invites += 1\n\t\t\tif @accepted_invites == @num_invites\n\t\t\t\tself.invite_timeout\n\t\t\tend\t\n\t\tend\n\tend", "def add_player(game, player)\n\t\t\t\t@players ||= {}\n\t\t\t\t@players[game.table_id] = player\n\t\t\tend", "def test_add_player_to_players()\n team = SportsTeam.new(\"Belgium\", [\"Player 1\", \"Player 2\", \"Player 3\"], \"Mr Belgium\")\n team.add_player_to_players(\"Player 4\")\n assert_equal([\"Player 1\", \"Player 2\", \"Player 3\", \"Player 4\"], team.players())\n end", "def add_player(m)\n return if !@game or !already_exists?(m.user.authname)\n\n unless @game.players.map(&:irc_authname).include?(m.user.authname)\n @game.players << create_gamer(m)\n\n need_players = @limit - @game.players.size\n\n if @timer\n @timer.stop\n else\n @timer = Timer(PENDING_DELAY, shots: 1, start_automatically: false) do\n @game = nil\n Channel(m.channel.name).send I18n.mixer.game_cancelled\n end\n end\n\n if ready_to_begin?\n each_team { |blue, red| begin_game!(m, blue, red) }\n else\n @timer.start\n\n m.reply I18n.mixer.players(show_players)\n m.reply I18n.mixer.need_players(need_players)\n end\n end\n end", "def add_many(new_players)\n #this function is being passed an array so loop!\n for player in new_players\n # @players << (player)\n add_player(player)\n ##OR - issue with this method is if you change add players to ban someone for example it won't apply here\n #@players.concat(new_players)\nend\n\n# good idea for this type of method/fuciton - put a ? in the name i.e. has_players?\n def search_players(player_name)\n # for player in @players\n # if player == player_name\n # return true\n # else\n # return false\n # end\n # end\n # better way to write - had implicit true/false result\n return @players.include?(player)\n end\n\ndef win_points(num)\n @points += num\nend\n\n # def team_name\n # return @team\n # end\n #\n # def coach_name\n # return @coach\n # end\n #\n # def points\n # return @points\n # end\n #\n #\n # def players\n # return @players\n # end\n\n\n\n # def player\n # return @player\n # end\n #\n # def add_player(player)\n # @players << player\n # end\n\nend", "def add_ai_player(type, user)\n @player = Player.new({:ai => type, :game_id => self.id, :user_id => user.id, :money => 100, :username => 'ai '+type.to_str, :location => self.get_empty_location(), :in_pot_hand => 0, :in_pot_current => 0})\n self.players << @player\n self.save\n end", "def add_computer\n puts(\"Enter a unique player name.\")\n name = gets.chomp\n @player_list.append(Player.new(\"Computer\"))\n @player_list.append(Player.new(name))\n\n end", "def add_players(names)\n @me.name = names[1]\n @opponent.name = names[2]\n p @me, @opponent\n run\n end", "def add_player(player)\n new_player = if player_one\n { player_two: player }\n else\n { player_one: player }\n end\n update_attributes(new_player)\n end", "def test_add_new_player\n team = SportsTeam.new(\"Celtic\", [\"Hendrik Larsson\", \"Captain Football\", \"Some Guy\"], \"Mr. Manager\")\n team.add_new_player(\"Dave Supercool\")\n assert_equal([\"Hendrik Larsson\", \"Captain Football\", \"Some Guy\", \"Dave Supercool\"], team.players)\n end", "def addplayer(number, money)\n\n\t\t\n\t\tnumber.times do |i|\n\n\n\t\t\t#puts i\n\t\t\t@players << Player.new(@names[i],money)\n\t\t\tif i == 0\n\t\t\t\t#puts \"enters if\"\n\t\t\t\t@players.at(i).makeuser\n\t\t\tend\n\t\t\t#puts @names[i]\n\t\tend\n\n\tend", "def add_point(player)\n end", "def add_player(player, tier = nil)\n # See if this player is already in this round\n return if participants.where(player_id: player.id).exists?\n\n Round.transaction do\n p1 = Participant.create!(round_id: id,\n tier_id: (tier || smallest_tier).id,\n player_id: player.id)\n\n create_games_for(p1)\n return p1\n end\n end", "def add_players\n # Ask for number of players\n puts(\"Enter the number of players.\")\n playerCount = Integer(gets.chomp) rescue false\n while !playerCount || playerCount < 1 do\n puts(\"Enter the number of players as an integer.\")\n playerCount = Integer(gets.chomp) rescue false\n end\n\n # List of names of players to ensure no duplicates\n usedNames = []\n\n # Get the names of the players\n while @player_list.size < playerCount\n # Ask for player identifier\n puts(\"Enter a unique player name.\")\n name = gets.chomp\n\n # Check if player name is already taken\n if usedNames.include?(name)\n puts(\"The name \\\"#{name}\\\" is already taken!\")\n # Go back to ask for a unique name again\n next\n end\n\n print \"\\e[H\\e[2J\"\n # Add new Player object to player list\n @player_list.append(Player.new(name))\n # Add name to list of used names\n usedNames.append(name)\n # Confirm player was added\n puts(\"#{name} has been added to the game.\")\n\n end\n\n # Confirm that players were added to game\n puts(\"#{playerCount} players added to game.\")\n end", "def add_player(new_party_member)\n @player_characters << new_party_member unless(@player_characters.include?(new_party_member))\n end", "def create_players\n players = []\n players << create_player('player_1')\n players << create_player('player_2')\n players\n end", "def add_players(number_of_players)\n\t\tn = 1\n\t\twhile number_of_players > 0\n\t\t\tprint \"\\nPlayer #{n}, What is your name? \"\n\t\t\tname = gets.chomp.downcase.split(\" \").each {|word| word.capitalize!}.join(\" \")\n\t\t\t@players << Player.new(name, n)\n\t\t\tn += 1\n\t\t\tnumber_of_players -= 1\n\t\tend\n\tend", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n @players = Player.all\n @players.each do |p|\n if p.id != @player.id\n @team = Team.create(name: p.name[0, 3] + @player.name[0, 3] + (p.id + @player.id).to_s, player_ids: [p.id, @player.id])\n else\n end\n end\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n puts(params);\n @player = Player.new(player_params)\n \n respond_to do |format|\n if @player.save\n # Tell the playerMailer to send a welcome email after save\n # @user_player = Userplayer.new(user_id: @user.id, player_id: @player_id)\n # if @user_player.save\n @tournament.players << @player\n # @tournament.update_attribute(num_players: @tournament.num_players + 1)\n format.html { redirect_to(root_path, notice: 'player was successfully added.') }\n format.json { render json: @player, status: :created, location: @player }\n # end\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def join( player )\n player.number = @players.size+1\n @players << player\n end", "def add_multiple_points(player)\n end", "def test_player_add\n pm = PlayerManager.new(1, {})\n p = Player.new(2, \"Bob\", \"3\", \"4\", 5, 6, 7, {}, 9, [])\n\n assert_equal(false, pm.exists?(\"Bobby\"), \"Player check not working!\")\n\n pm.add_player(p)\n assert_equal(true, pm.exists?(\"Bob\"), \"Player not added!\")\n\n assert_equal(2, pm.get_id(\"Bob\"), \"Player id isn't being stored\")\n end", "def add_match_day_player\n match_day_team = MatchDayTeam.find(params[:match_day_team_id])\n match_day_player = MatchDayPlayer.find(params[:id])\n match_day_team.match_day_players << match_day_player\n update_match_day_team(match_day_team)\n end", "def register_players(party, controller)\n return if party.blank?\n\n party.each_with_index do |pc, index|\n add(pc, :a, position: \"spawn_point_#{index + 1}\", controller: controller)\n end\n @current_party = party\n @combat_order = party\n end", "def add_winner\n @game = Game.find(game_id)\n game.winners ||= []\n game.winners << player_id\n game.save\n game.winners\n end", "def initialize(name)\n @name = name\n @games_won = 0\n @@all_players << self\n end", "def register_player!(params)\n self.player = Player.new(params)\n self.roles << :player\n self.save\n self.player.save\n self.player\n end", "def create_players\n\t\t\t\tnum_players.times do |i|\n\t\t\t\t\tplayer_class = Merlion::Player\n\t\t\t\t\tself.players[i] = create_player({ seat: i, class: player_class })\n\t\t\t\tend\n\t\t\tend", "def create_player curr_user_id\n curr_user = User.find(curr_user_id)\n new_player = Player.new\n new_player.player_name = curr_user.name\n new_player.user_id = curr_user_id\n new_player.player_email = User.find(new_player.user_id).email\n new_player.prev_player_id = new_player.next_player_id = -1\n new_player.topic_id = self.id\n new_player.is_dead = false\n new_player.save\n #set new player to head if first new player\n if self.last_registered_player_id == -1\n self.player_id = self.last_registered_player_id = new_player.id\n else\n if self.has_user(curr_user_id)\n puts 'error: this function should not even be accessible'\n return\n end\n curr_last = Player.find(self.last_registered_player_id)\n curr_last.next_player_id = new_player.id\n new_player.prev_player_id = curr_last.id\n self.last_registered_player_id = new_player.id\n curr_last.save\n end\n self.roster_count += 1\n self.save\n new_player.save\n return\n end", "def test_add_player\n @team.add_player(\"Judy\")\n assert_equal(4, @team.players.length)\n end", "def createplayers\n\n\t\t@bad_player_entries = Array.new\n\t\t@added_players = Array.new\n\t\t@error_count = 0\n\t\t\n\t\t# Get values from form field parameters\n\t\t\n\t\t@player_name = params[:Player1Name]\n\t\t@player_index = params[:Player1Index]\n\t\t@gid = params[:id]\n\n\t\tif !params[:Player1Name].empty?\n process_player(params[:id], params[:Player1Name], params[:Player1Index])\n\t\tend\n\t\t\n\t\t\n\t\tif @error_count > 0\n @game = Game.find(2)\n\t\t\trender('addplayers')\n else\n\t\t\tredirect_to(:action => 'gamelist')\n\t\tend\n\t\t\t\n\tend", "def new_player\n new_player = Player.new 0, 0\n id = SecureRandom.uuid;\n @players[id] = new_player\n {\"id\" => id, \"x\" => new_player.x, \"y\" => new_player.y}.to_json\n end", "def test_add_player_method\n team = Team.new(\"Best Team\", 0, \"Awesome Coach\", [\"Best Player\", \"Good Player\", \"Other Good Player\"])\n new_player = \"Great Player\"\n assert_equal(\"Great Player\", team.add_player(new_player).last)\nend", "def setup_players\n @players = []\n @players << add(Spaceship, 400, 320)\n @players << add(Tank, width/2, height-100)\n end", "def create\n @team = Team.find(params[:team_id])\n @player = @team.players.build(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to([@player.team, @player], :notice => 'Player was successfully created.') }\n format.json { render :json => @player, :status => :created, :location => [@player.team, @player] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_player(name)\n {\n \"id\" => @player_class.create(:player_name => name).id\n }\n end", "def create\n @player = Player.new(player_params)\n @player.user = current_user\n # automatically create a new team for the user if there isn't one already\n unless @player.team || @player.name.blank?\n team = Team.find_or_initialize_by(name: \"#{@player.name}'s Team\", code: @player.name.upcase)\n @player.team = team if team.save\n end\n respond_to do |format|\n if @player.save\n format.html { redirect_to(@player, :notice => 'Player was successfully created.') }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n team.destroy if team\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def spawn_player player; end", "def inject_players(array)\n\t\traise DiscrepantNumberOfPlayers if array.length != self.n_players\n\t\traise RepeatedPlayerIds if array.uniq.sort != array.sort\n\n\t\t@@logger.info { \"Injecting players\" } if have_logger?\n\t\tarray.each { |player_id|\n\t\t\tplayer = Player.create(:tournament => self, :in_tournament_id => player_id)\n\t\t\tplayer.save\n\t\t}\n\tend", "def initialize(players)\n self.players = players\n end", "def add_jersey_to_player\n @team.assign_jersey(@player, @jersey)\n\n redirect_to team_path(@team)\n end", "def create_players\n\n get_players.map do|player|\n Player.create(first_name: player[\"firstName\"],last_name: player[\"lastName\"],team: player[\"teamId\"], position: player[\"pos\"])\n end\n\nend", "def create_new_player\n @player = Player.new(self, nil, ServerConfig.start_room, @new_name, [], \"a typical person\", \"This is a normal, everyday kind of person.\", \"person\", @sex)\n @player.word_wrap = nil\n\n # TODO remove following lines\n require 'aethyr/extensions/objects/clothing_items' #why not\n require 'aethyr/extensions/objects/sword'\n shirt = Shirt.new\n pants = Pants.new\n undies = Underwear.new\n sword = Sword.new\n\n $manager.add_object(shirt)\n $manager.add_object(undies)\n $manager.add_object(pants)\n $manager.add_object(sword)\n\n @player.inventory << shirt\n @player.inventory << pants\n @player.inventory << undies\n @player.inventory << sword\n\n @player.wear(undies)\n @player.wear(pants)\n @player.wear(shirt)\n\n if @player.name.downcase == ServerConfig.admin.downcase\n @player.instance_variable_set(:@admin, true)\n end\n\n $manager.add_player(@player, @new_password)\n\n File.open(\"logs/player.log\", \"a\") { |f| f.puts \"#{Time.now} - #{@player.name} logged in.\" }\n\n @state = nil\n\n output(\"Type HELP HELP for help.\")\n end", "def create\n @player = Player.new(player_params)\n @player.save\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to [:admin, @player], notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n player = Player.new(player_params)\n if player.save\n render json: player, status: 201, location: [:api, player]\n else\n failed_to_create(player, \"player\")\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to \"/players/new\", notice: (@player.name + ' was successfully created.') }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def make_player\n\t\tputs \"\\nIf I may, master, what is your government name?\"\n\t\tname_input = gets.chomp\n#\t\t@name_1 = name_input.split.map {|i| i.capitalize}.join(\" \")\n#\t\t@user_name_1= new_name[0][(0..3)]+new_name[2][(0..3)]\n\t\tsign = @signs_array[0]\n\t\tPlayer.new(name_input,sign)\n\t\t$current_players[0] << @order[1]\n\t\t$current_players[0] << @signs_array[0]\n\t\t@signs_array = @signs_array.delete_at(0)\n\t\tputs \"\\nThank you!\\tNow I just need the next person.\"\n\t\t\n\t\tputs \"Other master, when ready, please type your government name.\"\n\t\tname_input = gets.chomp\n\t\tsign = @signs_array[-1]\n\t\tPlayer.new(name_input,sign)\n\t\t$current_players[1] << @order[0]\n\t\t$current_players[1] << @signs_array[-1]\n\t\tend", "def join\n @session = Session.where(unique_id: params[:id])\n @player = Player.new(\n name: params[:name],\n picture_url: params[:picture_url]\n )\n @session.players.push(@player)\n @session.save\n\n render status: :success\n end", "def initialize_players\n\n end", "def initialize_players\n initial_players = []\n if params[:player_names]\n player_names = params[:player_names].split(\",\")\n player_names.each do |tag|\n new_player = Player.create(:username => tag, :party_id => @party.id)\n initial_players.append(new_player)\n end\n end\n return initial_players\n end", "def initPlayers(names) # (names : string[]) : void\n names.each do |k|\n @players << Player.new(k)\n end\n end", "def new_player(msg)\n nick = msg.user.nick\n # Check if the user already has a character\n if Player.nick_exists? nick\n msg.reply \"#{nick} already has a character!\"\n return\n end\n # Make a new one\n Player.new_player(nick).save\n msg.reply \"Created new character for #{nick}!\"\n msg.reply \"To give your character a name, use: !player set name NAME\"\n msg.reply \"To give your character a race, use: !player set race RACE\"\n msg.reply \"To add a backstory, use: !player set backstory BACKSTORY\"\n end", "def set_players(num)\n @num_players=num\n for i in 0...@num_players\n @players[i] = Player.new(@ui.get_player_name(i+1))\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html {\n redirect_to @player, notice: I18n.t(\"messages.players.create.success\")\n }\n else\n format.html {\n @errors = @player.errors\n render action: \"new\"\n }\n end\n end\n end", "def initialize\n @players = []\n @p1 = Player.new('player')\n @players << @p1\n @p2 = ComputerPlayer.new('com')\n @players << @p2\n play\n end", "def add_ai_player\n @bots << setup_player(:bot => true)\n end", "def players\n @players ||= []\n end", "def players\n @players ||= []\n end", "def initPlayers(names)\n names.each do |n|\n @players << Player.new(n)\n end\n end", "def add_player(league_id, name, slack_name = '', admin = false, active = true)\n database do |db|\n db.execute 'INSERT INTO Player\n (LeagueID, DisplayName, SlackName, Admin, Active)\n VALUES\n (:league_id, :name, :slack_name, :admin, :active)',\n league_id, name, slack_name, admin ? 1 : 0, active ? 1 : 0\n recalc_elo(Time.now.to_i, league_id)\n return db.get_first_value 'SELECT PlayerID from Player\n WHERE DisplayName = :name\n AND LeagueID = :league_id\n COLLATE NOCASE',\n name, league_id\n end\nend", "def create_player\n return if !player.nil?\n\n player = Player.new\n player.user_id = id\n player.player_name = login\n \n return nil if !player.save\n return nil if !player.create_weapons\n \n player\n end", "def add_to_player_score (player)\r\n\tplayer.player_wins += 1\r\n\t@total_number_of_plays += 1\r\n\tend", "def new_game(players) \n\t\tsession.clear\n\t\tsession[:round_count] = 0\n\t\tsession[:player] = Array.new\n\t\tparams[:numplayers].to_i.times do |x|\n\t\t\tsession[:player][x] = Player.new\n\t\t\tsession[:player][x].name = \"Player#{x}\"\n\t\tend\n\t\t#Add Computer Player\n\t\tif params[:computer_easy] == \"yes\"\n\t\t\tcomputerPlayer = Player.new\n\t\t\tcomputerPlayer.name = \"Fake Teresa\"\n\t\t\tcomputerPlayer.computer = true\n\t\t\tcomputerPlayer.difficulty = 0\n\t\t\tsession[:player] << computerPlayer\n\t\tend\n\t\tif params[:computer_medium] == \"yes\"\n\t\t\tcomputerPlayer = Player.new\n\t\t\tcomputerPlayer.name = \"Pete Corolla\"\n\t\t\tcomputerPlayer.computer = true\n\t\t\tcomputerPlayer.difficulty = 1\n\t\t\tsession[:player] << computerPlayer\n\t\tend\n\t\tif params[:computer_hard] == \"yes\"\n\t\t\tcomputerPlayer = Player.new\n\t\t\tcomputerPlayer.name = \"Hairy Brian\"\n\t\t\tcomputerPlayer.computer = true\n\t\t\tcomputerPlayer.difficulty = 2\n\t\t\tsession[:player] << computerPlayer\n\t\tend\n\tend", "def add_song(song)\n @songs << song\nend", "def create\n room_code = params[:player][:room_id]\n room = Room.find_by_code(room_code)\n\n potential_existing_players = Player.where(:alias => params[:player][:alias], :room_id => room.id)\n \n if potential_existing_players.count > 0\n @player = potential_existing_players.first\n else\n @player = Player.new(player_params.merge(room_id: room.id))\n end\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to \"/play/#{room.id}/#{@player.id}\", notice: 'Player was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def enqueue_player(user_id)\n if !self.queued_players.find_by_user_id(user_id)\n self.queued_players.push(QueuedPlayer.create(user_id: user_id)) \n self.save\n end\n end", "def create\n @player = Player.new(player_params)\n @player.game = @game\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to game_player_path(id: @player.id), notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_team\n @players = User.available_users(@tournament.id)\n unless @tournament.registration_open\n flash[:danger] = \"Registration is closed\"\n redirect_to tournament_path(@tournament)\n end\n end", "def add username\n @members.add username\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.json { render json: @player, status: :created }\n else\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize\n @players = []\n @p1 = Player.new('p1')\n @players << @p1\n @p2 = ComputerPlayer.new('com')\n @players << @p2\n play\n end" ]
[ "0.90403396", "0.90256566", "0.88572186", "0.8794092", "0.8728051", "0.87264353", "0.8580402", "0.84765637", "0.8443745", "0.8371832", "0.83629704", "0.82856673", "0.81945497", "0.8167648", "0.8019482", "0.8019482", "0.7939238", "0.7760898", "0.77050006", "0.7642282", "0.7636054", "0.75412863", "0.7491247", "0.74755746", "0.74720573", "0.74145365", "0.7336586", "0.73221105", "0.7223703", "0.72125316", "0.7196887", "0.71619684", "0.7144243", "0.71313906", "0.70812875", "0.70808667", "0.6994334", "0.6958627", "0.6951681", "0.69341606", "0.6933845", "0.6862469", "0.68329686", "0.677685", "0.67395306", "0.67066544", "0.67000407", "0.66534317", "0.66434014", "0.65474117", "0.6545834", "0.65005535", "0.6464435", "0.6459188", "0.64522934", "0.6428524", "0.64055634", "0.63841003", "0.63742626", "0.6358299", "0.63572127", "0.62763274", "0.6245755", "0.6238708", "0.6234877", "0.6220817", "0.62101346", "0.619542", "0.6190001", "0.61870867", "0.61842763", "0.6166843", "0.6161511", "0.6152603", "0.61487883", "0.6142264", "0.6138766", "0.613344", "0.6122882", "0.6106304", "0.6091872", "0.6076568", "0.60609245", "0.60501814", "0.6048591", "0.6039906", "0.6039906", "0.60390204", "0.6037438", "0.60333645", "0.60207224", "0.6019569", "0.6017962", "0.6006165", "0.5988631", "0.5988539", "0.59692305", "0.5961535", "0.59568226", "0.59535366" ]
0.60104614
93
Add a method that takes in a string of a player's name and checks to see if they are in the players array.
def test_check_player_in__true result = @team.check_player_in("Valentina") assert_equal(true,result) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_name_in_players(player_name)\n return true if @players.include?(player_name)\nend", "def search_players(search_names)\n @player_names.include?(each_player)\n end", "def member?(player)\n players.include?(player)\n end", "def player(player_name)\n players.find{|player| player.name == player_name}\n end", "def name_checker(player_name)\n\tputs \"hi #{player_name}\"\nend", "def add_many(new_players)\n #this function is being passed an array so loop!\n for player in new_players\n # @players << (player)\n add_player(player)\n ##OR - issue with this method is if you change add players to ban someone for example it won't apply here\n #@players.concat(new_players)\nend\n\n# good idea for this type of method/fuciton - put a ? in the name i.e. has_players?\n def search_players(player_name)\n # for player in @players\n # if player == player_name\n # return true\n # else\n # return false\n # end\n # end\n # better way to write - had implicit true/false result\n return @players.include?(player)\n end\n\ndef win_points(num)\n @points += num\nend\n\n # def team_name\n # return @team\n # end\n #\n # def coach_name\n # return @coach\n # end\n #\n # def points\n # return @points\n # end\n #\n #\n # def players\n # return @players\n # end\n\n\n\n # def player\n # return @player\n # end\n #\n # def add_player(player)\n # @players << player\n # end\n\nend", "def method_missing(method_name, *args, &block)\n return super unless respond_to?(method_name)\n\n players.send(method_name, *args, &block)\n end", "def search_players(player_name)\n # for player in @players\n # if player == player_name\n # return true\n # else\n # return false\n # end\n # end\n # better way to write - had implicit true/false result\n return @players.include?(player)\n end", "def player_exist?(name)\n open_store \"players\" do |gd|\n gd.has_key? name.downcase\n end\n end", "def played_by?(username)\n @first_player.name == username || @second_player.name == username\n end", "def player(name)\n players.detect { |p| p.name == name }\n end", "def add_player(player_name)\n @player_names.push(player_name)\n end", "def add_players(names)\n @me.name = names[1]\n @opponent.name = names[2]\n p @me, @opponent\n run\n end", "def find_player(player)\n found = false\n for name in @players\n if player == name\n found = true\n end\n end\n return found\n end", "def add_player player\n p = player_by_id(player.id)\n if !p\n @players << player\n elsif p.name != player.name\n p.name = player.name\n end\n end", "def player_exist?(name)\n log \"Checking existence of #{name}\", Logger::Medium\n @storage.player_exist?(name)\n end", "def add_player(name)\n @players.push(name)\n end", "def add_player(player_name)\n player = Player.new(player_name)\n $players << player\n end", "def player_check(player_to_check)\n for player in @players\n return true if player_to_check == player\n end\n return false # could have used .include? method\n end", "def find_player(name)\n for footballer in @players\n return footballer if @players.include?(name)\n end\n end", "def check_method(constant, constant_name, method_name)\n instance = constant.new\n unless instance.respond_to?(method_name)\n @errors << \"Failed to load player '#{constant_name.to_s}' because it doesn't contain the method: #{method_name}\"\n return false\n end\n \n return true\n end", "def test_player_lookup\n assert_equal(true, @team.player_lookup(\"Suzie\"))\n assert_equal(false, @team.player_lookup(\"Kenneth\"))\n end", "def valid_player?(player)\n @current_player == player.to_sym\n end", "def add_player_to_players(player)\n players.push(player)\n end", "def add_player(name)\n\t\t@Player << name\n\t\tend", "def add_player(name)\n\t\t@Player << name\n\t\tend", "def add_player\n add_remove_player :add\n end", "def add_player(nu_player_name_str)\n @players.push(nu_player_name_str)\n end", "def add_player(new_player)\n @players << new_player\n end", "def confirmed_by(username)\n self.confirm1 if @first_player.name == username\n self.confirm2 if @second_player.name == username\n end", "def add_player(new_party_member)\n @player_characters << new_party_member unless(@player_characters.include?(new_party_member))\n end", "def checkPlayer(difficulty, attributeName, *modifiers)\r\n return $game_party.members[0].check(difficulty, attributeName, *modifiers)\r\n end", "def matching_player(player_name)\n all_players.find do |player|\n player[:player_name] == player_name\n end\nend", "def method_missing(name, *params)\n if player.respond_to? name\n player.send(name, *params)\n else\n super\n end\n end", "def update_players(input)\n # If name is the same as the player's name (@me.name?), then update_player is\n # called on @me and its return value is returned\n return update_player(@me, input) if @me.name?(input.shift)\n # If name is not the same as the player's name, then update_player is called\n # on @opponent and its return value is returned\n update_player(@opponent, input)\n end", "def isUsernameAvailable(username)\n player = self.playerWithUsername username\n return player == nil\n end", "def get_players\n\n end", "def test_add_player_to_players()\n team = SportsTeam.new(\"Belgium\", [\"Player 1\", \"Player 2\", \"Player 3\"], \"Mr Belgium\")\n team.add_player_to_players(\"Player 4\")\n assert_equal([\"Player 1\", \"Player 2\", \"Player 3\", \"Player 4\"], team.players())\n end", "def find_player(players, name)\n players.find do |player|\n player[:player_name] == name\n end\nend", "def add_new_player(new_player)\n players.push(new_player)\n end", "def found_player(player_name)\n binding.pry\n # Array of player Hashes\n all_players.find do |player| # player Hash\n # String # String\n player[:player_name] == player_name # Boolean\n end\nend", "def found_player(player_name)\n binding.pry\n # Array of player Hashes\n all_players.find do |player| # player Hash\n # String # String\n player[:player_name] == player_name # Boolean\n end\nend", "def test_find_player_found\n new_team = Team.new(\"Kerbals\", [\"Jeb\", \"Bob\", \"Bill\", \"Val\"], \"Gene\")\n search = new_team.find_player(\"Bob\")\n assert_equal(true, search)\n end", "def append_player(player)\n @players ||= []\n @players << player unless @players.include?(player)\n end", "def test_find_player_in_players()\n team = SportsTeam.new(\"Belgium\", [\"Player 1\", \"Player 2\", \"Player 3\"], \"Mr Belgium\")\n assert_equal(\"Player 2\", team.find_player_in_players(\"Player 2\"))\n end", "def player_stats(name)\n all_players.find do |player|\n player[:player_name] == name\n end\nend", "def Winner?(player)\r\n end", "def player_stats(name)\n players[name]\nend", "def alive?(playerName,points)\n if playerName == \"ikk\" && points > 30 || playerName == \"gut\" && points > 10\n puts true\n else\n puts false\n end\nend", "def find_player(name)\n all_players.find {|player| name == player.fetch(:player_name)}\nend", "def player_stats(player_name_arg)\n get_me_all_players_please().find do |player_hash|\n player_hash[:player_name] == player_name_arg\n #binding.pry\n end\nend", "def player_stats(playerName)\n players[playerName]\nend", "def player_exists?(name, league_id, player_id = 0)\n database do |db|\n player = db.get_first_value 'SELECT * from Player\n WHERE DisplayName = :name\n AND LeagueID = :league_id\n AND PlayerID != :player_id\n COLLATE NOCASE',\n name, league_id, player_id\n\n return !player.nil?\n end\nend", "def get_player_by_name n\n @players.each{|p| return p if p.try(:name).try(:downcase) == n.try(:downcase) }\n end", "def player(num_players, player_num)\n loop do\n print \"What player do you call: \"\n called_player = gets.chomp.to_i\n if called_player != player_num && called_player.between?(1, num_players)\n return called_player\n else\n print \"Please enter a valid player number...\\n\"\n end\n end\n end", "def player_by_name name\n @players.select {|p| p.name == name}.first\n end", "def player_has_played?(player)\n played_cards[player].present?\n end", "def method_missing(m, *args)\n player.send(m, *args)\n end", "def add_player(player_name)\n player = Player.new(player_name, 3)\n @players.push(player)\n end", "def add_player(new_player)\n @team_members.push(new_player)\n end", "def hasMatch(function_name, list)\n list.any? {|list_item| public_send(function_name, list_item)}\nend", "def add_player(m)\n return if !@game or !already_exists?(m.user.authname)\n\n unless @game.players.map(&:irc_authname).include?(m.user.authname)\n @game.players << create_gamer(m)\n\n need_players = @limit - @game.players.size\n\n if @timer\n @timer.stop\n else\n @timer = Timer(PENDING_DELAY, shots: 1, start_automatically: false) do\n @game = nil\n Channel(m.channel.name).send I18n.mixer.game_cancelled\n end\n end\n\n if ready_to_begin?\n each_team { |blue, red| begin_game!(m, blue, red) }\n else\n @timer.start\n\n m.reply I18n.mixer.players(show_players)\n m.reply I18n.mixer.need_players(need_players)\n end\n end\n end", "def filter(player)\n \tfilters = players.select{|player| player.position == position}\n \tif(filters.count>0) \n \t\treturn true\n \telse\n \t\treturn false;\n end\n\n def create_player(name,position)\n \tif (filter(Player.new(name,position)) == false)\n \t\tPlayer.new(name,position)\n \tend\n end\n\nend", "def has_name?(name)\n names.include?(name)\n end", "def mplayer_respond_to?(method, include_private = false)\n (@player.nil? && MPlayer::Slave.method_defined?(method)) ||\n @player.respond_to?(method)\n end", "def name_all_players\n (0..num_players - 1).each { |i| @players[i].name_player('Player' + i.to_s)}\n end", "def won_point(player_name)\n _player = player(player_name)\n raise StandardError.new(\"No player names #{player_name} is playing in the current game\") if _player.nil?\n _player.add_point\n end", "def add_player()\n @players.push(players)\n end", "def player_stats (player_name)\n lookup_by_player(player_name);\nend", "def add_remove_player( opt )\n return false unless ADD_REMOVE_OPTS.include? opt\n\n if !(params[:player])\n flash[:notice] = \"You did not select a player to #{opt.to_s}.\"\n elsif @game.started?\n flash[:notice] = \"'You can only #{opt.to_s} players to a game before starting.\"\n else\n if params[:player].include? :id\n new_plyr = Player.find params[:player][:id]\n @game.send(ADD_REMOVE_OPTS[opt], new_plyr)\n else\n flash[:notice] = \"You did not select a player to #{opt.to_s}.\"\n end\n end\n redirect_to(game_url)\n end", "def winner\n @players.each do |current_player|\n if current_player.position >= length\n #puts \"#{current_player.name} JUST WON!!!\"\n return \"#{current_player.name}\"\n end\n end\n end", "def onalg_player_has_declared(player, name_decl, points)\r\n log \"#{player.name} ha dichiarato #{nome_mariazza(name_decl)}\\n\"\r\n #if @player_on_gui[:player] == player\r\n #@app_owner.disable_bt(name_decl)\r\n #end\r\n str = \"Il giocatore #{player.name} ha accusato la\\n#{nome_mariazza(name_decl)}\\n\"\r\n str.concat(\"da #{points} punti\") if points > 0\r\n if @option_gfx[:use_dlg_on_core_info]\r\n @msg_box_info.show_message_box(\"Mariazza accusata\", str, false)\r\n end\r\n # adjourn points\r\n @cards_taken.adjourn_points(player, points)\r\n \r\n if @option_gfx[:autoplayer_gfx]\r\n @alg_auto_player.onalg_player_has_declared(player, name_decl, points)\r\n end\r\n \r\n # refresh the display\r\n @app_owner.update_dsp\r\n end", "def is_movie_available_1(name)\n movies = [\"Thor\", \"Captain America\", \"Hulk\", \"Iron Man\"]\n movies.include?(name) ? \"yes it's playing\" : \"no it's not playing\"\nend", "def add_player(player)\n # Confirm user isn't already playing a game\n return errors.add(:base, 'Player is already playing a game') unless player.games.active.count == 0\n # Confirm the game is not full\n return errors.add(:base, 'Game is full') unless players.count < num_players\n # Add player\n game_players.create(player: player)\n start if players.count == num_players\n end", "def respond_to?(method_name, include_private = false)\n [\"users\"].include? (method_name.to_s) || super\n end", "def player_stats(player_name, hashketball)\r\n player_name.capitalize!\r\n if hashketball[:home][:players].include?(player_name)\r\n hashketball[:home][:players][player_name][:stats]\r\n elsif hashketball[:away][:players].include?(player_name)\r\n hashketball[:away][:players][player_name][:stats]\r\n else\r\n \"No player found.\"\r\n end\r\nend", "def add_new_player(new_player)\n @players.push(new_player)\n end", "def test_check_player\n result = @team.check_player('Leah')\n assert_equal(true, result)\n end", "def player \n \"player\" \n end", "def is? target\n\t\treturn target.downcase.to_sym == :player\n\tend", "def add_players\n # Ask for number of players\n puts(\"Enter the number of players.\")\n playerCount = Integer(gets.chomp) rescue false\n while !playerCount || playerCount < 1 do\n puts(\"Enter the number of players as an integer.\")\n playerCount = Integer(gets.chomp) rescue false\n end\n\n # List of names of players to ensure no duplicates\n usedNames = []\n\n # Get the names of the players\n while @player_list.size < playerCount\n # Ask for player identifier\n puts(\"Enter a unique player name.\")\n name = gets.chomp\n\n # Check if player name is already taken\n if usedNames.include?(name)\n puts(\"The name \\\"#{name}\\\" is already taken!\")\n # Go back to ask for a unique name again\n next\n end\n\n print \"\\e[H\\e[2J\"\n # Add new Player object to player list\n @player_list.append(Player.new(name))\n # Add name to list of used names\n usedNames.append(name)\n # Confirm player was added\n puts(\"#{name} has been added to the game.\")\n\n end\n\n # Confirm that players were added to game\n puts(\"#{playerCount} players added to game.\")\n end", "def possessive(player_name)\n if player_name.downcase.ends_with?('s')\n player_name + \"'\"\n else\n player_name + \"'s\"\n end\n end", "def player_name\n player.name\n end", "def create_ai_player(player_position)\n if player_position == 1\n player = AIPlayer.new(name: \"Jack the Computer\")\n elsif player_position == 2\n player = AIPlayer.new(name: \"Jill the Computer\")\n else\n puts \"Something happened here - Create AI Players\"\n end\nend", "def game_check(player_symbol, player_name,turn)\n win_conditions = [[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]\n win_conditions.each do |condition|\n print \"\\n#{player_name} win!\" if condition.all?{|element| @space[element]==player_symbol}\n end\n print \"\\nTie game!\" if turn == 8\n end", "def check_if_valid(player_move)\n [\"rock\", \"paper\", \"scissors\", \"spock\", \"lizard\"].include?(player_move.downcase)\n end", "def player_in_lobby\n lobby.player(self) rescue false\n end", "def player_name\n puts \"What is your name?\"\n name = gets\n name_chomped = name.chomp.capitalize\n puts \"Hi #{name_chomped}! How are you doing today?\"\n response = gets.capitalize\n if response.include? \"not\"\n \tputs \"I am sorry, there's nothing I can do. Let's get on with the game.\"\n elsif response.include? \"Good\" or response.include? \"Great\" \n \tputs \"I am sure you are! But you won't be if you lose!\"\n else\n \tputs \"Okay! Good Luck with the game!\"\n end\n name_chomped\nend", "def initPlayers(names) # (names : string[]) : void\n names.each do |k|\n @players << Player.new(k)\n end\n end", "def helper_for_list_moves(player, piece_owner, equal)\n if equal\n player == piece_owner\n else\n player != piece_owner\n end\n end", "def find_player(players, name)\n # 1. write out what I want to do here\n # 2. write out the ideal code for this\n\n # 1. look at each player\n # 2. pick the one whose name matches\n\n # Very straightforward, so again, we should do the work here.\n # Now if we're looping through all the players to find the right one,\n # we could start in the same way that we started trying to do get_all_players.\n # And we'll end up with something like this:\n the_player = {}\n players.each do |player|\n if player[:player_name] == name\n the_player = player\n end\n end\n the_player\n\n # But, as we know. This probably isn't ideal. So let's look for a method\n # that better does what we want. Back to the docs:\n # https://ruby-doc.org/core-2.2.0/Array.html\n # ...\n # Back? What did you find?\n # There are two that look interesting: .select and .find\n # They both read like they do what we want, but there must be a difference.\n the_player = players.select do |player|\n # .select wants you to return a true or false value\n # anything true will count as a match that will be returned.\n # So all we need is the conditional part of our if statement:\n player[:player_name] == name\n end\n\n\n # Check the result, and it looks almost good.\n # the_player == [{ player }]\n # An array with a single player.\n # We could return the matching player like this:\n the_player[0]\n # However, that's not ideal. If we read .select more closely, we realize that\n # it returns *all* matches. So if more than one thing matches our conditional,\n # then this array will be more than a single thing.\n\n # Let's try .find:\n the_player = players.find do |player|\n # It expects the same thing so the same conditional here:\n player[:player_name] == name\n end\n # binding.pry\n # Check the result, and it looks perfect!\n # the_player == { player }\n # So what is the difference?\n # .find will return the very *first* match.\n # .select will return all matches; hence the array as a result.\n # When you need to just find a single thing, use .find.\n # When you want to select all the matches, use .select.\n the_player\nend", "def add_new_player(new_player)\n @players.push(new_player)\nend", "def has(method_name)\n @methods.include?(method_name)\n end", "def create_player(num, rules)\n n =num.to_s\n puts \"Enter a name for Player \" + n + \":\"\n name = gets.chomp\n puts \"Is Player\" + n + \" a HUMAN or a COMPUTER?\"\n valid = [\"HUMAN\",\"COMPUTER\",\"COMP\"]\n control = check_input(valid)\n p = Ai_Player.new(name,rules) if control == \"COMPUTER\" || control == \"COMP\"\n p = Player.new(name,rules) if control == \"HUMAN\"\n p\nend", "def main_commands_enabled\n $game_party.exists\n end", "def main_commands_enabled\n $game_party.exists\n end", "def main_commands_enabled\n $game_party.exists\n end", "def test_check_for_player\n team = Team.new(\"Best Team\", 0, \"Awesome Coach\", [\"Best Player\", \"Good Player\", \"Other Good Player\"])\n player = \"Best Player\"\n assert_equal(\"Best Player\", team.check_for_player(player))\nend", "def name_all_players()\n set_name()\n set_other_name()\n end", "def check\n case $input\n when 'inv'\n list\n when 'get'\n get\n add\n when 'n', 'north'\n $player.go($player.location.n)\n when 's', 'south'\n $player.go($player.location.s)\n when 'e', 'east'\n $player.location.go('e')\n when 'w', 'west'\n $player.location.go('w')\n when 'search'\n $player.location.search\n when 'buy'\n buy\n when 'l', 'look'\n $player.location.look\n when 'help'\n help\n when 'info'\n info\n when 'stats'\n $player.stats\n else puts 'That is not a valid command.' \n end\n end", "def event?\n\t\t\t\t(strings.first.match(/player\\./) || strings.first.match(/punkBuster/)) ? true : false\n\t\t\tend" ]
[ "0.74835926", "0.6648027", "0.65395707", "0.65020823", "0.64950347", "0.64687777", "0.6429911", "0.63458514", "0.62315506", "0.61842775", "0.61831796", "0.60775894", "0.60381764", "0.6021471", "0.601643", "0.59941936", "0.5988815", "0.5965177", "0.59152746", "0.5872955", "0.5870602", "0.58619034", "0.5860482", "0.58522356", "0.5812402", "0.5812402", "0.5811219", "0.5809933", "0.58065087", "0.57921296", "0.57893944", "0.57866126", "0.57537854", "0.5752611", "0.5717506", "0.5716298", "0.57039356", "0.56755763", "0.56713367", "0.56708974", "0.5636737", "0.5636737", "0.563161", "0.56277686", "0.56264454", "0.56104404", "0.5591599", "0.55850923", "0.5568926", "0.5560253", "0.5546986", "0.5543313", "0.55309355", "0.55162203", "0.5514765", "0.55092555", "0.5497664", "0.5491929", "0.54911184", "0.54854494", "0.54719967", "0.5467025", "0.5465611", "0.54642105", "0.5455115", "0.54522526", "0.54481816", "0.54164", "0.5411014", "0.54085225", "0.53909284", "0.53743213", "0.5359383", "0.5358998", "0.53474736", "0.53409386", "0.5338949", "0.53091025", "0.5306806", "0.529502", "0.5293541", "0.5292868", "0.529056", "0.52811295", "0.52801967", "0.5273257", "0.527319", "0.5254127", "0.52440286", "0.52439654", "0.5240323", "0.52395946", "0.5238454", "0.5231417", "0.52175415", "0.52175415", "0.52175415", "0.52135557", "0.5210343", "0.5207699", "0.52036685" ]
0.0
-1
Add a points property into your class that starts at 0.
def test_add_points assert_equal(0,@team.points) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_points\n self.points ||= 0.0\n end", "def add_points_property(points_gained)\n @points = points_gained\n return @points\nend", "def set_points!\n self.points = 0 unless self.points.presence\n end", "def initialize_points\n self.current_points = 0\n self.expiring_points = 0\n end", "def initialize()\n @points = []\n end", "def initialize(points)\n @points = points\n end", "def set_default_current_points \n self.current_points = 0\n end", "def addPoints(points) \n\t\t@points += points\n\tend", "def points; end", "def initialize(pts = nil)\n self.points = Array.new\n self.add_points pts if pts\n end", "def points\n -1\n end", "def points\n 1\n end", "def points #:nodoc:\n [self]\n end", "def points #:nodoc:\n [self]\n end", "def default_points\n \tself.point_bank = 1000\n end", "def initialize(x,y)\n@x,@y = x, y\n# Initialize method\n# Sets initial values for instance variables\n# Use the class variables in this instance method to collect data\n@@n += 1\n# Keep track of how many Points have been created\n@@totalX += x\n# Add these coordinates to the totals\n@@totalY += y\nend", "def points\n []\n end", "def initialize(point_xy = [0, 0])\n @point_xy = { x: point_xy[0].to_i, y: point_xy[1].to_i }\n chxyattr\n end", "def initialize(points, colour) #position, points, colour)\n super(colour) #position, colour)\n @points = points\n #puts \"PointsPart\"\n #@points.each { |p| puts \"(#{p.x}, #{p.y})\" }\n end", "def set_point_count!\n points = self.concatenate_data_arrays('x', 'coordinates').count\n self.update!(points: points)\n self.points\n end", "def initialize(x,y) # Initialize method\n @x,@y = x,y # Sets initial values for instance variables\n \n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += @x # Add these coordinates to the totals \n end", "def points\n @obj['points']\n end", "def base_points\n points\n end", "def points\n @puntos = 0\n students.each do |s| \n @puntos += s.points\n end\n @puntos += house_points\n end", "def points=(points)\n @points = []\n points.each do |point|\n @points.push(x: point[0], y: point[1])\n end\n end", "def add_point\n end", "def initialize(name, value)\n @name = name\n @value = value\n @points = 0\n end", "def initialize(x,y)\n @x,@y = x, y # Sets initial values for instance variables\n \n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += x # Add these coordinates to the totals\n @@totalY += y\n end", "def points=(arrayOfPoints)\n @elementHash[:points] = arrayOfPoints\n end", "def initialize(x,y) # Initialize method\n @x,@y = x, y # Sets initial values for instance variables\n\n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += x # Add these coordinates to the totals\n @@totalY += y\n end", "def initialize(x,y)\n @x,@y = x, y # Sets initial values for instance variables\n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += x # Add these coordinates to the totals\n @@totalY += y\n PointStats.instance.record(self)\n end", "def points=(array)\n raise ArgumentError unless array.is_a? Array\n @points = []\n array.each {|point| self << point}\n end", "def initialize(center)\n @center = center\n @points = []\n end", "def initialize(points)\n @points = points.map.with_index { |(x, y, name), idx|\n Point.new(x, y, idx).tap { |p| p.name = name if name }\n }\n @sorted_points = @points.sort # Point implements <=> to sort by X and break ties by Y\n triangulate(@sorted_points)\n end", "def add_point\n @score += 1\n end", "def add_points(points)\n @correct_answers += 1\n @points += points\n end", "def initialize\n @points = 10.times.map { Point.new } #.map produeces a new array. 10.times/create a new array - of Point.new. So it creates \n #10 points and puts them into a new array.\n end", "def initialize\n self.x, self.y = 0, 0\n end", "def xy\n @attributes.fetch('xy', [0.0, 0.0])\n end", "def initialize(points, color, weight, opacity)\n self.var = nil\n self.points = points\n self.color = color\n self.weight = weight\n self.opacity = opacity\n end", "def add point\n self.x += point.x\n self.y += point.y\n self\n end", "def initialize( point_array )\n @datapoints ||= {}\n @count = count || 30\n \n point_array.each do |x_value, y_value|\n y_value = y_value.to_f\n @datapoints[x_value] = y_value\n end\n end", "def update!(**args)\n @points = args[:points] if args.key?(:points)\n end", "def points\n @data['points'].to_i\n end", "def initialize\n @x = 0\n @y = 0\n set_obj(self)\n end", "def initialize(point)\n @point = point\n end", "def points\n self.votes.inject(0) { |points, vote| points + vote.value }\n end", "def points\n self.votes.inject(0) { |points, vote| points + vote.value }\n end", "def set_points\n @points = PointBuilder.new(\n :only => Carnivore::Config.get(@conf_key, :only),\n :except => Carnivore::Config.get(@conf_key, :except)\n )\n self\n end", "def initialize(name)\n @points = 3\n @name = name\n end", "def initialize\n @points = 0\n @opponent = opponent\n end", "def map(items)\n self.push(:points => { :point => items})\n end", "def reset_points\n @points = 0\n @opponent.points = 0\n end", "def add!(point)\r\n @x += point.x\r\n @y += point.y\r\n end", "def points\n MSPhysics::Newton::CurvySlider.get_points(@address)\n end", "def points\n MSPhysics::Newton::CurvySlider.get_points(@address)\n end", "def initialize\n self.position = 0\n end", "def position=(point); end", "def +(ts)\n self.clone.add_points ts\n end", "def points\n @results.inject(0.0) { |t, r| t += r.points }\n end", "def points\n db[:points]\n end", "def +(point)\n\t\t\t\tx = nil\n\t\t\t\ty = nil\n\t\t\t\t\n\t\t\t\tif !@x.nil? || !point.x.nil?\n\t\t\t\t\tx = @x.to_i + point.x.to_i\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif !@y.nil? || !point.y.nil?\n\t\t\t\t\ty = @y.to_i + point.y.to_i\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tself.class.new(x, y)\n\t\t\tend", "def up\n Point.new(@x, @y + 1)\n end", "def up\n Point.new(@x, @y + 1)\n end", "def addPoint( x, y) \n point = PVector.new(x, y)\n @points.push(point)\n end", "def initialize(coords = [0.0,0.0])\n self.coords = coords;\n end", "def points()\n\t\t\tfilter()\n\t\t\treturn @points_floor + @points_ceil.reverse\n\t\tend", "def initialize(*points_or_lines)\n @points = []\n points_or_lines.each { |pol| self << pol }\n end", "def initialize(_x = 0, _y = 0)\n if `typeof(#{_x})` == \"object\"\n super(_x)\n else\n @native = `new Phaser.Point(#{_x}, #{_y})`\n super(@native)\n end\n end", "def initialize (start_pos, color=nil)\n super(\"p\", start_pos, nil,color)\n\n if self.color == 'black'\n self.move_increments = [[-1,0]]\n self.attack_increments = [[-1,1],[-1,-1]]\n elsif self.color == 'white'\n self.move_increments = [[1,0]]\n self.attack_increments = [[1,1],[1,-1]]\n end\n\n end", "def assign_zero_experience_points\n self.points_awarded = 0\n self.awarded_at = Time.zone.now\n self.awarder = User.stamper || User.system\n end", "def current_pts\n self.score\n end", "def initialize\n @n, @totalX, @totalY = 0, 0.0, 0.0\n end", "def combo_points=(n)\n @combo_points = [[n, 0].max, 100].min\n end", "def index\n @points = Member.all.sort_by {\n |member| (member.points_to_add.present? ? member.points_to_add : 0)\n }.reverse\n end", "def points_payment\n\t\t(points || 0) * amount / 100\n\tend", "def generate\n #create random number generator\n rng = Random.new\n @points = Array.new\n\n #num_points times, make random value in ranges \n @num_points.times do\n @points << [rng.rand(@x_lims), rng.rand(@y_lims)]\n end\n end", "def assign_default_points_per_member\n if points\n card_member_having_developer = self.card_member_having_developer\n member_counts = card_member_having_developer.count\n if member_counts == 1\n cm = card_member_having_developer.first\n cm.auto_points_distribution = true\n cm.update_attributes(individuals_point: points)\n elsif member_counts > 1\n points_array = points_partion_array(member_counts)\n card_member_having_developer.each_with_index do |cm, index|\n cm.auto_points_distribution = true\n cm.update_attributes(individuals_point: points_array[index])\n end\n end\n end\n end", "def + point\n\t\tPoint.new(@x+point.x, @y+point.y)\n\tend", "def add_points_and_save(xp_value)\n self.points_total += xp_value\n self.save\n end", "def create\n points.insert(coordinates: attribute)\n end", "def add_cpoint(point)\n end", "def test_add_points()\n team = SportsTeam.new(\"Belgium\", [\"Player 1\", \"Player 2\", \"Player 3\"], \"Mr Belgium\")\n team.add_points(3)\n assert_equal(3, team.points())\n end", "def initialize # A normal initialization method\n @n, @totalX, @totalY = 0, 0.0, 0.0\n end", "def initialize # A normal initialization method\n @n, @totalX, @totalY = 0, 0.0, 0.0\n end", "def points\n @points ||= begin\n h = Hash.new\n Point::ABS_POINTS_DATA.each do |pt_name|\n h.merge!(pt_name => Point.new(film, pt_name))\n end\n h\n end\n end", "def display_total\n puts \"Your points: #{self.points}\"\n end", "def step_one_points\n\t\tpoints = 0\n\t\tpoints+=50 if !link.blank?\n\t\tpoints+=25 if !title.blank?\n\t\tpoints+=25 if !company.blank?\n\t\tpoints\n\tend", "def initialize data\n raise \"data must have more than one attribute and more than one data point\" unless data.size > 1 and data.first.size > 1\n @data = data\n @points = self.class.pointify data\n @minimums, @maximums = compute_minimums_and_maximums\n Point.next_id = 0\n end", "def initialize(x=0,y=0)\n super()\n @x = x\n @y = y\n end", "def initialize(*args)\n @points = []\n @encode_points = true\n\n extract_options!(args)\n add_points(args)\n end", "def add_point(point)\n return if point.x < 1 || point.y < 1 || point.x > @max_x-1 || point.y > @max_y-1\n if @glade['toolbar_move'].active?\n if @first_point \n @start = point\n @first_point = false\n @points = [@start]\n print\n else\n @finish = point\n @points = []\n move\n end\n elsif @glade['toolbar_record_points'].active?\n if @x_coords[point.x]\n @glade['statusbar'].push(@context, \"Este programa não suporta 2 ou mais pontos com mesma X-coordenada!\")\n else\n @points << point\n @x_coords[point.x] = point\n end\n print\n end\n end", "def add(point)\r\n new_point = Marshal.load(Marshal.dump(self))\r\n new_point.x = @x + point.x\r\n new_point.y = @y + point.y\r\n return new_point\r\n end", "def increment_points(points)\n self.balance = self.balance.to_i + points.to_i\n self.save\n end", "def set_points!(points, color)\n\t\tpoints.each do |point|\n\t\t\tset_point!(point, color)\n\t\tend\n\tend", "def initialize(point, value)\n @point = point.clone\n @value = value\n end", "def initialize(x = 0, y = 0)\n if x.is_a? Float\n x = x.to_i\n y = y.to_i\n end \n @x = x\n @y = y\n end", "def map(points)\n points\n end", "def add_point(color) \n @owner = color\n @points += 1 \n @image = @@images[@owner+@points.to_s]#Gosu::Image.new(@@gosu_window, 'media/grid/'+@points.to_s+'.'+@owner+'.png', true) if @points < 4\n if over_max?(@points, @x,@y, @width-1,@height-1)\n @points = 0 \n @array[@x-1][@y].add_point(color) if @x > 0\n @array[@x+1][@y].add_point(color) if @x < @width -1\n @array[@x][@y-1].add_point(color) if @y > 0\n @array[@x][@y+1].add_point(color) if @y < @height-1\n @image = @@images[@owner+@points.to_s]#Gosu::Image.new(@@gosu_window, 'media/grid/'+@points.to_s+'.'+@owner+'.png', true) \n end\n end", "def score=(points)\n s = points\n s = 0 if s < 0\n s = 100 if s > 100\n self[:score] = s\n rerank\n end", "def points\n object.polygon.points\n end" ]
[ "0.81180793", "0.7746719", "0.7737274", "0.753523", "0.7382177", "0.732844", "0.7149211", "0.71415704", "0.7119873", "0.70620877", "0.6903722", "0.68546915", "0.68369204", "0.68369204", "0.66676635", "0.6608889", "0.65687954", "0.6565761", "0.656014", "0.6543312", "0.65330774", "0.64677244", "0.6459111", "0.6435339", "0.64198923", "0.64098006", "0.63899976", "0.63880885", "0.6382147", "0.6347074", "0.6336315", "0.63291353", "0.632086", "0.6300827", "0.62433267", "0.6235625", "0.6193296", "0.6143277", "0.61389196", "0.61244285", "0.6083518", "0.6073387", "0.60602176", "0.60530543", "0.60492283", "0.6029053", "0.60246074", "0.60246074", "0.6019584", "0.6006077", "0.600514", "0.5984407", "0.5978387", "0.59698296", "0.5955327", "0.5955327", "0.592918", "0.59252715", "0.59218097", "0.5915834", "0.58831453", "0.5875045", "0.5871645", "0.5871645", "0.5865927", "0.5837792", "0.583585", "0.58289075", "0.5818464", "0.5815876", "0.5812044", "0.5805181", "0.58038354", "0.5782903", "0.5767733", "0.57658166", "0.5761151", "0.57605165", "0.57593167", "0.57504636", "0.57289267", "0.57285637", "0.57237715", "0.57037836", "0.57037836", "0.56869847", "0.56768787", "0.567595", "0.566872", "0.5660281", "0.56515193", "0.5651096", "0.56421626", "0.5631806", "0.5626254", "0.5626163", "0.5617799", "0.561642", "0.5616093", "0.5611272", "0.560405" ]
0.0
-1
Create a method that takes in whether the team has won or lost and updates the points property for a win.
def test_update_points @team.update_points("win") assert_equal(3,@team.points) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_points__when_win\n sports_team = SportsTeam.new('Benfica', ['Rafa', 'Raul', 'Pizzi', 'Odisseias'], 'Bruno Nascimento', 0)\n sports_team.add_or_remove_points(2)\n assert_equal(2, sports_team.points())\n end", "def wins_ball(winner)\n # TODO: Think it's gross to pass an integer instead of a player object?\n # Then reimplement this method!\n winner.points += 1\n end", "def record_won_ball!\n @points += 1\n win?\n end", "def record_won_ball!\n # Check to see if a win-point results in a win-game outcome. \n if @points > 3 && @points >= @opponent.points + 2\n @game_points += 1\n \n record_won_game!\n reset_points\n\n else\n @points +=1 \n end \n end", "def mark_win!\n # update point tables\n if @winner && @looser\n game.point_tables.create(winner_id: winner, looser_id: looser, started_at: game.started_at, ended_at: Time.zone.now, result: 'won')\n game.update_status(Game::WIN)\n end\n\n # reset board!\n reset_board!\n\n # reset winner and looser histories!\n @winner = false\n @looser = false\n\n true\n end", "def record_won_ball!\n @points +=1\n end", "def update_points(result)\n if result == \"Win\"\n @points =+ 1\n elsif result == \"Loss\"\n #No change to points\n else\n #error of some kind\n end #End of if\n\n end", "def won_with_points\n self.chips += 2 * self.bet_chips\n self.is_complete = true\n \"#{name}'s point is bigger than dealer! #{name} get extra one bet. Win for #{name}\"\n end", "def wins_point(winner)\n \n if winner == @player1\n @player1.record_won_ball!\n @score_counter += 1\n return @player1.points\n else\n @player2.record_won_ball!\n @score_counter += 1\n return @player2.points\n end\n # TODO: Think it's gross to pass an integer instead of a player object?\n # Then reimplement this method!\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def record_won_ball!\n @points += 1\n end", "def win_pts\n self.score += 1\n end", "def games_won_or_lost(add_one_point)\n if add_one_point > 0\n return\n @points += add_one_point\n else\n add_one_point == 0\n return\n @points \n end\nend", "def record_won_set!\n reset_points\n reset_game_points \n \n @set_points +=1\n end", "def record_won_game!\n if @game_points >= 5 && @game_points >= @opponent.game_points + 2\n\n record_won_set!\n end\n end", "def record_won_ball!\n @points += 1\n return @points\n end", "def record_won_ball!\n @points += 1\n return @points\n end", "def wins_ball(winner)\n winner.record_won_ball!\n end", "def wins_ball(winner)\n winner.record_won_ball!\n end", "def test_team_win\n @team.was_the_match_a_victory(true)\n assert_equal(1, @team.points)\n @team.was_the_match_a_victory(true)\n @team.was_the_match_a_victory(true)\n @team.was_the_match_a_victory(false)\n @team.was_the_match_a_victory(true)\n assert_equal(4, @team.points)\n end", "def test_points_update_after_win\n brechin_bball_team = Team.new( @team, @players, @coach )\n brechin_bball_team.points_update('win')\n assert_equal(2, brechin_bball_team.team_points)\nend", "def set_games_won()\n @score_count.set_games_won()\n end", "def update_score\n if @round_won\n @player.increment_rounds_won\n else\n @player.increment_rounds_lost\n end\n end", "def wins_ball(wins)\n if wins == 1\n @player1.record_won_ball!\n else\n @player2.record_won_ball!\n end\n end", "def wins_ball(winner)\n # this is where we increment the winner of each ball by 1 point\n if winner == 1\n @player1.record_won_ball!\n #Player.record_won_ball!(@player1)\n elsif winner == 2\n @player2.record_won_ball!\n end\n\n\n end", "def wins_ball(winner)\n # this is where we increment the winner of each ball by 1 point\n if winner == 1\n @player1.record_won_ball!\n #Player.record_won_ball!(@player1)\n elsif winner == 2\n @player2.record_won_ball!\n end\n\n # TODO: Think it's gross to pass an integer instead of a player object?\n # Then reimplement this method!\n end", "def add_points(team)\n games_played = Game.where(\"team_one = #{team.id} or team_two = #{team.id}\")\n @rankings[team.name][\"points_for\"] = 0\n @rankings[team.name][\"points_against\"] = 0\n if !games_played.nil?\n games_played.each do |game|\n if !game.winner.nil? && !game.winner_score.nil?\n if team.id == game.winner # if team won, add winner points to PF and losing points to PA\n @rankings[team.name][\"points_for\"] += game.winner_score\n @rankings[team.name][\"points_against\"] += game.loser_score\n else # if team lost, add winner points to PA and losing points to PF\n @rankings[team.name][\"points_for\"] += game.loser_score\n @rankings[team.name][\"points_against\"] += game.winner_score\n end\n end\n end\n end\n end", "def won_game(player)\n if player.advantage\n player.win = true\n player.games_won += 1\n won_set(player)\n reset_scores\n elsif player.points > 3 and player.opponent.points < 3\n player.win = true\n player.games_won += 1\n won_set(player)\n reset_scores\n end\n end", "def earn_point(player)\n player ==1 ? @player_2_wins += 1 : @player_1_wins +=1\nend", "def set_winner(team)\n if team.win\n self.status = 'finished'\n self.save\n end\n end", "def increment_win\n self.games_won += 1 \n increment_games_played\n end", "def player_win\n @player.won_bet\n puts \"You have #{@player.chips_remaining} remaining\"\n end", "def add_points(result)\n if result == \"win\"\n @points += 1\n end\n end", "def test_add_points__win\n sports_team = SportsTeam.new(\"AC Milan\",[\"Suso\", \"Zapata\", \"Higuain\"], \"Gattuso\")\n sports_team.play_game(true)\n assert_equal(1, sports_team.points)\n end", "def set_other_games_won()\n @score_count.set_other_games_won()\n end", "def wins_ball(winner)\n if winner == 1\n winning_player = @player1\n else\n winning_player = @player2\n end\n\n winning_player.record_won_ball!\n end", "def mark_winner\n winning_team = teams.reject{|team| team.goals < 10}.sort_by(&:goals).last\n winning_team.is_winner = true unless winning_team.nil?\n self.goals_count = teams.collect(&:goals).inject(&:+)\n\n if rating_pending? && !Game.before(self).with_rating_pending.exists?\n set_ratings\n end\n return true\n end", "def update_winners\n return true if draw?\n winner.wins_count.increment\n Player.rank.incr(winner.id)\n looser.loose_count.increment\n true\n end", "def update_coach_win_loss\n \t#this should make the coach of the winning team hae one more win\n \t#and the coach of the losing team have one more loss\n winning_coach.update_attribute :wins, winning_coach.wins + 1\n losing_coach.update_attribute :losses, losing_coach.losses + 1\n end", "def point_won_by(player)\n case player\n when player1 then active_set.increment(player: 1)\n when player2 then active_set.increment(player: 2)\n end\n end", "def set_won?\n if @games_won == 6 && @opponent.games_won < 5\n @sets_won += 1\n @games_won = 0\n @opponent.games_won = 0\n end\n if @games_won == 7 && @opponent.games_won < 7\n @sets_won += 1\n @games_won = 0\n @opponent.games_won = 0\n end\n end", "def wins_ball(player_num)\n @player1.record_won_ball! if player_num == 1\n @player2.record_won_ball! if player_num == 2\n end", "def test_add_points__win\n team = SportsTeam.new(\"Greens\", [\"Jonny\",\"Sam\",\"Charlie\"], \"Dr Hockey\", 0)\n team.add_points(\"win\")\n assert_equal(1, team.points)\n end", "def win\n @score += 1\n end", "def win\n @score += 1\n end", "def player_won\n\t\tputs \"\\nCongratulations! your have won!\"\n\t\tself.player_record[\"Wins\"] += 1\n\tend", "def winning_move\n simulate_move(@player_num)\n end", "def match_over(winning_side)\n self.update!(status: \"over\")\n \n create_results(winning_side)\n end", "def result_update_to player, dealer_player, odds\r\n if player[:state] == 'won' \r\n amount = (player[:bet].to_f * odds).to_i\r\n player[:total_chips] = player[:total_chips] + amount\r\n\tdealer_player[:total_chips] = dealer_player[:total_chips] - amount\r\n\tplayer[:total_win] = player[:total_win] + 1\r\n\tplayer[:history].push('won')\r\n elsif player[:state] == 'lost'\r\n player[:total_chips] = player[:total_chips] - player[:bet]\r\n\tdealer_player[:total_chips] = dealer_player[:total_chips] + player[:bet]\r\n player[:history].push('lost')\r\n else\r\n player[:history].push('push')\r\n end\r\n player[:total_round] = (player[:state] == 'won' || player[:state] == 'lost')? player[:total_round] + 1 : player[:total_round]\r\n player[:rate] = (player[:total_round] > 0)? player[:total_win].to_f / player[:total_round].to_f : player[:rate]\r\nend", "def points() \n\t\t(self.wins()*3+self.draws()) \n\tend", "def winning_team\n total_points = 0 #initialize points at zero \n \n win_team = '' #set win team to an empty string \n \n game_hash.each do |location, team| #iterating over game hash\n team_points = 0 #initialize team points at zero \n team_name = game_hash[location][:team_name] \n # set team name = to game_hash at the the location at the # :team name \n \n team[:players].each do |player| #iterate over players \n points = player[:points] # set points = player points \n team_points += points #team points is the addition of every single point value from each player\n \n #binding.pry \n end\n \n win_team, total_points = team_name, team_points if team_points > total_points\n \n #binding.pry \n \n end\n \n return win_team\n\nend", "def player_win\n @player_win += 1\n end", "def game_won?\n if @points == 4\n if @opponent.points < 3\n @games_won += 1\n @points = 0\n @opponent.points = 0\n set_won?\n match_won?\n return 'win'\n elsif @opponent.points == 3\n @points -= 1\n @opponent.points -= 1\n return 'advantage'\n elsif @opponent.points == 4\n @points -= 1\n @opponent.points -= 1\n return 'duece'\n end\n end\n end", "def over?\n self.player.points == self.board.total_points\n end", "def winning_team\n if homeTeamPoints.sum > awayTeamPoints.sum\n \"Brooklyn Nets\"\n else\n \"Charlotte Hornets\"\n end\nend", "def set_game_stats(tictactoe)\n set_win_lose_draw(tictactoe,\"win\") if @tictactoe.winner?(p1_moves(tictactoe)) \n set_win_lose_draw(tictactoe,\"lose\") if @tictactoe.winner?(p2_moves(tictactoe)) \n set_win_lose_draw(tictactoe,\"draw\") if @tictactoe.draw?(p1_moves(tictactoe),p2_moves(tictactoe)) \n set_first_to_act(tictactoe) \n tictactoe.save \n end", "def easy_win(player)\n win if player.points == 4 && player.opponent.points < 3\n end", "def give_point\n if@current_player == @player1\n @p1_score += 1\n else\n @p2_score += 1\n end\nend", "def won_point(player_name)\n _player = player(player_name)\n raise StandardError.new(\"No player names #{player_name} is playing in the current game\") if _player.nil?\n _player.add_point\n end", "def adjust_score(team, points)\n team.inject(self) do |s, player|\n s.update_in(:scores, player) {|n| n + points }\n end\n end", "def lose_with_points\n self.is_complete = true\n \"#{name}'s point is smaller than dealer! #{name} lose bet. Lose for #{name}\"\n end", "def display_won_round_message\n puts \"#{current_player.name} earned a point and their score is now #{current_player.score}\".green\n\n end", "def win!(payoff)\n\t\t@balance.balance += Integer((1.0 + payoff)*@bet)\n\t\t@bet = 0\n\tend", "def determining_winner\n if @player_hand_points = 21 && @dealer_hand_points < 21 || 21 > @player_hand_points > @dealer_hand_points || @dealer_hand_points > 21\n @player_win\n elsif @player_hand_points > 21 && @dealer_hand_points > 21 || @player_hand_points = @dealer_hand_points\n @player_tie\n else @dealer_hand_points = 21 && @player_hand_points < 21 || 21 > @dealer_hand_points > @player_hand_points || @player_hand_points > 21\n @player_loss\n end\n end", "def won_bet(winnings)\n @cash += winnings\n end", "def hero_win\n puts \"#{monster.name} defeated! You gain #{monster.experience} experience.\"\n hero.update(experience: hero.experience + monster.experience)\n reward\n end", "def track_p2_wins(winner)\n if winner == 2\n return 1\n else\n return 0\n end\nend", "def won_game?\n @points > @opponent.points + 1 && @points >= 3\n end", "def num_points win_condition\n points = 0\n @game_objects.each do |game|\n points += game.score_osu game_meets_win_cond win_condition, game\n end\n points\n end", "def set_win_lose_draw(tictactoe, result)\n if result == \"win\"\n tictactoe.players[0].win += 1\n tictactoe.players[1].lose += 1\n elsif result == \"lose\"\n tictactoe.players[0].lose += 1\n tictactoe.players[1].win += 1\n else\n tictactoe.players[0].draw += 1\n tictactoe.players[1].draw += 1\n end\n end", "def won_game?\n if @points > @opponent.points + 1 && @points > 3\n @points = 0\n opponent.points = 0\n return true\n end\n end", "def track_p1_wins(winner)\n if winner == 1\n return 1\n else\n return 0\n end\nend", "def won_set(player)\n if player.games_won >= 6 and player.opponent.games_won < 5\n player.sets_won += 1\n @player1.games_won = 0\n @player2.games_won = 0\n won_match(player)\n elsif player.games_won == 7\n player.sets_won += 1\n @player1.games_won = 0\n @player2.games_won = 0\n won_match(player)\n end\n end", "def won?\n #won?: If the player has over 100 points, returns true, otherwise returns false\n if total_score > 100\n return true\n else\n return false\n end\n end", "def won?\n end", "def won?\n end", "def win_round\n interface.win_round\n player.win_round\n croupier.lost_round\n overall_result\n end", "def score\n return 'love' if @points == 0\n return 'fifteen' if @points == 1\n return 'thirty' if @points == 2\n return 'forty' if @points == 3 && @opponent.points != 3\n return 'deuce!' if @points >= 3 && @points == @opponent.points \n return 'advantage' if @points > 3 && @points == @opponent.points + 1\n return 'winner' if @points > 3 && @points == @opponent.points + 2\n\n\n \n\n #gave up on case method. Could not figure out to use case comparisons without getting into \n #logically difficult if/else statements. Much simpler to use returns. \n # case @points \n # when 0 # program errors if return is not on a new line. \n # return 'love'\n\n # when 1 \n # return \"fifteen\"\n\n # when 2 \n # return \"thirty\"\n\n # when 3 \n # if @opponent.points != 3\n # return \"forty\"\n # elsif @opponent.points == 3 \n # return \"deuce!\"\n # end\n\n # #--------- This is where I gave up on the case method ------------#\n # #-------everything above this point (in case method) worked fine -#\n # # when 4 \n # # if @player.points = \n # # return \"advantage\" if @points == @opponent.points + 1\n\n # # when 5 <-- need to figure out how to set a winner. \n # # return @player + (\" is the winner\") if (opponent.points \n\n # else \n # return \"more than 4\" #testing string if when statements somehow failed. \n # end #<--- end of case method\n\n\n ###----------------- this was my first attempt before using cases -------##\n # if @points == 0\n # return 'love'\n\n # elsif @points == 1\n # return 'fifteen'\n\n # elsif @points == 2\n # return 'thirty'\n\n # elsif @points == 3\n # return 'forty'\n # end\n end", "def display_winner(total_points, player_name, wins)\n if total_points[0] > 21\n wins[1] += 1\n msg = \"#{player_name} busted, Dealer wins!!\"\n elsif total_points[1] > 21\n wins[0] += 1\n msg = \"Dealer busted, #{player_name} wins!!\"\n elsif total_points[0] > total_points[1]\n wins[0] += 1\n msg = \"#{player_name} wins, dealer lost!!\"\n elsif total_points[0] < total_points[1]\n wins[1] += 1\n msg = \"Dealer wins, #{player_name} lost!!\" \n else\n msg = \"It's a tie!!\"\n end\n puts msg\n puts\n puts\n puts \"#{player_name} wins: #{wins[0]}\\tDealer wins: #{wins[1]}\"\nend", "def get_score(point_winner,point_loser)\n if point_winner.points < 40\n point_winner.points = point_winner.next_point\n if point_winner.points == 40 && point_loser.points == 40\n point_winner.stage = point_loser.stage = 'Deuce'\n else\n \"#{@player1.points}-#{@player2.points}\"\n end\n else\n stage = get_stage(point_winner,point_loser)\n if stage == 'Game'\n \"Game won by #{point_winner.name}\"\n elsif stage == 'Advantage'\n \"Advantage #{point_winner.name}\"\n else\n \"Deuce\"\n end\n end\n end", "def win\n winning_move(@computer_mark)\n end", "def points(team)\n first = 0\n res = self.result\n\n if res\n if team == 1\n first_team = res[0]\n sec_team = res[1]\n elsif team == 2\n first_team = res[1]\n sec_team = res[0]\n else \n raise \"Invalid Team chosen\"\n end\n\n p first_team <=> sec_team\n # Compare the results\n outcome = first_team <=> sec_team\n\n if outcome > 0\n # Win\n result = 3\n elsif outcome < 0\n # Loss\n result = 0\n else \n # Draw\n result = 1\n end\n else\n result = nil\n end\n\n result\n end", "def won?\n # Fill this in\n end", "def increment_win_score\n PlayerModelContracts.invariant(self)\n @score = @score + 1\n end", "def points\n deal_points = tricks_points @tricks\n\n if not deal_points.inside? bid_said_by_team\n deal_points.add_points_to(bid_said_by_team, MatchPoints::VALAT_BONUS) if valat?\n\n if not @mode.is_a? DoubleMode\n @mode.match_points deal_points\n else\n Points.zeros[bid_said_by_team] = doubling_points deal_points, @mode\n end\n elsif deal_points.inside? bid_said_by_team\n deal_points.add_points_to(opposing_team, MatchPoints::VALAT_BONUS) if valat?\n\n Points.zeros[opposing_team] = doubling_points deal_points, @mode\n elsif deal_points.hanging?\n if not @mode.is_a? DoubleMode\n @mode.match_points deal_points\n else\n doubled_points = doubling_points deal_points, @mode\n\n result = Points.zeros\n result[bid_said_by_team] = doubled_points / 2\n resutl[opposing_team] = doubled_points / 2\n\n result\n end\n end\n end", "def determine_winner game\n winner = game.max_by {|team| team[:score]}\n team_standings = get_team_by_name(winner)\n team_standings[:winnings] += 3\nend", "def scoreboard(round_winner)\n if round_winner != 0\n round_winner == 1 ? round_winner = @player1 : round_winner = @player2 \n puts \"#{round_winner.name} won the round.\"\n round_winner.win\n else puts \"tie\"\n end\n puts \"#{player1.name}: #{player1.score}\", \"#{player2.name}: #{player2.score}\"\n end", "def game_over args, win_or_lose\n # keep track of whether you won or lost\n args.state.game_state = win_or_lose\nend", "def wins_ball(player)\n if player == 1\n @player1.record_won_ball!\n won_game(@player1)\n elsif player == 2\n @player2.record_won_ball!\n won_game(@player2)\n end\n\n reset_statuses\n\n determine_score\n end", "def determineWinner() \n\n end", "def updateGamesLost\n @gamesLost += 1\n end", "def its_a_tie game\n game.each do |team|\n team_standings = get_team_by_name(team)\n team_standings[:winnings] += 1\n end\nend", "def correct_stats\n if self.winner != @existing_winner\n StatService.new(self).update_stats_for_match_with_new_winner\n end\n end", "def check_win\n if @game_board.return_count == 5 and @timer.return_time >= 0\n @win = true\n end\n if @game_board.return_count < 5 and @timer.return_time == 0\n @lose = true\n end\n end" ]
[ "0.73651993", "0.73214626", "0.7277738", "0.7183555", "0.71566975", "0.6975616", "0.6970831", "0.6970334", "0.6961573", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6930382", "0.6808958", "0.68005425", "0.67830366", "0.676962", "0.670932", "0.670932", "0.6600159", "0.6600159", "0.65989494", "0.65808773", "0.6539595", "0.6506051", "0.6483924", "0.6476501", "0.64442307", "0.64378774", "0.64366263", "0.64338624", "0.6433408", "0.6392163", "0.63833755", "0.6360988", "0.63573617", "0.6346681", "0.6343193", "0.63279164", "0.63186353", "0.6316935", "0.6296888", "0.6286966", "0.6244845", "0.6239576", "0.61998284", "0.61998284", "0.61949044", "0.61790365", "0.6119901", "0.61155844", "0.6102729", "0.61025107", "0.609179", "0.6091075", "0.60858667", "0.6085087", "0.6084568", "0.60839546", "0.608233", "0.6080153", "0.6075275", "0.60717237", "0.60595", "0.60333097", "0.6030949", "0.6022943", "0.6018134", "0.6000064", "0.5999214", "0.59989864", "0.5998844", "0.59790784", "0.5971154", "0.59629154", "0.5960377", "0.5950903", "0.5950903", "0.5933111", "0.5930765", "0.5929077", "0.59209913", "0.5916726", "0.5915948", "0.5912857", "0.5909101", "0.5902177", "0.59016055", "0.58959275", "0.58914053", "0.5874104", "0.5869537", "0.585067", "0.5849474", "0.5820768", "0.5813658" ]
0.61420965
53
Refiere a la cantidad maxima de respuestas que se da en alguna respuesta
def max_position @words.first[1].length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximo()\n\t\tmaximo = 0;\n\t\t@hash_no_nulos.each do |key,valor|\n\t\t\tif (valor > maximo)\n\t\t\t\tmaximo = valor\n\t\t\tend\n end\n\t\treturn maximo\n\tend", "def get_max_results\n @max_results\n end", "def doGetMaxCountPerRequest()\n end", "def max\n\t\tm = self.valor[0]\n\t\tfor i in (0...self.valor.size.to_i)\n\t\t\t\tif (self.valor[i]> m)\n\t\t\t\t\tm = self.valor[i]\n\t\t\t\tend\n\t\tend\n\t\treturn m\n\tend", "def jugada_max\r\n movimiento.max_by{|x| x.nivel} #Devuelve el objeto de enumeración que da el valor máximo\r\n end", "def get_max\n @max\n end", "def get_max\n @max ||= calculate_max\n end", "def max_respawns\n @options['max_respawns'] ? @options['max_respawns'].to_i : 5\n end", "def item_max() @item_max end", "def max_pages\n return 1 if (result_attrs.blank? || result_attrs['totalPages'].blank?)\n attrs['totalPages'].to_i.clamp(1,self.hard_request_limit)\n end", "def max\n if valid?\n max_value\n end\n end", "def limit(val)\n @params[:retmax] = val\n self\n end", "def max_failed_count\n MAX_FAILED_COUNT\n end", "def get_max()\n end", "def doGetMaxCountPerRequest()\n return MAX_COUNT_PER_REQUEST\n end", "def test_max_dispersa\n\t\tassert_equal(Fraccion.new(77,12), @h3.max, \"Resultado Incorrecto\" )\n\tend", "def find_max()\r\n self.max\r\n end", "def max; end", "def max; end", "def get_maximum_score()\n max_score = 0\n\n self.scores.each { |score| max_score = max_score + score.question.questionnaire.max_question_score }\n\n max_score\n end", "def max\n end", "def max\n end", "def get_max\n\t\t@max.last\n\tend", "def max\n @max\n end", "def max\n @max\n end", "def nivel_no_final\r\n #collect llama al bloque una vez por cada elemento del mismo y crea un nuevo arreglo que contiene los valores retornados\r\n #nivels = movimiento.collect{ |valor_pos| valor_pos.nivel }\r\n \r\n if jugador_actual == 'O'\r\n movimiento.collect{ |valor_pos| valor_pos.nivel }.min\r\n #nivels.max\r\n else\r\n movimiento.collect{ |valor_pos| valor_pos.nivel }.max\r\n end\r\n end", "def solution2(a)\n\n total_max, current_max = a[0], 0\n\n a.each do |int|\n current_max = [current_max + int, int].max\n total_max = [total_max, current_max].max\n end\n\n return max\n\nend", "def max_items\n main.max_items\n end", "def max\n (count * sides + increment) * multiplier\n end", "def prev_max() self.scheduling.prev_max end", "def solution(a)\n return a.count(a.max)\nend", "def maxvalue\n MAXVALUE\n end", "def max\n maximo = 0.to_f\n for i in 0...matriz.size\n if matriz[i] != nil\n matriz[i].each do |key, value|\n if matriz[i][key].to_f > maximo\n maximo = matriz[i][key].to_f\n end\n end\n end\n end\n maximo\n end", "def max_vendedor\n pv = self.punto_venta\n cantVend = pv.concesionaria.cantVend\n cantvendconc = Vendedor.where(:id => pv.id).count\n\n if (cantVend.to_i <= cantvendconc.to_i + 1 )\n errors.add(:base, \"No puede crear mas Vendedores para este punto de venta, solicite permiso\")\n end\n end", "def max \n @list.reduce(0){ |memo,v| (v>memo ? v : memo) }\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def maximum_limit\n 100\n end", "def largest_value\n values.max\n end", "def max_count\n multiple? ? (@schema['max_count'] || :unlimited) : nil\n end", "def max\n @max ||= begin\n maxes = []\n options[:max].times { |t| maxes << dup_for(max: nil, change: nil, series: nil, extend_cache_life: options[:max] - t, period: period.prev(t + 1)).compute }\n maxes.max\n end if options[:max]\n end", "def max\n maxes = []\n\n maxes << @in.max unless @in.empty?\n maxes << @out.max unless @out.empty?\n\n maxes.max\n end", "def max\n @maxNumber\n end", "def maximum_of_two_players\n # TODO implement\n end", "def max_scores\n next_boards.map(&:max_score)\n end", "def max_candidates\n return @max_candidates\n end", "def max\n max = @valor[0][0]\n i=0\n\tself.fil.times do |i|\n\t j=0\n\t self.col.times do |j|\n\t if (@valor[i][j] > max)\n\t\t max= @valor[i][j]\n\t end\n\t j=j+1\n\t end\n\ti=i+1\n end\n max\n end", "def maximum\n return @maximum\n end", "def reCalculateMax\n # first reset saved maximum number\n @maxNumber = 0;\n # then begin reCalculate process But if stack has numbers\n if @stackList.length > 0\n @stackList.each do |num|\n if @maxNumber < num\n @maxNumber = num\n end\n end\n end\n end", "def eqp_r_max(item)\n end", "def max_hops; end", "def problem_66\n max = [0,0]\n (2..1000).each do |d|\n top,bot = d.sqrt_frac {|t,b| (t*t - d*b*b) == 1}\n next unless top\n max = [max,[top,d]].max\n puts \"#{d} #{top} #{bot}\"\n end\n max[1]\nend", "def max\n data.max\n end", "def max_consumption\n @max_consumption ||= begin\n augment = max_repeats == Float::INFINITY ? 10 : max_repeats\n self.next&.max_consumption.to_i + augment\n end\n end", "def max_value\n max = 0\n\n @matrix.each do |row|\n row_max = row.max\n max = row_max if row_max > max\n end\n\n max\n end", "def find_max_value(array)\nx = 0 \n array.length.times { |index|\n if array[index] > x \n x = array[index]\n end\n }\n x\n end", "def item_max\n @dataConsumable ? @dataConsumable.size : 1\n end", "def test_max_densa\n\t\tassert_equal(8, @h6.max, \"Resultado Incorrecto\" )\n\tend", "def max=(max)\n diff = nil\n @mutex.synchronize {\n if max <= @max\n @max = max\n else\n diff = max - @max\n @max = max\n end\n }\n if diff\n diff.times do\n\tbegin\n\t t = @queue_wait.shift\n\t t.run if t\n\trescue ThreadError\n\t retry\n\tend\n end\n end\n max\n end", "def max=(max)\n diff = nil\n @mutex.synchronize {\n if max <= @max\n @max = max\n else\n diff = max - @max\n @max = max\n end\n }\n if diff\n diff.times do\n\tbegin\n\t t = @queue_wait.shift\n\t t.run if t\n\trescue ThreadError\n\t retry\n\tend\n end\n end\n max\n end", "def maximo\r\n\t\t\r\n\t\tmax = 0\r\n\t\t\r\n\t\ti = 0\r\n\t\t\r\n\t\twhile i < @numElementos\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif(@eleM[i] > max)\r\n\t\t\t\t\r\n\t\t\t\tmax = @eleM[i]\r\n\t\t\t\t\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\ti += 1\r\n\t\tend\r\n\t\t\r\n\t\t#puts \"maximo: #{max}\"\r\n\t\t\r\n\t\treturn max\r\n\t\t\r\n\tend", "def get_max(passed_values=nil)\n passed_values && passed_values.count > 0 ? passed_values.max : values.max\n end", "def retries\n [@times_visited - 1, 0].max\n end", "def item_max\n @item_max\n end", "def get_max_interactions\n return @snps.length-1\n end", "def max\n @max ||= define_min_and_max && @max\n end", "def max_score\n @max_score ||= raw_response['response']['maxScore'].to_f\n end", "def get_max_over(stat)\n max = 0\n $data_enemies.each { |enemy|\n next if enemy.nil?\n next if enemy.hidden_best\n next unless $game_party.known_enemy?(enemy.id)\n value = enemy.get_stat(stat)\n max = value if value > max\n }\n max\n end", "def max_wait_time\n @data[\"max_wait_time\"]\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def check_maximum_in_contest\n if self.contest.blank?\n if ContestAttachment.where(contest_attachment_group_id: self.contest_attachment_group_id).count >= MAXIMUM_IN_CONTEST\n errors.add(:maximum, I18n.t('contest_attachment.create.error.maximum_reached', maximum: MAXIMUM_IN_CONTEST))\n end\n else\n if self.contest.attachments.count >= MAXIMUM_IN_CONTEST\n errors.add(:maximum, I18n.t('contest_attachment.create.error.maximum_reached', maximum: MAXIMUM_IN_CONTEST))\n end\n end\n end", "def max\n\t\t\t@count*@sides\n\t\tend", "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 max(types)\n max = 0\n types.each{ |t| v = [lmt(t), @tbu.all_action_lmt].max; max = v if v > max }\n max\n end", "def solution(n, a)\n counter = [0] * n\n counter_max, max = 0, 0\n\n a.each do |c|\n i = c-1\n\n if c == n + 1\n counter_max = max\n else\n # should ensure start number after max_counter applied\n counter[i] = counter_max if counter[i] < counter_max\n counter[i] += 1\n\n max = [max, counter[i]].max\n end\n end\n\n # should ensure start number after max_counter applied\n counter.map { |c| [c, counter_max].max }\nend", "def newSolve(total)\n\tmaxNumberUp = Math.log2(total).floor\n\n\tif numberOfOnes(total+1)==1\n\t\tmaxNumberUp+=1\n\tend\n\n\tmaxUp = 2**maxNumberUp\n\n\n\tmaximo = maxNumberUp + numberOfOnes(total-(maxUp-1))\n\treturn maximo\nend", "def max_solo\n @max_solo ||= pairs.inject(0) do |max, (pairee, pairs)|\n [pairs.inject(0) do |max, (pairer, count)|\n [pairee == pairer ? count : 0, max].max\n end, max].max\n end\n end" ]
[ "0.6505084", "0.63971597", "0.63698184", "0.6203888", "0.6185229", "0.61765563", "0.61747503", "0.61329865", "0.611008", "0.6109654", "0.60976315", "0.60970557", "0.609487", "0.6080438", "0.60525876", "0.6027249", "0.6015063", "0.60144085", "0.60144085", "0.59947824", "0.5986772", "0.5986772", "0.5959196", "0.5949677", "0.5949677", "0.5926902", "0.59158605", "0.5902656", "0.5899625", "0.5894826", "0.5893367", "0.5892742", "0.5885745", "0.5880864", "0.58497864", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.58433825", "0.5841609", "0.58374894", "0.58347225", "0.58220834", "0.5818009", "0.5817644", "0.5795177", "0.57864255", "0.57748824", "0.576387", "0.57592374", "0.5758601", "0.57538885", "0.5749163", "0.573877", "0.57354397", "0.5732652", "0.5726777", "0.5726638", "0.5725144", "0.5723483", "0.57210857", "0.57210857", "0.57194686", "0.57185274", "0.57152855", "0.57145333", "0.57023406", "0.569439", "0.56886137", "0.56848985", "0.5684896", "0.5683753", "0.5683753", "0.5683753", "0.5683753", "0.5683753", "0.5683753", "0.5683753", "0.5683753", "0.56806356", "0.56765693", "0.5674841", "0.56745064", "0.5668565", "0.5662731", "0.5656464" ]
0.0
-1
POST /comments POST /comments.json
def create @comment = @match.comments.create(body: comment_params[:body], user_id: current_user.id) contact = Contact.new subject = I18n.t(:subject, scope: 'custom.controller.comment', nom: "#{current_user.nom} #{current_user.prenom}") contact.build(current_user, subject, @comment) @match.users.each do |u| UserMailer.notify_match_comment(contact, @match, u).deliver if u.id != current_user.id end redirect_to match_path(@match), notice: I18n.t(:added, scope: 'custom.controller.comment') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @comment = @post.comments.new(comment_params)\n if @comment.save\n render json: @comment, status: :created\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n\n end", "def comment options={}\n client.post(\"/#{id}/comments\", options)\n end", "def create\n post = Post.find(params[:post_id])\n @comment = post.comments.new(comment_params)\n if @comment.save\n render json: {\n data: @comment\n }\n else\n render json: {\n errors: @comment.errors\n }\n end\n end", "def create\n puts params.to_json\n @post = Post.find(params[:comment][:post_id])\n @comment = @post.comments.build(comment_params)\n if @comment.save\n redirect_to root_path\n end\n end", "def create\n comment = Comment.new(comment_params)\n\n post = Post.find(params[:comment][:post_id])\n post.data[\"comments\"] = post.data[\"comments\"] + 1\n\n if comment.save && post.save\n render json: {\n status: \"success\",\n data: {\n comment: comment.as_json(include: {\n user: {\n only: [:id, :name, :avatar]\n }\n }),\n comments: post.data[\"comments\"]\n }\n }, status: :ok\n else\n render json: comment.errors, status: 404\n end\n end", "def create\n @comment = Comment.new(params[:comment])\n @comment.save\n respond_with(@post, @comment)\n end", "def create\n json_create_and_sanitize(comment_params, Comment)\n end", "def create\n comment = Comment.new(create_params)\n comment.post = @post\n if comment.save\n render json: comment, status: 200\n else\n render json: comment.errors, status: 403\n end\n\n end", "def create\n # get the post\n @post = Post.find_by_id(params[:post_id])\n if @post.nil?\n return render json: { error: \"Post not found\" }, status: :not_found\n end\n # create post to comment\n @comment = @post.comments.create(body: params[:body])\n # associate comment before save(comment cannot be saved without user_id)\n @comment.user = @current_user\n # save comment\n if @comment.save\n render json: @comment, status: :ok\n else\n render json: { errors: { status: \"400\",\n title: \"Bad request\",\n details: @comment.errors\n }\n }, status: :bad_request\n end\n end", "def create\n @new_comment = post.comments.new(comment_params)\n @new_comment.user = current_user\n\n respond_to do |format|\n if @new_comment.save\n format.html { redirect_to post, notice: I18n.t('controllers.comments.created') }\n format.json { render :show, status: :created, location: post }\n else\n format.html { redirect_to post, alert: I18n.t('controllers.comments.error') }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new({user_id: params[:user_id], announcement_id: params[:announcement_id], description: params[:description]})\n @comment.save\n render json:@comment\n end", "def create\n @comment = @noticia.comments.create(comment_params)\n\n if @comment.save\n render json: @comment, status: :created\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end", "def create\n #if @user && @user.posts.include(@post)\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.json { render :show, status: :created, location: @comment }\n else\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = current_user.comments.new(comment_params)\n @comment.user_id = current_user.id\n if @comment.save\n render json: @comment\n else\n render :json => @comment.errors\n end\n end", "def create\n comment = @project.comments.build(comment_params)\n\n if comment.save\n render json: comment \n else\n render json: { message: 'Error: Failed to add comment.'}\n end\n end", "def create\n @comment = @user.comments.build(@json['comment'])\n update_values :@comment, @json['comment']\n end", "def create\n @post = Post.where(id: params[:post_id]).first\n @comment = @post.comments.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @post, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def comments\n render json: @post.comments\n end", "def create\n @blogpost = Blogpost.find(params[:blogpost_id])\n\n @comment = @blogpost.comments.create(comment_params)\n render json: @comment\n end", "def create\n @comment = Comment.new(comment_params)\n respond_to do |format|\n if @comment.save\n format.json {\n render json: {status:0, msg:\"success\"} \n }\n else\n \tformat.json { \n render json: {status:-1, msg:\"failed\"} \n }\n end\n end\n end", "def create\n @radio = Radio.find(params[:radio_id])\n comment = @radio.comments.create({:body => params[:comment], :user_id => current_user.id});\n respond_to do |format|\n format.json { render :json => to_commentDTO(comment), :status => :ok }\n end\n end", "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to comments_url, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n session = UserSession.find_by_authentication_token(params[:authentication_token])\n user = session.user\n \n respond_to do |format|\n if user\n @comment = Comment.new(:user_id => user.id, :recipe_id => params[:recipe_id], :text => params[:text])\n \n if @comment.save\n recipe = Recipe.find_by_id([params[:recipe_id]])\n\n @comments = recipe.fetch_comments\n format.json { render :json => { :comments => @comments, :message => \"success\"} }\n else\n format.json { render :status => 500, :json => { :message => \"There was an error uploading your comment.\" }}\n end\n else\n format.json { render :json => { :message => \"Invalid authentication token\"}} \n end\n end\n end", "def create\n @comment = Comment.new(post_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to root_path, notice: 'Post was successfully created.' }\n format.json { render root_path, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @post = Post.find(params[:post_id])\n @comment = @post.comments.build(params[:comment])\n respond_to do |format|\n if @comment.save\n format.json { render :json => @comment }\n else\n format.json { render :json => @comment.errors, :status => :unprocessable_entity}\n end\n end\n #respond_with(@post,@post.comments.create(params[:comment]))\n end", "def comments\n client.get(\"/#{id}/comments\")\n end", "def create\n \tnew_comment = params.require(:comment).permit(:body)\n \tpost = Post.find(params[:post_id])\n \tcomment = post.comments.create(new_comment)\n\n \tredirect_to post_comment_path(post, comment)\n end", "def create\n @comment = @secret.comments.build(comment_params)\n @comment.user_id = current_user.id.to_s\n if @comment.save\n comment = CommentModel.new(@comment, current_user)\n render json: comment\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end", "def create\n @comment = Comment.new(comment_params)\n @comment.user_id = @current_user.json_hash[:id]\n @comment.dinner_id = params[:id]\n if @comment.valid?\n @comment.save\n render json: @comment.comment_info\n else\n puts @comment.errors.messages.inspect\n render status: :bad_request, json: {\n errors: @comment.errors.messages\n }\n end\n end", "def create\n @comment = Comment.new(comment_params)\n @comment.user = current_user\n if @comment.save\n render json: @comment\n # redirect_to recipe_path(@comment.recipe.id, @comment)\n else\n render \"recipes/show\"\n end\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.create(content: params[:content])\n current_user.comments << @comment\n current_user.save\n\n idea = Idea.find(params[:ideaId])\n idea.comments << @comment\n idea.comments.order(\"created_at DESC\")\n idea.save\n respond_to do |format|\n format.json {render json: @comment}\n end\n end", "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to admin_comments_url, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = current_user.comments.build(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to \"/posts/#{@comment.post_id}\" }\n format.json { render :show, status: :created, location: @comment }\n else\n errors = @comment.errors.full_messages.join('! ')\n format.html { redirect_to \"/posts/#{@comment.post_id}\", alert: \"Comment was failly created!\\n#{errors}!\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n\n\n end", "def create\n @comment = @parent.comments.new(params[:comment])\n @comment.user_id = session[:user_id]\n\n respond_to do |format|\n if @comment.save\n @comment.update_post\n format.html { redirect_to post_path(@comment.post), notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n post_comment(@comment)\n format.html { redirect_to @comment.article, notice: 'Comment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @comment }\n else\n format.html { render action: 'new' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new(\n name: params[:name],\n content: params[:content],\n post: Post.find(params[:post_id])\n )\n # @comment = Comment.new(comment_params)\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment.post, notice: \"comment was created.\" }\n else\n puts @comment.errors\n format.html { redirect_to post_path(params[:post_id]) }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@comment = Comment.new(comment_params)\n @comment = @blog.comments.new(comment_params)\n \n if @comment.save\n render json: @comment, status: :created\n else\n render json: {\n error: @comment.errors.full_messages\n }, status: :unprocessable_entity\n end\n end", "def create\n @comment = @post.comments.build(comment_params)\n @comment.user_id = current_user.id\n @comment.post_id = @post.id\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @post, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_comments\n end", "def create_comments\n end", "def create_comments\n end", "def create\n @comment = Comment.new(comment_params)\n @post = Post.find(@comment.post_id)\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @post, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new\n @comment.content = params[:content]\n @comment.post_id = params[:post_id]\n @comment.user_id = current_user.id\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to root_path, notice: \"Comment was successfully created.\" }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { redirect_to root_path, notice: \"Por favor añada contenido a su comentario.\" }\n end\n end\n end", "def create\n comment = Comment.new(params[:comment])\n @entry.comments << comment if comment.valid?\n respond_with(comment, location: redirect_to_index)\n end", "def create\n\n \t\t\t@comment = Comment.new comment_params\n\n @comment.user_id = current_user.id\n\n \t\t\tif @comment.save\n\n \t\t\t\trender json: @comment,status: :created\n\n \t\t\telse\n\n \t\t\t\trender json: {error: true,errors: @comment.errors},status: :unprocessable_entity\n\n \t\t\tend\n\n \t\tend", "def show\n @new_comment = Comment.build_from(@post, \"\")\n\n render json: @post, status: 200\n\n\n end", "def create\n if params.present?\n Comment.create(name: params[:author], description: params[:text], rating: params[:rating])\n end\n render json: {success: \"Sucessfully Commented\"}\n end", "def create_comment\n unless user_signed_in?\n render status: 403, json: { message: 'Please sign in to add a comment.' }\n end\n\n comment_params = params.permit(:content, :id)\n new_comment = Comment.create!(\n content: comment_params.require(:content),\n post_id: comment_params.require(:id),\n user_id: current_user.id\n )\n render status: :created, json: new_comment\n end", "def create\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment.generic_item, :notice => t('notice.successfully_created') }\n format.json { render :json => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\r\n\t\t#create new comment\r\n\t\t@comment = Comment.new(comment_params)\r\n\t\tif @comment.save\r\n\t\t\t#if save success send js handles the rest\r\n\t\t\t@post = @comment.post\r\n\t\t\trespond_to :js\r\n\t\telse\r\n\t\t\t# if fails alert user\r\n\t\t\tflash[:alert] = \"Something went wrong\"\r\n\t\tend\r\n\tend", "def create\n @comment = Comment.new(params[:comment])\n @posts = Post.find_all_by_id(@comment.post_id)\n @comment.user_id = session[:user_logged_in]\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @posts, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = Comment.new(params[:comment]) #has a hash called comment, passes initial values\n\n respond_to do |format|\n if @comment.save # Goes in here and saves it to the DB\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n :authenticate_user!\n @comment = Comment.create!(comment_params)\n respond_with @comment\n end", "def create\n @comment = current_user.comments.build(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment = @repository.comments.new(params.require(:comment).permit(:body))\n @comment.author = current_user\n authorize @comment\n\n if @comment.save\n respond_with(@comment)\n else\n respond_with @comment.errors, status: :unprocessable_entity\n end\n end", "def create\n @comment = @idea.comments.build(comment_params)\n @comment.user = current_user\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @idea, notice: 'Your comment has been recorded' }\n format.json { render action: 'show', status: :created, comment: @comment }\n else\n format.html { render action: 'new' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def comment_params\n if request.format.json?\n return params.permit(:post_id, :body)\n end\n params.require(:comment).permit(:user_id, :post_id, :body)\n end", "def create_comment(comment)\n post_params = {\n :body => comment.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n\n response = Logan::Client.post \"/projects/#{@project_id}/todos/#{@id}/comments.json\", post_params\n Logan::Comment.new response\n end", "def create\n @post = Post.find(params[:post_id])\n @comment = @post.comments.create(params[:comment])\n @comment.researcher = logged_in_researcher\n\n if @comment.save\n respond_to do |format|\n format.html { redirect_to post_path(@post), :notice => \"Comment was successfully added.\" }\n format.xml { render :xml => @comment, :status => :created, :location => @comment}\n format.json { render :json=> @comment, :status => :created, :location => @comment}\n end\n else\n respond_to do |format|\n format.html { redirect_to post_path(@post), :alert => \"Failed to add comment: #{@comment.errors.full_messages.join(', ')}\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n format.json { render :json=> @comment.errors, :status => :unprocessable_entity }\n end \n end\n end", "def create\n @comment = @question.comments.create(comment_params)\n redirect_to question_path(@question)\n end", "def post_comment(comment, poi=\"4f4f4c27d4374e800100001d\")\n uri = URI.parse(\"http://mashweb.fokus.fraunhofer.de:3008/api/comment\")\n response = Net::HTTP.post_form(uri, {\n :title => 'Autocomment',\n :body => comment\n })\n end", "def create\n @comment = Comment.new(params[:comment])\n\t\t@comment.user_id = session[:userid]\n @comment.save\n\t\trespond_with @comment, :location => @comment.post\n end", "def create\n @comment = @issue.comments.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @issue_path, notice: 'Comment is succesfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@comment = Comment.new()\n\t\t@comment.comment = params[:comment] \n\t\t@comment.user = current_user\n\t\t@comment.save\n\t\t\n\t\t@resource_comment = ResourceComment.new()\n\t\t@resource_comment.resource_path = params[:path]\n\t\t@resource_comment.comment_id = @comment.id\n\t\t@resource_comment.save\n\t\tif(@resource_comment)\n\t\t\trespond_with(@comment)\n\t\telse\n\t\t\trender json: {error: \"something went wrong while creating resource comment\"}\n\t\tend\n end", "def create\n comment = Comment.new(params[:comment])\n @articles_comments_service.create_comment(comment)\n end", "def create\n @user = User.find(params[:user_id])\n @comment = @user.comments.build(params[:comment])\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to user_path(@user.id), notice: 'Your comment has been submitted' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @comment_node = CommentNode.new(params[:comment_node])\n\n respond_to do |format|\n if @comment_node.save\n format.html { redirect_to @comment_node, :notice => 'Comment node was successfully created.' }\n format.json { render :json => @comment_node, :status => :created, :location => @comment_node }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @comment_node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @comment = current_user.comments.new(comment_params)\n @comment.post_id = params['post_id']\n # @comment.parent_id = params[:parent_id]\n\n respond_to do |format|\n if @comment.save\n flash[:notice] = t('comment.create_success_mesg')\n @post = Post.find(params['post_id'])\n @all_comments = @post.comments.paginate(page: params[:page])\n format.html\n format.json { render :show, status: :created, location: @comment }\n format.js\n else\n flash[:notice] = t('comment.create_unsuccessful_msg')\n format.html\n format.json {\n render json: @comment.errors, status: :unprocessable_entity\n }\n format.js \n end\n end\n end", "def create\n @post = Post.find(params[:post_id])\n @comment = @post.comments.create(comment_params)\n redirect_to post_path(@post)\n end", "def post_comment(request)\n data, _status_code, _headers = post_comment_with_http_info(request)\n request_token if _status_code == 401\n data\n end", "def comment #create comment\n comment = Comment.new\n if comment.create_comment(params[:body], params[:video_id])#calling create_comment method of Comment model\n respond_with do |format|\n format.json {render :json => {:success => true, :message => \"comment successfully posted\"}}\n end\n else\n respond_with do |format|\n format.json {render :json => {:success => false}}\n end\n end\n end", "def index\n post = Post.find(params[:post_id])\n comments = post.comments.order(updated_at: :desc)\n @comment = Comment.new\n\n @comments = comments.map do |comment|\n {\n content: comment.content,\n created_at: comment.created_at.strftime('%Y-%m-%d %H:%M:%S')\n }\n end\n\n render json: {\n data: {\n comments: @comments,\n new_comment: @comment,\n }\n }\n end", "def new_comment(name, discussion_id)\n response = self.class.post(\n @@base_uri + @@comments_uri,\n body: {\"comment\":{\"body\":name,\"discussion_id\":discussion_id,\"document_ids\":[]}}.to_json,\n headers: @headers\n )\n return response\n end", "def create\n @comment = Comment.new :body => params[:comment][:body],\n :issue => false\n @comment.polycomment_type = params[:polycomment_type]\n @comment.polycomment_id = params[:polycomment_id]\n @comment.user_id = current_user.id \n if @comment.save\n #flash[:notice] = 'Your comment was posted!'\n redirect_to :back\n else\n flash[:alert] = 'Something went wrong, try reposting your comment.'\n end\n end", "def create\n @post = Post.find(params[:post_id])\n @comment = @post.comments.create!(comment_params)\n\n redirect_to post_path(@post)\n end", "def create\n @comment = Comment.new(comment_params)\n @comment.save\n end", "def create\n @comment = @post.comments.build(params[:comment])\n \n respond_to do |format|\n if @comment.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(posts_url) }\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n user = User.find_by({token: env['HTTP_TOKEN']})\n comment = user.comments.find(params[:id])\n comment.update(comment_params)\n render json: comment\n end", "def comments\n @article = Article.find(params[:id])\n @comments = @article.comments\n\n respond_to do |format|\n format.html \n format.json { render json: @comments, status: :ok }\n end\n end", "def add\n @comment = Comment.new(params[:comment])\n\n respond_to do |format|\n if @comment.save\n # format.html { redirect_to comments_url, notice: 'Comment was successfully created.' }\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task_comment = Task::Comment.new(task_comment_params)\n\n respond_to do |format|\n if @task_comment.save\n format.html { redirect_to @task_comment, notice: \"Comment was successfully created.\" }\n format.json { render :show, status: :created, location: @task_comment }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @task_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @post = Post.find(params[:post_id])\n @comment = @post.comments.new(comment_params)\n @comment.user_id = current_user.id\n @comment.save\n\n respond_to do |format|\n format.js\n end\n end", "def create\n @comment = Comment.new(comment_params)\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to @comment.article, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @comment }\n else\n format.html { render :new }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @article.comments << Comment.new(comment_params)\n\n respond_to do |format|\n if @article.save\n format.html { redirect_to article_show_path(@article), notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @article }\n else\n format.html { render :new }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def comment_creation_params\n params.require(:comment).permit(:cardset_id, :card_id, :user_id, :user_name, :posttime, :body, :status)\n end", "def create\n \t# collects nested attributes, for post & comment, from params\n new_post = params.require(:post).permit(:body, :link, comments_attributes: [:body])\n\n \tpost = Post.create(new_post)\n \tredirect_to post_path(post.id)\n end", "def create\n @commentable = find_commentable\n @comment = @commentable.comments.build(params[:comment]) do |comment|\n comment.access = current_access\n end\n if @comment.save\n flash.now[:notice] = t('comment.added')\n Rails.logger.info @comment.inspect\n @counter = @commentable.comments.count\n respond_with @comment\n else\n Rails.logger.info @comment.errors.messages\n flash.now[:error] = t('comment.added.error')\n end\n end", "def new\n @comment = @commentable.comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "def create_comment\n @user = User.find(params[:user_id])\n @message = Message.find(params[:message_id])\n @comment = @message.comments.create(params.permit(:content))\n @comment.user = @user\n @comment.user_name = @user.id\n @comment.user_avatar = @user.id\n\n if @comment.save\n response = { \"code\" => 1, \"msg\" => \"Comment Created Successfully\" }\n else\n response = { \"code\" => 0, \"msg\" => \"Comment Can't be created\" }\n end\n\n render json: response\n end", "def create \n @comment = @post.comments.new(params[:comment])\n @comment.user_id = current_user.id\n respond_to do |format|\n if @comment.save\n format.js { \n flash[:notice] = 'Comment was successfully created.' \n }\n else\n format.js { \n flash[:error] = @comment.errors.full_messages.join('<br/>')\n }\n end\n end\n @comments = @post.comments.created_at_order\n end", "def add_new_comment\n\t# Get the object that you want to comment\n\tcommentable = Post.find(params[:id])\n\n\t# Create a comment with the user submitted content\n\tcomment = Comment.new(comment_params)\n\t# Add the comment\n\tcommentable.comments << comment\n\t@comments = commentable.comments\n respond_to do |format|\n\t format.html { redirect_to root_path }\n\t format.js\n\tend\n end", "def create\n @post = Post.find params[:id]\n @comment = @post.comments.create comment_params\n @comment.user_id = current_user.id\n\n if @comment.save\n redirect_to \"/post/\" + params[:id]\n else\n flash[:danger] = \"No success\"\n redirect_to \"/\"\n end\n end", "def create\n @comment = @parent.comments.build(comment_params_with_user)\n authorize @comment\n\n if @comment.save\n CommentCreatedMailJob.perform_later(@comment)\n render json: @comment, serializer: CommentSerializer, status: :created\n else\n render_error :unprocessable_entity, @comment.errors\n end\n end", "def comment_params\n params.require(:comment).permit(:body, :request_id)\n end", "def create\n @comment = @secret.comments.build(comment_params)\n @comment.user_id = @user.id\n respond_to do |format|\n if @comment.save\n format.html { redirect_to [@user, @secret], notice: 'Secret was successfully created.' }\n format.json { render action: 'show', status: :created, location: @comment }\n else\n format.html { render action: 'new' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @submission = Submission.find(params[:submission_id])\n @scomment = @submission.comments.build(comment_params)\n if @scomment.save\n render json: @scomment.as_json(except: [:updated_at]), status: :created\n else\n render json: @scomment.errors, status: :unprocessable_entity\n end\n #@comment.user = current_user\n\n #respond_to do |format|\n # if comment_params[:title].present? && comment_params[:body].present?\n # if @comment.save\n # format.html { redirect_to @submission, notice: 'Comment was successfully created.' }\n # #format.json { render :show, status: :created, location: @comment }\n # else\n # format.html { render :new }\n # #format.json { render json: @comment.errors, status: :unprocessable_entity }\n # end\n # else\n # format.html { redirect_to @submission, notice: 'Debe llenar los campos.' }\n # end\n #end\n end" ]
[ "0.75120175", "0.74212646", "0.7374645", "0.72364116", "0.7205224", "0.7086658", "0.7069151", "0.70549524", "0.7049054", "0.6989455", "0.69825", "0.69657713", "0.69578165", "0.6910411", "0.6909373", "0.68731725", "0.6871654", "0.6822542", "0.6810818", "0.6787486", "0.6785412", "0.6761798", "0.67223775", "0.6717274", "0.6712879", "0.6703357", "0.66780496", "0.66693354", "0.6666063", "0.66510963", "0.6646797", "0.66438144", "0.66438144", "0.66438144", "0.66438144", "0.6618947", "0.66069686", "0.6589945", "0.6582926", "0.6580036", "0.6575621", "0.65625244", "0.6551164", "0.65488863", "0.65488863", "0.65488863", "0.65371865", "0.6536091", "0.6533879", "0.6513311", "0.64948153", "0.64924634", "0.6489975", "0.64784837", "0.6471345", "0.64571255", "0.64314175", "0.6424426", "0.641567", "0.6397403", "0.63957936", "0.63860476", "0.63849616", "0.6383141", "0.63804007", "0.6373539", "0.63700426", "0.6368417", "0.6364637", "0.6360786", "0.6327905", "0.63212544", "0.6320553", "0.6298183", "0.629413", "0.629149", "0.62839085", "0.6282247", "0.6277586", "0.6272559", "0.62677294", "0.62629545", "0.6259366", "0.62515587", "0.6248281", "0.6246175", "0.6245974", "0.62448645", "0.6240034", "0.62330633", "0.6232268", "0.62317383", "0.6227576", "0.62232935", "0.62225336", "0.62210953", "0.62100106", "0.62075067", "0.62066275", "0.61986846", "0.61980444" ]
0.0
-1
DELETE /comments/1 DELETE /comments/1.json
def destroy @comment = @match.comments.find(params[:id]) @comment.destroy respond_to do |format| format.html { redirect_to match_url(@match) } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n\n @comment.destroy\n render json: @comment, status: :ok\n\n end", "def destroy\n @comment1 = Comment1.find(params[:id])\n @comment1.destroy\n\n respond_to do |format|\n format.html { redirect_to comment1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = @commentable.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n render json:@comment\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n \n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok } \n end\n end", "def destroy\n @comment.destroy\n head :no_content\n end", "def destroy\n @comment.destroy\n head :no_content\n end", "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def delete_comments\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :ok }\n end\n end", "def destroy\n @comment.destroy!\n head :no_content\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:comment_id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def delete_comment(id)\n record \"/msg/delete_comment/#{id}\"\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to project_sprint_user_story_comments_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to post_path(@comment.post) }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to post_url(@comment.post_id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment1.destroy\n respond_to do |format|\n format.html { redirect_to comment1s_url, notice: 'Comment1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n if @comment.nil?\n render json: {error: \"Not found\"}, status: :not_found\n else\n @comment.destroy\n render json: @comment, status: :ok\n\n end\n end", "def destroy\n comment = Comment.find(params[:id])\n if current_user.id == comment.user_id\n post = comment.post\n post.data['comments'] = post.data['comments'] - 1\n if comment.destroy && post.save\n render json: {status: \"success\", data: {id: Integer(params[:id]), comments: post.data['comments']}}, status: :ok\n else\n render json: {status: \"failure\", data: nil}, status: 404\n end\n\n else\n render json: {status: \"failure\", data: nil}, status: 404\n end\n end", "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, :notice => t('successfully_deleted')}\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Comentario eliminado.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n comment = Comment.find(params[:id])\n if comment.destroy\n render json: {destroyed: true}\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { head :ok }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.destroy(params[:id])\n end", "def destroy\n @comment = Comment.destroy(params[:id])\n end", "def destroy\n if @commentable.comments.find(params[:id]).destroy\n render json: { success: true }\n end\n end", "def destroy\n @dish_comment = @dish.dish_comments.find(params[:id])\n @dish_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to dish_comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n respond_with(@post, @comment)\n end", "def destroy\n puts \"Inside destroy. Comment id is \"+params[:id].to_s\n #puts \"Post id is \"+params[:postid].to_s\n @comment = Comment.find(params[:id])\n @comment.destroy\n @posts = Post.find_by_id(params[:postid])\n\n respond_to do |format|\n format.html { redirect_to @posts }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(post_url(@post), :notice => \"Comment was removed\") }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to user_secret_comments_path(@user, @secret) }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to comments_path }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @visit_comment.destroy\n respond_to do |format|\n format.html { redirect_to visit_comments_url, notice: 'Comentario eliminado con exito' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to post_comments_url, notice: \"Comment was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n\n if @comment.destroy\n\n render json: {comment: {id: params[:id].to_i}},status: :ok\n\n else\n\n render json: {error: true,errors: @comment.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n\t\trespond_with @comment, :location => @comment.post\n end", "def destroy\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to_commentable(@comment, false) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to \"index\", notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Usunięto komentarz.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = @repository.comments.find(params[:id])\n authorize @comment\n @comment.destroy\n respond_with @comment\n end", "def destroy\n @story_comment = StoryComment.find(params[:id])\n @story_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to story_comments_url }\n format.json { head :ok }\n end\n end", "def destroy\n redirect_to \"/home/index\"\n #@comment = Comment.find(params[:id])\n #respond_to do |format|\n #format.html { redirect_to comments_url }\n #format.json { head :ok }\n #end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(comment_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n unless @comment.present?\n @comment.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to admin_comments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end", "def destroy\n @comments = Comment.where(question_id: @question.id)\n @comments.each do |comment|\n comment.destroy\n end\n @question.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_comments_url) }\n format.xml { head :ok }\n end\n end", "def delete_comment1\n params[:comment].each { |key, value|\n comment=Comment.find(key)\n if !comment.nil?\n k comment.destroy\n end\n }\n redirect_to requirements_path\n end", "def destroy\n @comment14.destroy\n respond_to do |format|\n format.html { redirect_to comment14s_url, notice: 'Comment14 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_with(@comment, location: redirect_to_index)\n end", "def destroy\n @comment = Comment.find(params[:id])\n\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to post_path(@comment.post), notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = @posting.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n #@comment.create_activity :destroy, owner: current_user\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { redirect }\n format.xml { head :ok }\n end\n end", "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n format.html { render :nothing => true }\n format.json { head :no_content }\n end\n end", "def destroy\n\t@post = Post.find(@comment.post_id)\n\n @comment.destroy\n\t@post.update_attribute(:nComments, @post.comments.count)\n respond_to do |format|\n format.html { redirect_to @comment.post, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to comments_url, notice: 'Comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.7561756", "0.7436636", "0.7375283", "0.73687786", "0.7360027", "0.73558295", "0.7295163", "0.7295163", "0.7278833", "0.7270536", "0.72607595", "0.72607595", "0.72607595", "0.725645", "0.725645", "0.725645", "0.7242338", "0.7241291", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7240714", "0.7233493", "0.7189116", "0.7184393", "0.7149215", "0.7146339", "0.71346664", "0.71196324", "0.7110075", "0.7108538", "0.70974284", "0.7084668", "0.7065193", "0.7062434", "0.7058358", "0.7056378", "0.7056378", "0.70466316", "0.7044768", "0.70217174", "0.6996942", "0.6996775", "0.69962305", "0.69947916", "0.6988219", "0.6987842", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69865996", "0.69827807", "0.6978351", "0.6970395", "0.6968509", "0.69639987", "0.695786", "0.69568026", "0.695013", "0.6944266", "0.69428647", "0.693822", "0.6934505", "0.6934421", "0.6932941", "0.6932892", "0.69284457", "0.69270843", "0.6926034", "0.691286", "0.69074553", "0.6903928", "0.68968624", "0.6896789", "0.68826365", "0.6881912", "0.68780994", "0.68778354", "0.68778354", "0.68778354", "0.68778354" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_match @match = Match.find(params[:match_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 comment_params params.require(:comment).permit(:body) 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
Body should not be blank
def blank? redirect_to matche_url(@match), alert: I18n.t(:alert, scope: 'custom.controller.comment.blank') if comment_params[:body].blank? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def body?\n !body.empty?\n end", "def blank_body?\n Sanitize.clean(self.body).gsub(/[ | ]/, '').blank? \n end", "def body?\n\t\t\t\t\t@body and !@body.empty?\n\t\t\t\tend", "def set_body\n self.body = \"\" unless body\n body\n end", "def set_body\n self.body = \"\" unless body\n body\n end", "def set_body\n self.body = \"\" unless self.body\n end", "def body\n ''\n end", "def has_body?\n @body\n end", "def body\n nil\n end", "def validate_body\n if @body && /\\b(?:html|xml)\\b/ =~ @type\n @body.scrub!\n end\n end", "def body\n \"\"\n end", "def body\n \"\"\n end", "def body_hash_required?\n false\n end", "def body\n return \"\"\n end", "def body\n read_attribute(:body) || ''\n end", "def empty?\n body.nil? || ( body.respond_to?(:size) && body.size == 0 )\n end", "def body_allowed?\n @status.allows_body? && @request_method.allows_body?\n end", "def body_has_meaningful_content?(body_elt)\n body_elt && body_elt.to_s != \"<body><p></p></body>\"\n end", "def body\n @body || \"\"\n end", "def answered?\n !body.blank?\n end", "def valid_body?\n request.feedback.body && valid_json?(request.feedback.body)\n end", "def body=(body); end", "def validate\n if self.body.empty? || self.body =~ /^\\s+$/\n errors.add(:body, \"^Please enter your annotation\")\n end\n if !MySociety::Validate.uses_mixed_capitals(self.body)\n errors.add(:body, '^Please write your annotation using a mixture of capital and lower case letters. This makes it easier for others to read.')\n end\n end", "def test_simple_empty_body\n @mail = SignedMail.new(\"test: test\\r\\n\\r\\n\")\n @mail.body_canonicalization = 'simple'\n\n assert_equal \"\\r\\n\", @mail.canonical_body\n end", "def body(value = nil)\n\t\t\tvalue ? @body = value : @body ||= ''\n\t\tend", "def finish\n super\n\n if _requires_no_body?\n @_body = nil\n end\n end", "def clear_body; end", "def body\n ret = read_attribute(:body)\n if ret.nil?\n return ret\n end\n ret = ret.strip\n ret = ret.gsub(/(?:\\n\\s*){2,}/, \"\\n\\n\") # remove excess linebreaks that unnecessarily space it out\n ret\n end", "def validate_title_and_body\n return true unless self[:title].blank?\n return errors.add(:validate_title_and_body, \"Title and Body are required\") if self[:body].blank?\n self[:title] = self[:body][0..29]\n end", "def body=(value)\n @body = value\n end", "def body_content\n end", "def check_body\n return true if body.blank?\n\n limit = 1_500_000\n current_length = body.length\n return true if body.length <= limit\n\n raise Exceptions::UnprocessableEntity, \"body of article is too large, #{current_length} chars - only #{limit} allowed\" if !ApplicationHandleInfo.postmaster?\n\n logger.warn \"WARNING: cut string because of database length #{self.class}.body(#{limit} but is #{current_length})\"\n self.body = body[0, limit]\n end", "def must_have_body?\n Methods[@method].must_have_body\n end", "def body body=nil\n @response.body = body if body\n @response.body\n end", "def celestialBody?\n\t\trawString.start_with? 'c'\n\tend", "def body_contains\n return @body_contains\n end", "def body\n part('body')\n end", "def body=(value)\n @body = value\n end", "def body=(value)\n @body = value\n end", "def body=(value)\n @body = value\n end", "def body=(value)\n @body = value\n end", "def body?\n HTTY::Request::METHODS_SENDING_BODY.include? method\n end", "def body=(value)\n @body = value\n end", "def body\n if defined? @body\n @body\n else\n Null\n end\n end", "def body(value = nil)\n if value\n @body = value\n else\n @body\n end\n end", "def valid_body?(response, service)\n return true unless service[:body_match]\n\n response.body =~ service[:body_match]\n end", "def commit_body? str\n not str.start_with? '*'\nend", "def body_attributes\n {}\n end", "def body_attributes\n {}\n end", "def has_response_body?\n !response.body.nil? && !response.body.empty?\n end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body; end", "def body\n BadWord.filter_bad_words(read_attribute(:body))\n end", "def validate\n validates_presence([:title, :body])\n end", "def should_be_required(options)\n @new_post.class.should_receive(:reflect_on_validations_for).with(:body).and_return([\n mock('MacroReflection', :macro => :validates_presence_of, :name => :body, :options => options[:options])\n ])\n \n semantic_form_for(@new_post) do |builder|\n concat(builder.input(:body))\n end\n \n if options[:required]\n output_buffer.should_not have_tag('form li.optional')\n output_buffer.should have_tag('form li.required')\n else\n output_buffer.should have_tag('form li.optional')\n output_buffer.should_not have_tag('form li.required')\n end\n end", "def body\n content.gsub(/\\s*---\\s*/, \"\\n\\n\")\n end", "def article_body\n respond_to?(:body) ? body : ''\n end", "def body_lazy(value)\n process_body_raw if @body_raw && value\n case\n when value == nil || value.length<=0\n @body = Mail::Body.new('')\n @body_raw = nil\n add_encoding_to_body\n when @body && @body.multipart?\n @body << Mail::Part.new(value)\n add_encoding_to_body\n else\n @body_raw = value\n# process_body_raw\n end\n end", "def body_content\n raise NotImplementedError\n end", "def unique_body=(value)\n @unique_body = value\n end", "def body(opts)\n \"\"\n end", "def body=(newval)\n if self[:body] != newval\n # changed\n self[:body] = newval\n end\n self[:body]\n end", "def body_or_subject_contains\n return @body_or_subject_contains\n end", "def body\n description\n end", "def body\n @body ||= process_text(@raw_body)\n end", "def test_example_body_without_body\n schema = Heroics::Schema.new(SAMPLE_SCHEMA)\n link = schema.resource('resource').link('info')\n assert_equal(nil, link.example_body)\n end", "def body(value = nil)\n if value\n self.body = value\n# add_encoding_to_body\n else\n process_body_raw if @body_raw\n @body\n end\n end", "def test_send_delete_body_with_blank_field()\n # Parameters for the API call\n body = DeleteBody.from_hash(APIHelper.json_deserialize(\n '{\"name\":\"farhan\",\"field\":\" \"}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.send_delete_body(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def assert_not_in_body(*strings)\n strings.each do |string|\n assert last_response.body.index(string).nil?,\n \"Did not expect '#{string}' to be in last_response.body\"\n end\n end", "def assert_post_body_for(post, present: true)\n if present\n assert_match markdown(post.content), response.body\n else\n assert_no_match markdown(post.content), response.body\n end\n end", "def body_text(http_resp)\n if http_resp[:nbody] > 0\n http_resp[:body].read_string(http_resp[:nbody])\n else\n ''\n end\n end", "def body\n raise NotImplementedError, \"#{self.class} must implement #body!\"\n end", "def body\n @attributes[:body]\n end", "def domtype\n :body\n end", "def body_io; end", "def body_io; end", "def test_nil_body\n dest = make_destination\n assert_nothing_raised {\n @conn.publish dest, nil\n }\n conn_subscribe dest\n msg = @conn.receive\n assert_equal \"\", msg.body\n checkEmsg(@conn)\n end", "def body\n return @body\n end", "def close_body(body)\n end", "def done_body?\n done?\n end", "def has_content?\n ( not self.title.nil? and not self.title.length == 0 ) or \n (not self.description.nil? and not self.description.length == 0 ) or \n (not self.teaser.nil? and not self.teaser.length == 0 )\n end", "def parse_text_body\n if (length = @buffer.index(NULL))\n parse_body(length)\n end\n end", "def validate_body_versus_content_length!\n unless self.header?(\"content-length\")\n puts \"Http2: No content length given - skipping length validation.\" if @debug\n return nil\n end\n\n content_length = header(\"content-length\").to_i\n body_length = @body.bytesize\n\n puts \"Http2: Body length: #{body_length}\" if @debug\n puts \"Http2: Content length: #{content_length}\" if @debug\n\n raise \"Body does not match the given content-length: '#{body_length}', '#{content_length}'.\" if body_length != content_length\n end", "def can_have_body?\n Methods[@method].can_have_body\n end", "def body\n @body ||= Page.convert_raw_to_html(raw_body)\n end", "def encode_body\n '' # No body by default\n end" ]
[ "0.7720762", "0.75488925", "0.73216426", "0.7317211", "0.7317211", "0.71888477", "0.7062146", "0.70620996", "0.70530987", "0.7017217", "0.699865", "0.699865", "0.6779107", "0.67744946", "0.65909123", "0.656039", "0.65031093", "0.647461", "0.64611775", "0.6360594", "0.6332697", "0.6329056", "0.6325838", "0.6324742", "0.630105", "0.6299087", "0.6285185", "0.6265692", "0.62618005", "0.62492144", "0.62395024", "0.6232455", "0.62124264", "0.6191309", "0.61911684", "0.6162488", "0.61406285", "0.6126138", "0.6126138", "0.6126138", "0.6126138", "0.612607", "0.61077887", "0.60401976", "0.60343206", "0.5987892", "0.5966215", "0.5964022", "0.5964022", "0.5958253", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5946621", "0.5931185", "0.5929381", "0.588387", "0.5883094", "0.58811975", "0.5850632", "0.58460313", "0.5840515", "0.5832274", "0.58306974", "0.5821064", "0.58155096", "0.58044356", "0.5799265", "0.57962084", "0.57774365", "0.576707", "0.5745579", "0.5730659", "0.57283735", "0.5704371", "0.5704004", "0.5703287", "0.5703287", "0.5699321", "0.56945056", "0.5667953", "0.5667337", "0.5646217", "0.5640828", "0.5624658", "0.56080514", "0.5607487", "0.5607128" ]
0.599313
45
Only admins have the right to create, update or destroy fields
def playing? redirect_to matche_url(@match), alert: I18n.t(:alert, scope: 'custom.controller.comment.playing') unless playing_user?(@match, current_user) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_only\n false\n end", "def update_permitted?\n\t\tacting_user.administrator?\n\tend", "def admin_only\n deny_access(\"Necesitas tener privilegios de administrador para entrar.\") unless signed_in_as_admin?\n end", "def create_permitted?\n acting_user.administrator?\n end", "def create_permitted?\n acting_user.administrator?\n end", "def create_permitted?\n acting_user.administrator?\n end", "def create_permitted?\n acting_user.administrator?\n end", "def write_permitted?\n return acting_user.administrator?\n end", "def can_edit_admin?\n return false unless is_admin? && !is_last_admin?\n true\n end", "def isAdmin\n \n end", "def check_if_should_be_admin\n end", "def company_edit_permitted?\n acting_user.administrator? || same_company\n end", "def can_edit\n producer.admin?(user) || group_admin?\n end", "def editable?\n admin?\n end", "def admin?; false end", "def authorized_for_create?\n current_user.is_admin\n end", "def thesis_admin\n processor\n\n can :manage, :all\n cannot 'destroy', :copyright\n cannot 'destroy', :degree\n cannot 'destroy', :department\n cannot 'destroy', :hold_source\n cannot 'destroy', :license\n cannot 'destroy', :thesis\n end", "def update?\n user.admin?\n end", "def write_permitted?\n return (acting_user.administrator? || users.member?(acting_user))\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def update_permitted?\n\t\t# TODO: any other fields?\n\t\t# TODO: so does this show them the adminstrator field anyway?\n\t\tacting_user.administrator? || (acting_user == self && only_changed?(\n\t\t\t\t# what fields the user is permitted to change\n\t\t\t\t# NOTE: crypted_password has attr_protected so although it is can\n\t\t\t\t# change, it cannot be changed directly from a form submission\n\t\t\t\t:name,\n\t\t\t\t:user_name,\n\t\t\t\t:email_address,\n\t\t\t\t:crypted_password,\n\t\t\t\t:current_password,\n\t\t\t\t:password,\n\t\t\t\t:password_confirmation\n\t\t\t)\n\t\t)\n\t\t# Note: \n\tend", "def permission_required \n render_403 unless admin? || @item.is_editable_by?(current_user)\n end", "def can_edit_admin_objects?\n in_role?('admin', 'super-user', 'releng') # pm?\n end", "def admin_required\n current_user.is_admin? || access_denied\n end", "def user_accessible?\n is_admin\n end", "def authorizes_to_edit_user_admin_field?(user, options = {})\n user.admin? && user.id != options[:user_id]\n end", "def can_org_admin?\n return self.can_grant_permissions? || self.can_modify_guidance? ||\n self.can_modify_templates? || self.can_modify_org_details?\n end", "def is_admin\n object.admin?\n end", "def is_admin?\n admin\n end", "def is_admin?\n admin\n end", "def set_editability\n @editable = user_signed_in? && (current_user.member.role.name.eql? \"University Admin\") &&\n current_user.member.institution.id == @course.department.institution.id\n end", "def can_edit\n return current_user && (current_user.id == Integer(params[:id]) || current_user.is_admin)\n end", "def must_be_admin!\n access_denied! unless current_admin?\n end", "def require_admin\n grant_access?(\"index\", \"users\")\n #position?('admin')\n end", "def admin?; current_user.admin?; end", "def admin?; current_user.admin?; end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin') || access_denied\n end", "def admin\n\t\tcan :manage, :all\n\tend", "def admin\n self.is_admin_for?\n end", "def require_admin_permission\n redirect_to tables_path, notice: 'Necesita permisos de administrador para visualizar la configuracion' unless current_user_admin?\n end", "def is_admin\n admin?\n end", "def can_edit?(user)\n\n end", "def read_permitted?\n return (acting_user.administrator? || true)\n end", "def self_edit_only\n #if current_user.id != Integer(params[:id]) && !current_user.is_admin\n if !can_edit\n redirect_to user_url, :notice => \"You don't have permission to do that.\"\n else\n end\n end", "def admin_only\n logged_in_as_admin? || admin_only_access_denied\n end", "def require_admin\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin')\n end", "def admin?\n false\n end", "def only_for_admins\n raise ActiveRecord::RecordNotFound unless current_user.has_role? :admin\n end", "def no_admin_set_abilities\n cannot [:edit, :create, :delete], Hydra::Admin::Collection\n end", "def set_as_admin\n self.admin = true\n end", "def admin_cannot_actions\n [:new, :create].freeze\n end", "def can_edit?(user)\n (self.user == user) || !!(user && user.admin?)\n end", "def require_admin\n not_authorized(\"Invalid credentials.\") unless is_admin?\n end", "def can_edit?\n return !@energy_usage.approved? || current_user.manager? \n end", "def admin_user\n render_forbidden unless current_user.admin?\n end", "def is_admin?\n usertype == \"admin\" and id == 0\n end", "def admin_access?\n admin?\n end", "def admin_only\n deny_access(\"You must be signed in as an admin to access this page.\") unless signed_in_as_admin?\n end", "def _admin_or_self\n not_authorizaed unless current_user.admin? || current_user == @user\n end", "def is_admin?\n admin?\n end", "def admin_required\n self.current_user != :false && \n self.current_user.is_admin? ? true : access_denied\n end", "def update?\n owner? || user.is?(:admin)\n end", "def show\n is_admin?\n end", "def admin?() false end", "def create?\n !@current_user.admin?\n end", "def require_admin\n deny_wrong_user if !admin?\n end", "def is_admin\n\t\tself.admin == true\n\tend", "def is_admin?\n self.admin\n end", "def is_admin?\n self.admin\n end", "def is_admin?\n self.admin\n end", "def is_admin?\n self.admin\n end", "def isAdmin\n self.admin?\n end", "def can_create_opinion_from_admin?\n toggle_allow(admin_creation_is_enabled?) if permission_action.subject == :opinion\n end", "def admin?\n return !new_record? && login == 'admin'\n end", "def show\n is_admin?\n end", "def checkAdmin\n current_user.present? && current_user.isAdmin\n end", "def ensure_admin!\n authorize! :read, :admin_dashboard\n end", "def ensure_admin!\n authorize! :read, :admin_dashboard\n end", "def can_edit?(obj)\n return true if obj.user_id == user_id || is_admin?\n false\n end", "def is_admin?\n\t\tself.permission_level >= 3\n\tend", "def permitted?; end", "def admin_only\n if !Volt.current_user.admin\n redirect_to '/login'\n end\n end", "def has_admin_access?\n admin? || moderator?\n end", "def administrator\n can :manage, :all\n end", "def can_edit?(user)\n user && self.creator_id == user.id\n end", "def only_authorize_admin!\n authorize!(is?(:admin))\n end", "def admin? ; user.instance_of? User and user.role >= 2 ; end", "def can_edit?\n allows_current_user_access_to? :edit\n end", "def update?\n user_is_owner? || user_is_admin?\n end", "def can_edit?\n can_write? && (account_is_owner? || account_is_collaborator?)\n end", "def authorize_admin!\n authorize! :manage, :all\n end", "def create?\n admin.expert? or admin.vip? or admin.root?\n end", "def update?\n user_is_owner_or_admin?\n end", "def update?\n user_is_owner_or_admin?\n end", "def update?\n user_is_owner_or_admin?\n end", "def require_admin\n unless admin?\n flash[:warning] = \"Sorry, only administrators can do that.\"\n redirect_to Warnings_url\n end\n end", "def edit\n require_user\n end", "def admin_only\n\t\t\tif logged_in?\n\t\t\t\tif User.find_by(id: current_user.id.to_i).admin != true\n\t\t\t\t\tredirect_to root_path, :alert => \"Odmowa dostępu musisz być adminem\"\n\t\t\t\tend\n\t\t\tend\n\t\tend" ]
[ "0.7368799", "0.7272396", "0.7267043", "0.72529113", "0.72529113", "0.72529113", "0.72529113", "0.7190417", "0.71455944", "0.7088465", "0.7069596", "0.706638", "0.70640886", "0.7057038", "0.7039171", "0.7008857", "0.69942725", "0.6983556", "0.6957856", "0.69491655", "0.69491655", "0.69491655", "0.69457006", "0.69344926", "0.6933068", "0.6904361", "0.6894901", "0.68773806", "0.68744826", "0.68709743", "0.68628556", "0.68628556", "0.6859426", "0.68569434", "0.6852345", "0.6847458", "0.68428195", "0.68428195", "0.68276024", "0.68226695", "0.6813334", "0.6810225", "0.68039554", "0.6800595", "0.67931724", "0.6788263", "0.67864335", "0.6781954", "0.67800856", "0.67789626", "0.67786473", "0.67763287", "0.6762585", "0.67572486", "0.67484266", "0.6741689", "0.6722598", "0.6714214", "0.6712234", "0.6711544", "0.6709562", "0.6709003", "0.67065936", "0.6705978", "0.6704705", "0.67002517", "0.66972363", "0.66955423", "0.6684977", "0.6682568", "0.6670799", "0.6670799", "0.6670799", "0.6670799", "0.6670748", "0.6660704", "0.6651306", "0.66391796", "0.6638697", "0.6635358", "0.6635358", "0.6634136", "0.66285336", "0.66272175", "0.6621416", "0.6612109", "0.6609082", "0.66042143", "0.66003424", "0.65988064", "0.65984964", "0.6595439", "0.6593667", "0.6585565", "0.6574765", "0.65741235", "0.65741235", "0.65741235", "0.6563763", "0.65607965", "0.6558643" ]
0.0
-1
NOTE: This method doesn't look conventional on purpose. The app these bits are taken from has some crazy stuff in it.
def update if @appointment = Appointment.check_in(@visitor, appointment_params) redirect_to root_path, notice: 'Checked-in' else redirect_to root_path, alert: 'Failed check-in' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def anchored; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def formation; end", "def user_os_complex\r\n end", "def escaper; end", "def custom; end", "def custom; end", "def internal; end", "def implementation; end", "def implementation; end", "def weber; end", "def terpene; end", "def sharp; accidental; end", "def original; end", "def rest_positionals; end", "def escaper=(_); end", "def sitemaps; end", "def canonical?; end", "def specialty; end", "def berlioz; end", "def internal_encoding()\n #This is a stub, used for indexing\n end", "def who_we_are\r\n end", "def overrides; end", "def upc_e; end", "def ios; end", "def extra; end", "def offences_by; end", "def refutal()\n end", "def identify; end", "def trd; end", "def ignores; end", "def wrapper; end", "def isolated; end", "def isolated; end", "def jack_handey; end", "def verdi; end", "def intensifier; end", "def handle; end", "def probers=(_arg0); end", "def parslet; end", "def parslet; end", "def parslet; end", "def parslet; end", "def overload; end", "def suivre; end", "def ibu; end", "def from; end", "def from; end", "def from; end", "def from; end", "def leading; end", "def internal?; end", "def stderrs; end", "def origin; end", "def origin; end", "def origin; end", "def fallbacks; end", "def fallbacks; end", "def required_positionals; end", "def extended(*) end", "def appraisals; end", "def appraisals; end", "def rassoc(p0) end", "def parts; end", "def parts; end", "def parts; end", "def loc; end", "def loc; end", "def loc; end", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def invention; end", "def buzzword; end", "def buzzword; end", "def by_magic(io); end", "def fallbacks=(_arg0); end", "def missing?; end", "def treat_reserved_as_conflict; end", "def ext; end", "def ext; end", "def missing; end", "def processor; end", "def macro; raise NotImplementedError; end", "def macro; raise NotImplementedError; end", "def macro; raise NotImplementedError; end", "def with_repl_like_sigint; end", "def autofinish; end", "def sos_mono?() raise NotImplementedError end", "def name_safe?; end", "def as_you_like_it_quote; end", "def bs; end", "def celebration; end", "def private_method\n end", "def blg; end", "def r; end", "def r; end" ]
[ "0.6901752", "0.60692203", "0.5702686", "0.5691652", "0.56804025", "0.56804025", "0.56804025", "0.56804025", "0.5652786", "0.55516195", "0.55463195", "0.5498524", "0.5498524", "0.5495907", "0.547546", "0.547546", "0.5463433", "0.5442009", "0.54256505", "0.541286", "0.53801763", "0.53537166", "0.52804404", "0.52720726", "0.52645075", "0.52430457", "0.52418965", "0.5237669", "0.5229223", "0.5228016", "0.5225765", "0.5222671", "0.5215362", "0.5206921", "0.52026695", "0.5202569", "0.51989794", "0.51531035", "0.5150049", "0.5150049", "0.5149414", "0.51446867", "0.514393", "0.5133028", "0.51262295", "0.51259816", "0.51259816", "0.51259816", "0.51259816", "0.5117427", "0.5115397", "0.5110772", "0.5100916", "0.5100916", "0.5100916", "0.5100916", "0.50994366", "0.50993747", "0.50909984", "0.5084981", "0.5084981", "0.5084981", "0.5072778", "0.5072778", "0.50693095", "0.50617266", "0.5049188", "0.5049188", "0.50418", "0.5030786", "0.5030786", "0.5030786", "0.5022702", "0.5022702", "0.5022702", "0.50221896", "0.5020451", "0.5018714", "0.5018714", "0.5018053", "0.50154966", "0.5015335", "0.49995184", "0.49972266", "0.49972266", "0.498991", "0.49878052", "0.49818262", "0.49818262", "0.49818262", "0.49808735", "0.49756345", "0.49581203", "0.4948598", "0.49464646", "0.49407056", "0.49357805", "0.49346408", "0.4927731", "0.49229476", "0.49229476" ]
0.0
-1
This is to authenticate that the call is set from an account of the frontend
def authenticate_token @is_authenticated = false if request.headers["TOKEN"] if request.headers["TOKEN"] == "AppDipre" @is_authenticated = true end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth(value); end", "def Authentication\n call('', '')\n end", "def auth\n end", "def auth\n end", "def authenticate\n end", "def authenticate\n auth.call(:authenticate)\n end", "def authenticate!\n # Do nothing yet\n end", "def authenticate(request)\n\n end", "def auth_param; end", "def auth\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"params=#{params}\",\n \"\" ] if browse_everything_controller_debug_verbose\n # params contains the access code with with the key :code\n provider_session.token = provider.connect(params, provider_session.data, connector_response_url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider_session.token=#{provider_session.token}\",\n \"\" ] if browse_everything_controller_debug_verbose\n provider_session.token\n end", "def http_auth_login\n # FIXME: Implement\n end", "def authenticate_requester!(request)\n end", "def authenticate\n self.get && true\n end", "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 authenticate_signin\n\t Client.authenticate(params[:email], params[:password]) || render_unauthorized\n\t end", "def authenticate_account!\n store_bookingsync_account_id if BookingSync::Engine.embedded\n sign_out_if_inactive\n enforce_requested_account_authorized!\n request_authorization! if current_account.nil?\n end", "def authenticate_with(identity, next_service, username); end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def authenticate(request, realm, &password_procedure); end", "def authentication_method\n super\n end", "def authenticate\n \n authenticate_token || render_unauthorized\n end", "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'Not Authorized' }, status: 401 unless @current_user\n end", "def oauth_authentication; end", "def authenticate_request(allow_web_based_client = false)\n Rails.logger.info(\"allow_web_based_client-#{allow_web_based_client}\")\n\n request_parameters = request.request_method == 'GET' ? request.query_parameters : request.request_parameters\n\n service_response = authenticator.new(\n params.merge({\n request_parameters: request_parameters,\n url_path: request.path,\n allow_web_based_client: allow_web_based_client\n })\n ).perform\n\n if service_response.success?\n # Set client id\n params[:client] = service_response.data[:client]\n params[:client_id] = params[:client].id\n\n # Remove sensitive data\n service_response.data = {}\n else\n render_api_response(service_response)\n end\n end", "def authenticate!\n @client = Octokit::Client.new\n url = @client.authorize_url(CLIENT_ID)\n redirect url\nend", "def authenticate\n @current_user = Account.authenticate_user(request.authorization)\n SmsConnect.present_user = @current_user\n end", "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'Not Authorized' }, status: 401 unless @current_user\n end", "def authenticate!\n\t\t@current_user = AuthorizeApiRequest.call(request.headers).result\n\t\t# If unauthorized return an error to the front end\n\t\trender json: {error: 'Not Authorized'}, status: 401 unless @current_user\n\tend", "def authenticate(fb_user)\n \n \n end", "def authenticate_api!\n Rails.logger.info(\"Enter Authenticate Api\")\n \n # just to test we are using HTTP_HOST in test mode as HTTP_ORIGIN cant be set\n Rails.env == \"test\" ? origin = request.env['HTTP_HOST'] : origin = request.env['HTTP_ORIGIN']\n\n if !params[\"token\"].blank? and origin.blank? # API Access\n\n account_id = AccountsCache.access_token(params[\"token\"])\n\n raise et(\"application.unauthorized\") if account_id.blank?\n \n # set account_id in params\n if params[:controller] == \"accounts\" and current_account\n params[:id] = current_account._id.to_s if params[:id].blank?\n else\n params[:account_id] = current_account._id.to_s if params[:account_id].blank?\n end\n\n # set the request type\n params[:request_type] = AppConstants.request_type_api\n\n # mark already authenticated\n set_authenticated\n\n # make api request synchronous as of now\n make_sync_request\n end\n rescue => e \n Rails.logger.error(\"**** ERROR **** #{er(e)}\")\n head :unauthorized\n end", "def authenticate username, api_key, account: Conjur.configuration.account\n account ||= Conjur.configuration.account\n if Conjur.log\n Conjur.log << \"Authenticating #{username} to account #{account}\\n\"\n end\n JSON.parse url_for(:authn_authenticate, account, username).post(api_key, content_type: 'text/plain')\n end", "def userauth_request(username, next_service, auth_method, *others); end", "def authenticate_by_login_or_key(options = {})\n if api_request?\n self.current_account = site_account_by_provider_key\n else\n login_required\n end\n end", "def auth\n {}\n end", "def authenticate\n authenticate_token || render_unauthorized\n end", "def authenticate_with(identity, next_service, username, key_manager); end", "def authenticate_request\n Rails.logger.info(\"authenticate_webapps_request\")\n\n service_response = authenticator.new(params).perform\n\n if service_response.success?\n params[:ost_payment_token] = service_response.data[:ost_payment_tokens]\n # Remove sensitive data\n service_response.data = {}\n else\n render_api_response(service_response)\n end\n end", "def authenticate_with_api_key!\n \t\t@current_bearer = authenticate_or_request_with_http_token &method(:authenticator)\n \tend", "def authenticate!\n response = self.AuthenticateUser(\n { :username => config[:username], :password => config[:password] },\n :is_authenticate => true,\n :allow_reauthenticate => false)\n\n auth_data = {\n :retailer_guid => response['RetailerGuid'],\n :authenticated => response['Authenticated'],\n :token => response['Token'],\n :ics_user_id => response['ICSUserID']\n }\n\n if !auth_data[:authenticated]\n raise AuthenticationError, 'authentication failed'\n end\n\n self.retailer_guid = auth_data[:retailer_guid]\n\n self.auth_header = {\n \"wsdl:AuthenticationResult\" => {\n \"wsdl:RetailerGuid\" => auth_data[:retailer_guid],\n \"wsdl:Authenticated\" => auth_data[:authenticated],\n \"wsdl:Token\" => auth_data[:token],\n \"wsdl:ICSUserID\" => auth_data[:ics_user_id],\n }\n }\n\n @authenticated = true\n end", "def token_auth(*args, &block); end", "def authenticate_request\n auth_header_token = request.headers[\"Authorization\"]\n @current_user = AuthorizeApiRequest.new(auth_header_token).call\n render json: { error: \"Not Authorized\" }, status: 401 unless @current_user\n end", "def user_authentication\n end", "def credentials(authorization, request); end", "def authentication_type; end", "def authenticate\n callback = qbo_oauth_callback_url\n token = Qbo.get_oauth_consumer.get_request_token(:oauth_callback => callback)\n session[:qb_request_token] = Marshal.dump(token)\n redirect_to(\"https://appcenter.intuit.com/Connect/Begin?oauth_token=#{token.token}\") and return\n end", "def authenticate_account!\n \tif session[:current_account_id]\n \t\t@current_account = Account.where(id: session[:current_account_id]).first\n\n \tend\n \treturn redirect_to accounts_login_path unless @current_account\n \t\n end", "def authenticate\n authenticate_token || render_unauthorized\n end", "def authenticate\n json_response(\n auth_token: AuthenticateUser.new(\n auth_params[:username],\n auth_params[:password]\n ).call\n )\n end", "def capable_login_auth?; end", "def authenticate(client)\n \n end", "def authenticate\n # return if unauthorized?\n\n # render json: {\n # message: I18n.t('api.v1.error_messages.unauthorized')\n # }, status: :unauthorized\n end", "def authenticate_inviter!\n send(:\"authenticate_#{resource_name}!\")\n end", "def authenticate\n response = post('login')\n @access_token = response['access-token']\n @client_id = response['client-id']\n end", "def http_auth?; end", "def authenticate!\n error!(\"401 Unauthorized\", 401) unless check_auth_token \n end", "def authenticate_with_api_key\n\t @current_bearer = authenticate_with_http_token &method(:authenticator)\n\t end", "def authenticate\n oauth2_client = Qbo.get_client\n callback = Setting.host_name + \"/qbo/oauth_callback/\" \n grant_url = oauth2_client.auth_code.authorize_url(redirect_uri: callback, response_type: \"code\", state: SecureRandom.hex(12), scope: \"com.intuit.quickbooks.accounting\")\n redirect_to grant_url\n end", "def authenticate\n # :x_amee_source = \"X-AMEE-Source\".to_sym\n request = Typhoeus::Request.new(\"#{protocol}#{@server}/auth/signIn\", \n :method => \"post\",\n :verbose => DEBUG,\n :headers => {\n :Accept => content_type(:xml),\n },\n :body => form_encode(:username=>@username, :password=>@password)\n )\n\n hydra.queue(request)\n hydra.run\n response = request.response\n\n @auth_token = response.headers_hash['AuthToken']\n d {request.url}\n d {response.code}\n d {@auth_token}\n\n connection_failed if response.code == 0\n\n unless authenticated?\n raise AMEE::AuthFailed.new(\"Authentication failed. Please check your username and password. (tried #{@username},#{@password})\")\n end\n # Detect API version\n if response.body.is_json?\n @version = JSON.parse(response.body)[\"user\"][\"apiVersion\"].to_f\n elsif response.body.is_xml?\n @version = REXML::Document.new(response.body).elements['Resources'].elements['SignInResource'].elements['User'].elements['ApiVersion'].text.to_f\n else\n @version = 1.0\n end\n end", "def authenticate\n\t\tauthenticate_token || render_unauthorized\n\tend", "def show\n authorize AccountingEntry\n end", "def authenticate(user)\n self.class.get(\"/v2/auth\", :query => generate_query(user))\n end", "def authenticate\n authenticate_token || render_unauthorized\nend", "def authorize\n end", "def authorize\n end", "def auth\r\n OAuth2\r\n end", "def authenticate!\n if in_flow?\n continue_flow!\n else\n begin_flow!\n end\n end", "def authenticate_user!\n return true if current_user\n # get token and options\n authenticate_or_request_with_http_token do |token, options|\n access_token = AccountAccessToken.where('token_value = ? AND expires > ?', token, Date.today).first\n if access_token\n sign_in access_token.account\n else\n unauthenticated!\n end\n end\n end", "def authenticate\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n # kindly refactor and add more keys to the response object when needed\n response = { \n status: Message.success,\n data: {\n token: auth_token\n } \n }\n json_response(response, 200)\n end", "def capable_plain_auth?; end", "def authenticate_client_host\n service_response = UserManagement::VerifyClientHost.new(domain: request.host).perform\n\n if service_response.success?\n params[:client_id] = service_response.data[:client_id]\n params[:client] = service_response.data[:client]\n service_response.data = {}\n else\n render_api_response(service_response)\n end\n end", "def auth()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n render json: {status: true, reason: \"\", data: \"\"}\n end", "def authn_authenticate_local username, account, expiration, cidr, &block\n { account: account, sub: username }.tap do |params|\n params[:exp] = expiration if expiration\n params[:cidr] = cidr if cidr\n end.to_json\n end", "def authenticate(next_service, username, password = T.unsafe(nil)); end", "def authenticate!\n response = connection.post '/oauth2/v1/tokens/bearer' do |req|\n req.headers['Authorization'] = 'Basic ' + Base64.strict_encode64(@options[:client_id] + \":\" + @options[:client_secret])\n req.body = encode_www_form(params)\n end\n\n if response.status >= 500\n raise QuickbooksOnlineRuby::ServerError, error_message(response)\n elsif response.status != 200\n raise QuickbooksOnlineRuby::AuthenticationError, error_message(response)\n end\n\n @options[:access_token] = response.body['access_token']\n @options[:refresh_token] = response.body['refresh_token']\n\n if @options[:authentication_callback]\n @options[:authentication_callback].call(response.body)\n end\n\n response.body\n end", "def authenticate\n #Hace el llamado de la clase AuthenticaUser, manda los parametros de :username y :password\n #Realiza el metodo call para obtener el Token del user_id\n #Arroja el token como Json_response\n auth_token = AuthenticateUser.new(auth_params[:username], auth_params[:password]).call \n json_response(auth_token: auth_token)\n end", "def authenticate_request\n service_response = UserManagement::VerifyCookie.new(\n client: params[:client],\n cookie_value: cookies[GlobalConstant::Cookie.user_cookie_name.to_sym],\n browser_user_agent: http_user_agent\n ).perform\n\n if service_response.success?\n # Update Cookie, if required\n extended_cookie_value = service_response.data[:extended_cookie_value]\n set_cookie(\n GlobalConstant::Cookie.user_cookie_name,\n extended_cookie_value,\n GlobalConstant::Cookie.user_expiry.from_now\n ) if extended_cookie_value.present?\n\n # Set user id\n params[:user_id] = service_response.data[:user_id]\n\n # Remove sensitive data\n service_response.data = {}\n else\n # Clear cookie\n delete_cookie(GlobalConstant::Cookie.user_cookie_name)\n render_api_response(service_response)\n end\n end", "def authentication_request(controller, realm, message = T.unsafe(nil)); end", "def authenticate!\n # if the authentication header is an acceptible value\n if @env['HTTP_X_MY_API'] == 'foobar'\n user = { :id => 1, :name => \"some user\" }\n # warden doesn't care what the user is, so long as it's not nil.\n success! user, \"success\"\n end\n end", "def authenticate\n token = CrownAuthenticate.new().token\nend", "def authenticate!\n api_key = request.headers[\"x-access-token\"] || params.delete(:api_key)\n\n if api_key.nil?\n self.current_advertiser = self.current_publisher = nil\n else\n self.current_advertiser = Trac::Advertiser.find_by(advertiser_api_key: api_key)\n logger.info \"Advertiser [#{current_advertiser.name}] logged in.\" if current_advertiser\n\n self.current_publisher = current_advertiser.nil? ? Trac::Publisher.find_by(publisher_api_key: api_key) : nil\n logger.info \"Publisher [#{current_publisher.name}] logged in.\" if current_publisher\n end\n\n render status: :unauthorized, json: { message: \"Wrong API token!\" } if current_advertiser.nil? && current_publisher.nil?\n end", "def call\n ap \"Llamando a Authentica User\"\n JsonWebToken.encode(usuario_id: usuario.id) if usuario\n end", "def authenticate_member!\n end", "def authenticate\n authenticated_user = AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n response = { message: Message.logged_in, auth_token: authenticated_user[:auth_token], is_doctor: authenticated_user[:is_doctor], doctor_id: authenticated_user[:doctor_id], fullname: authenticated_user[:fullname], date_of_birth: authenticated_user[:date_of_birth] }\n json_response(response)\n end", "def host_authorization; end", "def host_authorization; end", "def authenticate_knox_api_key!\n authenticate_for ApiKey\n end", "def auth\n if request.get?\n show_auth\n elsif request.post?\n check_auth\n end\n end", "def valid_for_authentication?; end", "def valid_for_authentication?; end", "def authenticate\n unless FfcrmVend.config.token == params[:token]\n render :text => \"\", :status => :unauthorized\n end\n end", "def authenticate\n @shoonga = authenticate_or_request_with_http_basic do |username, password|\n username == \"4vght\" && password == \"we8vds\"\n end\nend", "def authenticate\n # if valid_access_token?\n # fetch_access_token\n # else\n get_new_access_token\n # end\n end", "def authenticate_account(client, options)\n if options[:application].nil? or options[:username].nil? or options[:password].nil? \n puts \"Missing arguments\"\n return\n end\n\n application = client.applications.get options[:application]\n request = Stormpath::Authentication::UsernamePasswordRequest.new options[:username], options[:password]\n begin\n result = application.authenticate_account request\n puts \"Authentication: SUCCESS\"\n puts \"Account Href: \" + result.account.href\n \n rescue Stormpath::Error => e\n puts \"Authentication: FAILURE\"\n print_error(e)\n end\nend", "def authenticate_account!\n redirect_to login_path, alert: \"You must be logged in to access this page\" if current_account.nil?\n end", "def authenticate_account\n self.password ||= ''\n self.match = Account.find_by_email_address_and_password(self.site_id, self.email_address, self.password)\n if self.match\n self.account_id ||= self.match.id\n end\n end", "def authenticate\n command = AuthenticateUser.call(params[:email].to_s.strip.downcase, params[:password])\n if command.success?\n @auth_token = command.result\n else\n render json: { error: command.errors }, status: :unauthorized\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic do |user, password|\n user == ChargebeeRails.configuration.webhook_authentication[:user] &&\n password == ChargebeeRails.configuration.webhook_authentication[:secret]\n end\n end", "def twilio_auth!\n Twilio::REST::Client.new(ACCOUNT_SID, AUTH_TOKEN)\n end", "def auth_transaction\n data = full_params.merge(\n 'x_unique_id' => unique_id,\n 'x_invoice_num' => invoice_num,\n 'x_type' => \"AUTH_ONLY\"\n )\n\n astro_curl(@validator_url, data)\n end", "def params_auth_hash; end" ]
[ "0.7170132", "0.7159344", "0.70388144", "0.70388144", "0.69791156", "0.6970143", "0.6838447", "0.68367535", "0.68132263", "0.6805527", "0.6782098", "0.6765327", "0.6759957", "0.6744766", "0.67396355", "0.67160964", "0.6682719", "0.6660883", "0.6660883", "0.66471606", "0.6645615", "0.66454", "0.6639119", "0.6635807", "0.66287667", "0.661761", "0.6613093", "0.66045755", "0.65998346", "0.6591773", "0.6568053", "0.6561966", "0.6559939", "0.6531319", "0.651537", "0.6511675", "0.6507837", "0.65074223", "0.64939594", "0.6481537", "0.64803493", "0.6479675", "0.6478256", "0.64704823", "0.6469612", "0.6448384", "0.6443482", "0.6442288", "0.643718", "0.64347637", "0.6430475", "0.64280653", "0.6419093", "0.6396204", "0.6390882", "0.6390504", "0.6381346", "0.6373101", "0.6364211", "0.63635576", "0.634922", "0.63335145", "0.632849", "0.63281167", "0.63281167", "0.63197494", "0.6313042", "0.63060194", "0.6304239", "0.63041353", "0.62985647", "0.6293465", "0.6291465", "0.6288601", "0.62876105", "0.6284838", "0.6284728", "0.6284178", "0.62768024", "0.6273999", "0.6273705", "0.6273206", "0.6272707", "0.6270374", "0.6267827", "0.6267827", "0.6261477", "0.6247907", "0.62478054", "0.62478054", "0.6239612", "0.6236569", "0.62325937", "0.6229457", "0.62282175", "0.62275034", "0.62247676", "0.6223305", "0.62215364", "0.6221381", "0.6216808" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_news @news = New.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
Only allow a trusted parameter "white list" through.
def news_params params.require(:news).permit(:title, :description, :publishedAt, :source, :urlToImage, :url) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def parameters\n nil\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.7122899", "0.7054107", "0.69478", "0.6902101", "0.67359334", "0.67178756", "0.66889167", "0.6677724", "0.6661157", "0.6555896", "0.6527207", "0.64584696", "0.64517015", "0.6450208", "0.644749", "0.6435074", "0.6413329", "0.6413329", "0.6391818", "0.6380081", "0.6380081", "0.6375536", "0.6360849", "0.635511", "0.6285548", "0.62798816", "0.62468714", "0.6227613", "0.6224945", "0.6224163", "0.62108225", "0.62080175", "0.6177938", "0.6171946", "0.6168783", "0.615999", "0.614475", "0.6136407", "0.61226404", "0.61090046", "0.60992956", "0.6075657", "0.60532176", "0.6040335", "0.6035594", "0.60304934", "0.60196596", "0.6018118", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.6018028", "0.60165983", "0.6005772", "0.6004614", "0.60022306", "0.59969896", "0.59954774", "0.59947675", "0.59847546", "0.5984462", "0.597783", "0.5975277", "0.59699774", "0.59675187", "0.5966527", "0.5966527", "0.5957506", "0.59521663", "0.59506977", "0.59479433", "0.5944202", "0.59313655", "0.5930722", "0.592726", "0.5924843", "0.5918731", "0.59178615", "0.5914195", "0.59137934", "0.5908005", "0.59058493", "0.5904342", "0.59020513", "0.59004885", "0.58971745", "0.5896885", "0.58949924" ]
0.0
-1
The runtime implementation of the "+loop" word.
def vm_do_increment inc_raw = self.pop unless (inc_value = inc_raw.to_foorth_n) error "F40: Cannot convert a #{inc_raw.foorth_name} to a Numeric instance" end if inc_value > 0 inc_value else error "F41: Invalid loop increment value: #{inc_value}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loop; end", "def pre_loop; end", "def preloop\n end", "def endless_loop?; end", "def kloop\n end", "def loop\n end", "def execute_LOOP(operand)\n\t\tjump_conditionally_to_signed_displacement(operand, !(perform_counting_loop.zero?))\n\tend", "def loop\n end", "def loop\n end", "def infinite_loop?; end", "def build_loop(mdefs)\n dispatch = gen(\n \"case @opcode\",\n *DISPATCH.map.with_index do |args, opcode|\n if args.size > 1\n mhd, instr, = args\n code = expand_inline_methods(\"#{ mhd }(#{ args.drop(1).join(\", \") })\", mhd, mdefs[mhd])\n code = code.gsub(/send\\((\\w+), (.*?)\\)/) { \"#{ $1 }(#{ $2 })\" }\n code = code.gsub(/send\\((\\w+)\\)/) { $1 }\n code = code[1..-2].split(\"; \")\n else\n instr = code = args[0]\n end\n \"when 0x%02x # #{ instr }\\n\" % opcode + indent(2, gen(*code))\n end,\n \"end\"\n )\n main = mdefs[:run].body.sub(\"@conf.loglevel >= 3\") { @loglevel >= 3 }\n main.sub(/^ *send.*\\n/) { indent(4, dispatch) }\n end", "def begin_adding(*) end", "def loop_forever; end", "def is_loop\n\n true\n end", "def run_loop\n end", "def run\n raise NotImplementedError, 'Generic loop has nothing to do'\n end", "def post_loop; end", "def _loop(nspace, loop_meth, entry_cast)\n _check_open!\n b = lambda {|e, i| yield entry_cast.new(e); nil } \n nspace.__send__ loop_meth, @handle, b, self.object_id\n end", "def dLoop_Handler(dLoop)\n\tresult = 0\n\tif (dLoop.types[0] == :VARIABLE)\n\t\titerVar = dLoop.elems[0].term\n\t\t# Busca la variable, si la encuentra, la actualiza, si no, la inserta.\n\t\tif ($symTable.lookup(iterVar) == nil)\n\t\t\t$symTable.insert(iterVar, [:NUMBER, nil])\n\t\telse\n\t\t\t$symTable.update(iterVar, [:NUMBER, nil])\n\t\tend\n\t\texpr1 = dLoop.elems[1]\n\t\ttypeExpr1 = expression_Handler(expr1)\n\t\texpr2 = dLoop.elems[2]\n\t\ttypeExpr2 = expression_Handler(expr2)\n\t\tif (typeExpr1 != :NUMBER) or (typeExpr2 != :NUMBER)\n\t\t\tputs \"DET LOOP ERROR: expressions must be arithmetic.\"\n\t\t\tresult += 1\n\t\tend\n\t\tinstr = dLoop.elems[3]\n\t\tresult += instr_Handler(instr, iterVar)\n\t\treturn result\n\telse\n\t\texpr1 = dLoop.elems[0]\n\t\ttypeExpr1 = expression_Handler(expr1)\n\t\texpr2 = dLoop.elems[1]\n\t\ttypeExpr2 = expression_Handler(expr2)\n\t\tif (typeExpr1 != :NUMBER) or (typeExpr2 != :NUMBER)\n\t\t\tputs \"DET LOOP ERROR: expressions must be arithmetic.\"\n\t\t\tresult += 1\n\t\tend\n\t\tinstr = dLoop.elems[2]\n\t\tresult += instr_Handler(instr)\n\t\treturn result\n\tend\nend", "def dLoop_Handler(dLoop)\n\tresult = 0\n\tif (dLoop.types[0] == :VARIABLE)\n\t\titerVar = dLoop.elems[0].term\n\t\t# Busca la variable, si la encuentra, la actualiza, si no, la inserta.\n\t\tif ($symTable.lookup(iterVar) == nil)\n\t\t\t$symTable.insert(iterVar, [:NUMBER, nil])\n\t\telse\n\t\t\t$symTable.update(iterVar, [:NUMBER, nil])\n\t\tend\n\t\texpr1 = dLoop.elems[1]\n\t\ttypeExpr1 = expression_Handler(expr1)\n\t\texpr2 = dLoop.elems[2]\n\t\ttypeExpr2 = expression_Handler(expr2)\n\t\tif (typeExpr1 != :NUMBER) or (typeExpr2 != :NUMBER)\n\t\t\tputs \"DET LOOP ERROR: expressions must be arithmetic.\"\n\t\t\tresult += 1\n\t\tend\n\t\tinstr = dLoop.elems[3]\n\t\tresult += instr_Handler(instr, iterVar)\n\t\treturn result\n\telse\n\t\texpr1 = dLoop.elems[0]\n\t\ttypeExpr1 = expression_Handler(expr1)\n\t\texpr2 = dLoop.elems[1]\n\t\ttypeExpr2 = expression_Handler(expr2)\n\t\tif (typeExpr1 != :NUMBER) or (typeExpr2 != :NUMBER)\n\t\t\tputs \"DET LOOP ERROR: expressions must be arithmetic.\"\n\t\t\tresult += 1\n\t\tend\n\t\tinstr = dLoop.elems[2]\n\t\tresult += instr_Handler(instr)\n\t\treturn result\n\tend\nend", "def compute_loop(index)\n start_index = index\n end_index = compute_loop_length(index)\n counter = @program_space[@data_ptr]\n if counter > 0\n while index <= end_index\n current_char = @program_data[index]\n if current_char == ']'\n index = start_index-1 if @program_space[@data_ptr] != 0\n else\n compute_program(current_char, index)\n end\n index += 1\n end\n end\n return end_index+1\nend", "def looper \r\n for i in 1..10\r\n puts i\r\n end\r\nend", "def main_loop\n @main_loop ||= lambda do\n # Smoother, but slower: GC.start if rand > 0.98\n next_step\n SUBSTEPS.times do\n move\n targeting\n handle_input\n remove_marked\n step_physics\n end\n end\n end", "def iLoop_Handler(iLoop)\n\tresult = 0\n\texpr = iLoop.elems[0]\n\tif (expression_Handler(expr) != :BOOLEAN)\n\t\tputs \"IND LOOP ERROR: expression must be boolean.\"\n\t\tresult += 1\n\tend\n\tinstr = iLoop.elems[1]\n\tresult += instr_Handler(instr)\n\treturn result\nend", "def iLoop_Handler(iLoop)\n\tresult = 0\n\texpr = iLoop.elems[0]\n\tif (expression_Handler(expr) != :BOOLEAN)\n\t\tputs \"IND LOOP ERROR: expression must be boolean.\"\n\t\tresult += 1\n\tend\n\tinstr = iLoop.elems[1]\n\tresult += instr_Handler(instr)\n\treturn result\nend", "def slow_plus\n 'foo' + 'bar'\nend", "def looper\n for i in 1..10\n puts i\n end\nend", "def basic_loop\n answer = 1\n iterator = 1\n\n until iterator == @exponent do\n answer *= @integer\n iterator += 1 \n end \n\n answer\n end", "def __loopb(&blk)\n codes = yield\n len = (codes.length + 1) * (-1)\n result = codes + [:jmpr, len]\n if result.any? {|e| e.class == UnknownBreak }\n outside = result.length\n result = result.map {|e| e.class == UnknownBreak ? e.to_break(0, outside) : e }\n result.each_with_index {|e, i| e.class == BreakStop ? e.index = i : e }\n result.map! {|e| e.class == BreakStop ? e.to_offset : e }\n end\n result\n end", "def loops\n return @loops if @loops\n @loops = (data['loops']||[]).map { |l| function.blocks.by_name(l).loop }\n end", "def times_loop(clk_e, num, &ruby_block)\n # Compute the width of the counter.\n width = num.respond_to?(:width) ? num.width : num.type.width\n # Declares the counter.\n cnt = [width].inner(HDLRuby.uniq_name)\n # Create the loop.\n return while_loop(clk_e, proc{cnt<=0}, cnt<num) do\n cnt <= cnt + 1\n ruby_block.call\n end\nend", "def myloop\n while true\n yield\n end\nend", "def loop _value, _abs=0\n send_cmd(\"loop #{_value} #{_abs}\")\n end", "def my_loop\n while true\n yield\n end\nend", "def is_loop\n\n false\n end", "def run!\n @running = true\n \n while @running and (@instruction_pointer < @code.length)\n execute!(fetch!)\n # printf(\"\\t:: %d\\t\", @instruction_pointer)\n end\n \n return nil\n end", "def slow_add(x, y)\n sleep 10\n x + y\nend", "def process_loop(loop)\r\n loop.nodes.each do |i|\r\n case i\r\n when X12::Loop then process_loop(i)\r\n when X12::Segment then process_segment(i) unless i.nodes.size > 0\r\n else return\r\n end\r\n end\r\n end", "def for_loop\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n return_value = ForLoopReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal77 = nil\n string_literal83 = nil\n __ID85__ = nil\n __FOR_IN88__ = nil\n __ID90__ = nil\n variable_statement78 = nil\n expression79 = nil\n expression80 = nil\n expression81 = nil\n block82 = nil\n variable_statement84 = nil\n expression86 = nil\n block87 = nil\n variable_statement89 = nil\n expression91 = nil\n block92 = nil\n\n tree_for_string_literal77 = nil\n tree_for_string_literal83 = nil\n tree_for_ID85 = nil\n tree_for_FOR_IN88 = nil\n tree_for_ID90 = nil\n\n begin\n # at line 116:3: ( ^( 'for' ( variable_statement | expression ) expression expression block ) | ^( 'each' ( variable_statement | ID ) expression block ) | ^( FOR_IN ( variable_statement | ID ) expression block ) )\n alt_24 = 3\n case look_24 = @input.peek( 1 )\n when FOR then alt_24 = 1\n when EACH then alt_24 = 2\n when FOR_IN then alt_24 = 3\n else\n raise NoViableAlternative( \"\", 24, 0 )\n end\n case alt_24\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 116:5: ^( 'for' ( variable_statement | expression ) expression expression block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal77 = match( FOR, TOKENS_FOLLOWING_FOR_IN_for_loop_603 )\n\n tree_for_string_literal77 = @adaptor.copy_node( string_literal77 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal77, root_1 )\n\n\n\n match( DOWN, nil )\n # at line 116:15: ( variable_statement | expression )\n alt_21 = 2\n look_21_0 = @input.peek( 1 )\n\n if ( look_21_0 == VAR )\n alt_21 = 1\n elsif ( look_21_0.between?( AMP, AMP_ASGN ) || look_21_0 == POST_DECR || look_21_0.between?( GEQ, AREF ) || look_21_0.between?( GREATER, HAT ) || look_21_0.between?( ARROW, HAT_ASGN ) || look_21_0 == ASGN || look_21_0 == REGEX || look_21_0 == IN || look_21_0 == INCR || look_21_0.between?( INSTANCEOF, RSHIFT3 ) || look_21_0 == RSHIFT3_ASGN || look_21_0 == RSHIFT_ASGN || look_21_0 == LEQ || look_21_0.between?( LESS, SLASH ) || look_21_0 == SLASH_ASGN || look_21_0.between?( STAR, DECR ) || look_21_0 == STAR_ASGN || look_21_0 == LSHIFT || look_21_0.between?( DELETE, THIS ) || look_21_0.between?( MINUS, TILDE ) || look_21_0.between?( MINUS_ASGN, MOD ) || look_21_0.between?( MOD_ASGN, TYPEOF ) || look_21_0.between?( NEQ, UMINUS ) || look_21_0.between?( NEQQ, UNDEFINED ) || look_21_0 == NEW || look_21_0 == NOT || look_21_0.between?( NULL, UPLUS ) || look_21_0 == OBJECT || look_21_0.between?( EQ, OR_ASGN ) || look_21_0 == FALSE || look_21_0 == PIPE || look_21_0 == PIPE_ASGN || look_21_0 == PLUS || look_21_0.between?( ID, DOC ) )\n alt_21 = 2\n else\n raise NoViableAlternative( \"\", 21, 0 )\n end\n case alt_21\n when 1\n # at line 116:17: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_for_loop_608 )\n variable_statement78 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_statement78.tree )\n\n\n when 2\n # at line 116:38: expression\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_612 )\n expression79 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression79.tree )\n\n\n end\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_616 )\n expression80 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression80.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_618 )\n expression81 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression81.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_loop_620 )\n block82 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block82.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 117:5: ^( 'each' ( variable_statement | ID ) expression block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal83 = match( EACH, TOKENS_FOLLOWING_EACH_IN_for_loop_630 )\n\n tree_for_string_literal83 = @adaptor.copy_node( string_literal83 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal83, root_1 )\n\n\n\n match( DOWN, nil )\n # at line 117:15: ( variable_statement | ID )\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0 == VAR )\n alt_22 = 1\n elsif ( look_22_0 == ID )\n alt_22 = 2\n else\n raise NoViableAlternative( \"\", 22, 0 )\n end\n case alt_22\n when 1\n # at line 117:17: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_for_loop_634 )\n variable_statement84 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_statement84.tree )\n\n\n when 2\n # at line 117:38: ID\n _last = @input.look\n __ID85__ = match( ID, TOKENS_FOLLOWING_ID_IN_for_loop_638 )\n\n tree_for_ID85 = @adaptor.copy_node( __ID85__ )\n\n @adaptor.add_child( root_1, tree_for_ID85 )\n\n\n\n end\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_642 )\n expression86 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression86.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_loop_644 )\n block87 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block87.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 118:5: ^( FOR_IN ( variable_statement | ID ) expression block )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n __FOR_IN88__ = match( FOR_IN, TOKENS_FOLLOWING_FOR_IN_IN_for_loop_654 )\n\n tree_for_FOR_IN88 = @adaptor.copy_node( __FOR_IN88__ )\n\n root_1 = @adaptor.become_root( tree_for_FOR_IN88, root_1 )\n\n\n\n match( DOWN, nil )\n # at line 118:15: ( variable_statement | ID )\n alt_23 = 2\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0 == VAR )\n alt_23 = 1\n elsif ( look_23_0 == ID )\n alt_23 = 2\n else\n raise NoViableAlternative( \"\", 23, 0 )\n end\n case alt_23\n when 1\n # at line 118:17: variable_statement\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_statement_IN_for_loop_658 )\n variable_statement89 = variable_statement\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_statement89.tree )\n\n\n when 2\n # at line 118:38: ID\n _last = @input.look\n __ID90__ = match( ID, TOKENS_FOLLOWING_ID_IN_for_loop_662 )\n\n tree_for_ID90 = @adaptor.copy_node( __ID90__ )\n\n @adaptor.add_child( root_1, tree_for_ID90 )\n\n\n\n end\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_for_loop_666 )\n expression91 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression91.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_block_IN_for_loop_668 )\n block92 = block\n @state.following.pop\n\n @adaptor.add_child( root_1, block92.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\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__, 21 )\n\n end\n \n return return_value\n end", "def loop_vectors(name = nil, number_of_loops = 1, _global = false)\n # The name argument is present to maych J750 API, sort out the\n unless name.is_a?(String) || name.is_a?(Symbol)\n name, number_of_loops, global = 'loop', name, number_of_loops\n end\n if number_of_loops > 1\n @loop_counters ||= {}\n if @loop_counters[name]\n @loop_counters[name] += 1\n else\n @loop_counters[name] = 0\n end\n loop_name = @loop_counters[name] == 0 ? name : \"#{name}_#{@loop_counters[name]}\"\n loop_name = loop_name.symbolize\n microcode \"#{loop_name}: Loop #{number_of_loops} {\"\n yield\n microcode '}'\n else\n yield\n end\n end", "def next_instruction()\n opcode = (@memory[@instruction_ptr] << 8) + @memory[@instruction_ptr+1]\n\n if opcode == 0\n kill_program()\n end\n\n do_instruction(opcode)\n @instruction_ptr += 2\n end", "def loop &block\n _loop ::Dnet, :fw_loop, Rule, &block\n end", "def add\n match \"+\"\n comment \"+\"\n term\n emitln \"addl -(0x8*#{$stackdepth})(%rsp), %eax\"\nend", "def step\n instcode = @memory[@ip]\n raise \"nil opcode encountered\" if instcode.nil?\n\n opcode = instcode % 100\n argcount = ARGCOUNT[opcode] || 0\n addressing_modes = argcount.times.map { |ix| (instcode / (10 ** (ix + 2))) % 10 }\n args = addressing_modes.each_with_index.map do |am, ix|\n raw_arg = @memory[@ip + ix + 1]\n translate_arg(opcode, ix, raw_arg, am)\n end\n\n if TRACE\n STDERR.puts \"#{@id} @ip=#{@ip} @base=#{@base} inst=#{@memory[@ip..@ip+argcount].inspect} opcode=#{opcode} am=#{addressing_modes.inspect} args=#{args.inspect}\"\n end\n\n jump_target = nil\n case opcode\n when 1 # add\n @memory[args[2]] = args[0] + args[1]\n when 2 # mul\n @memory[args[2]] = args[0] * args[1]\n when 3 # in\n if @inputs.any?\n @memory[args[0]] = @inputs.shift\n else\n return :need_input\n end\n when 4 # out\n @outputs << args[0]\n when 5 # jnz\n jump_target = args[1] if args[0] != 0\n when 6 # jz\n jump_target = args[1] if args[0] == 0\n when 7 # lt\n @memory[args[2]] = (args[0] < args[1]) ? 1 : 0\n when 8 # eq\n @memory[args[2]] = (args[0] == args[1]) ? 1 : 0\n when 9 #base\n @base += args[0]\n when 99\n return nil\n else\n raise \"invalid opcode #{opcode} at position #{@ip}\"\n end\n\n if jump_target\n @ip = jump_target\n else\n @ip += argcount + 1\n end\n end", "def step\n instcode = @memory[@ip]\n raise \"nil opcode encountered\" if instcode.nil?\n\n opcode = instcode % 100\n arg0imm = (instcode / 100) % 10 == 1\n arg1imm = (instcode / 1000) % 10 == 1\n\n argcount = ARGCOUNT[opcode] || 0\n args = @memory[@ip + 1..@ip + argcount]\n arg0 = (arg0imm ? args[0] : @memory[args[0]]) if argcount >= 1\n arg1 = (arg1imm ? args[1] : @memory[args[1]]) if argcount >= 2\n\n jump_target = nil\n case opcode\n when 1 # add\n @memory[args[2]] = arg0 + arg1\n when 2 # mul\n @memory[args[2]] = arg0 * arg1\n when 3 # in\n raise \"input past end\" unless @inputs.any?\n @memory[args[0]] = @inputs.shift\n when 4 # out\n @outputs << arg0\n when 5 # jnz\n jump_target = arg1 if arg0 != 0\n when 6 # jz\n jump_target = arg1 if arg0 == 0\n when 7 # lt\n @memory[args[2]] = (arg0 < arg1) ? 1 : 0\n when 8 # eq\n @memory[args[2]] = (arg0 == arg1) ? 1 : 0\n when 99\n return nil\n else\n raise \"invalid opcode #{opcode} at position #{@ip}\"\n end\n\n if jump_target\n @ip = jump_target\n else\n @ip += argcount + 1\n end\n end", "def looper\r\n for i in 1..10\r\n puts i #wrong method puts.\r\nend #wrong position of end word.\r\nend", "def yo_dawg(num)\n n.times do\n n.times do\n puts \"I put a loop in your loop so you can loop while you loop.\"\n end\n end\nend", "def run\n while 1\n if step == 1 then break end\n end\n end", "def SimpleAdding(num)\nsum=0\n 1.upto(num) do |x|\n\tsum+=x\n\tend\n\t\nreturn sum\nend", "def postloop\n end", "def add_up(i)\r\n sum = 0\r\n for a in 1..i do \r\n sum = sum + a\r\n end\r\n\r\n puts sum \r\n\r\nend", "def loop\n assert(\"Block#loop: not a loop header\") { self.loopheader? }\n return @loop if @loop\n @loop = Loop.new(self)\n end", "def looper\n for i in 1..10\n return i\n end\nend", "def SimpleAdding(num)\n sum = 0\n (1..num).each do |number|\n sum += number\n end\n sum\nend", "def method_return_from_loop\n (1..10).each do |n|\n if n == 5\n return 5 * 5\n end\n end\n nil\n end", "def foreverize\n loop do\n run\n end\n end", "def run(memory)\n pointer = 0\n\n loop do\n opcode = memory[pointer]\n break if opcode == HALT\n\n command = INSTRUCTIONS[opcode]\n\n parameters = memory.slice((pointer + 1)..(pointer + command.arity - 1))\n command.call(memory, *parameters)\n pointer += command.arity\n\n # p memory; readline\n end\n\n memory\nend", "def execute_LOOPNE(operand) # Same as the LOOPNZ instruction\n\t\tcondition = perform_counting_loop.zero? && @flags[ZERO_FLAG] == 1\n\t\tjump_conditionally_to_signed_displacement(operand, condition)\n\tend", "def do_something\n 10000.times { \"cat\" }\n end", "def while(&block)\n\t\t\t\t\trepeat &block\n\t\t\t\tend", "def L\n 3.times { R() }\n end", "def check_for_infinite_loop(processed_source, offenses_by_iteration); end", "def looping_type\n ExtendedModule::Helpers.sample_looping_type(type)\n end", "def setup_loop\n return TSBS.error(@acts[0], 2, @used_sequence) if @acts.size < 3\n count = @acts[1]\n action_key = @acts[2]\n is_string = action_key.is_a?(String)\n count.times do\n if is_string\n @acts = [:action, action_key]\n execute_sequence\n break if @break_action\n else\n begin\n action_key.each do |action|\n @acts = action\n execute_sequence\n break if @break_action\n end\n rescue\n ErrorSound.play\n text = \"Wrong [:loop] parameter!\"\n msgbox text\n exit\n end\n end\n break if @break_action\n end\n end", "def modify_while\n x = 0\n puts x += 1 while x<10\nend", "def say_hello\n p \"hello\"\n # say_hello # an infinite loop\nend", "def testloop\n \n end", "def increment(start, inc)\n\t\t\t\tProc.new{start +=inc}\nend", "def expand_loop\r\n raise \"no examples found for loop start on line #{@loop_start_ln}\" unless @loop_examples.size > 0\r\n loop_n = 0\r\n @loop_examples.each do |exa|\r\n loop_n += 1\r\n vars = YAML.load(exa)\r\n # erubie the template\r\n rslt = Erubis::Eruby.new(@loop_template).result(vars)\r\n li = 0\r\n rslt.split(\"\\n\").each do |line|\r\n li += 1\r\n self.process_line line, @loop_start_ln + li, loop_n\r\n end\r\n end\r\n \r\n # clear up holders\r\n self.reset_loop\r\n end", "def generateLoop2\n for i in 1...10 do #do optional\n puts i\n end\n end", "def accelerate(increment, seconds)\n fail 'Engine Off Error' unless engine_on\n\n seconds.times do\n break if speed >= top_speed\n @speed += increment\n end\n end", "def cycle_execute\n ip = @registers[:ip]\n instructionRaw = @rom.read(ip.bdata.snapshot * 1)\n\n # Read it properly! :D\n instruction = Patchy::CPU::Instruction.new(\n opcode: instructionRaw & 0xFF,\n dest: (instructionRaw >> 8) & 0xF,\n src: (instructionRaw >> 12) & 0xF,\n immediate: instructionRaw >> 16\n )\n\n if @debug\n puts \"Exec [#{@cycles}] #{gen_debug_instruction_string(instruction)}\"\n end\n\n case instruction.opcode\n when 0x00 then exec_op_noop(instruction)\n when 0x01 then exec_op_mv(instruction)\n when 0x02 then exec_op_ldi(instruction)\n when 0x03 then exec_op_ldm(instruction)\n when 0x04 then exec_op_lpx(instruction)\n when 0x05 then exec_op_spx(instruction)\n when 0x06 then exec_op_str(instruction)\n when 0x07 then exec_op_push(instruction)\n when 0x08 then exec_op_pop(instruction)\n when 0x09 then exec_op_add(instruction)\n when 0x0A then exec_op_addi(instruction)\n when 0x0B then exec_op_sub(instruction)\n when 0x0C then exec_op_subi(instruction)\n when 0x0D then exec_op_cmp(instruction)\n when 0x0E then exec_op_and(instruction)\n when 0x0F then exec_op_or(instruction)\n when 0x10 then exec_op_xor(instruction)\n when 0x11 then exec_op_shl(instruction)\n when 0x12 then exec_op_shr(instruction)\n when 0x13 then exec_op_jmp(instruction)\n when 0x14 then exec_op_je(instruction)\n when 0x15 then exec_op_jne(instruction)\n when 0x16 then exec_op_jg(instruction)\n when 0x17 then exec_op_jge(instruction)\n when 0x18 then exec_op_jl(instruction)\n when 0x19 then exec_op_jle(instruction)\n when 0x1A then exec_op_jz(instruction)\n when 0x1B then exec_op_jnz(instruction)\n when 0x1C then exec_op_call(instruction)\n when 0x1D then exec_op_calli(instruction)\n when 0x1E then exec_op_ret(instruction)\n when 0xFF then exec_op_hlt(instruction)\n end\n\n # Increase cycles now, so our halt message shows the true count if neeed\n inc_cycles\n\n halt if @needs_halt\n inc_ip if !@halt\n end", "def keep_looping?\n true\n end", "def expand_loop\r\n raise \"no examples found for loop start on line #{@loop_start_ln}\" unless @loop_examples.size > 0\r\n loop_n = 0\r\n @loop_examples.each do |exa|\r\n loop_n += 1\r\n # treat each loop example as a yaml var definition for the template\r\n rslt = Erubis::Eruby.new(@loop_template).result(YAML.load(exa))\r\n li = 0\r\n rslt.split(\"\\n\").each do |line|\r\n li += 1\r\n self.process_line @loop_start_ln + li, line\r\n end\r\n end\r\n \r\n # clear up holders\r\n self.reset_loop\r\n end", "def expression\n if is_addop @look\n emit_ln 'CLR D0'\n else\n term\n end\n while is_addop @look\n emit_ln 'MOVE D0, -(SP)' \n case @look\n when '+': add\n when '-': subtract\n else expected('Addop')\n end\n end\nend", "def run\n @running = true\n begin\n while running?\n self.ir = decode(ram.read(self.pc))\n self.pc += 1\n exec(ir[0], ir[1])\n end\n end \n end", "def repeatHello()\n counter = 1\n while counter <= 5\n puts \"hello\"\n counter += 1\n end\nend", "def scope_loop\n\t1.upto(5) do |i|\n\t\tputs \"the variable is #{i}\"\n\tend\n\nend", "def run_run_loop time = 1\n NSRunLoop.currentRunLoop.runUntilDate (Time.now + time)\nend", "def game_loop\n end", "def scope_loop\nend", "def loop &block\n _loop ::Dnet, :route_loop, Entry, &block\n end", "def while_loop(clk_e, init, condition = nil, &ruby_block)\n # Create the loop task.\n tsk = while_task(clk_e,init,condition,ruby_block).(HDLRuby.uniq_name)\n # Create the inner access port.\n prt = tsk.inner HDLRuby.uniq_name\n # Return the access port.\n return prt\nend", "def simple_adding (num)\n the_sum = 0\n i = 0\n while i <= num do\n puts the_sum += i\n i += 1\n end\n return the_sum\nend", "def SimpleAdding(num)\n\ti = 0\n\ttotal = 0\n\twhile i <= num\n\t\ttotal += i\n\t\ti += 1\n\tend\n\tprint total\nend", "def event_loop\n\t @last_stop_count = 0\n\t @cycle_start = Time.now\n\t @cycle_index = 0\n\n\t gc_enable_has_argument = begin\n\t\t\t\t\t GC.enable(true)\n\t\t\t\t\t true\n\t\t\t\t rescue\n Application.info \"GC.enable does not accept an argument. GC will not be controlled by Roby\"\n false\n\t\t\t\t end\n\t stats = Hash.new\n\t if ObjectSpace.respond_to?(:live_objects)\n\t\tlast_allocated_objects = ObjectSpace.allocated_objects\n\t end\n last_cpu_time = Process.times\n last_cpu_time = (last_cpu_time.utime + last_cpu_time.stime) * 1000\n\n\t GC.start\n\t if gc_enable_has_argument\n\t\talready_disabled_gc = GC.disable\n\t end\n\t loop do\n\t\tbegin\n\t\t if quitting?\n\t\t\tthread.priority = 0\n\t\t\tbegin\n\t\t\t return if forced_exit? || !clear\n\t\t\trescue Exception => e\n\t\t\t ExecutionEngine.warn \"Execution thread failed to clean up\"\n Roby.format_exception(e).each do |line|\n ExecutionEngine.warn line\n end\n\t\t\t return\n\t\t\tend\n\t\t end\n\n\t\t while Time.now > cycle_start + cycle_length\n\t\t\t@cycle_start += cycle_length\n\t\t\t@cycle_index += 1\n\t\t end\n stats[:start] = cycle_start\n\t\t stats[:cycle_index] = cycle_index\n\n Roby.synchronize do\n process_events(stats) \n end\n\n @remaining_cycle_time = cycle_length - stats[:end]\n\t\t \n\t\t # If the ruby interpreter we run on offers a true/false argument to\n\t\t # GC.enable, we disabled the GC and just run GC.enable(true) to make\n\t\t # it run immediately if needed. Then, we re-disable it just after.\n\t\t if gc_enable_has_argument && remaining_cycle_time > SLEEP_MIN_TIME\n\t\t\tGC.enable(true)\n\t\t\tGC.disable\n\t\t end\n\t\t add_timepoint(stats, :ruby_gc)\n\n\t\t # Sleep if there is enough time for it\n\t\t if remaining_cycle_time > SLEEP_MIN_TIME\n\t\t\tadd_expected_duration(stats, :sleep, remaining_cycle_time)\n\t\t\tsleep(remaining_cycle_time) \n\t\t end\n\t\t add_timepoint(stats, :sleep)\n\n\t\t # Add some statistics and call cycle_end\n\t\t if defined? Roby::Log\n\t\t\tstats[:log_queue_size] = Roby::Log.logged_events.size\n\t\t end\n\t\t stats[:plan_task_count] = plan.known_tasks.size\n\t\t stats[:plan_event_count] = plan.free_events.size\n\t\t cpu_time = Process.times\n cpu_time = (cpu_time.utime + cpu_time.stime) * 1000\n\t\t stats[:cpu_time] = cpu_time - last_cpu_time\n last_cpu_time = cpu_time\n\n\t\t if ObjectSpace.respond_to?(:live_objects)\n\t\t\tstats[:object_allocation] = ObjectSpace.allocated_objects - last_allocated_objects\n stats[:live_objects] = ObjectSpace.live_objects\n last_allocated_objects = ObjectSpace.allocated_objects\n\t\t end\n if ObjectSpace.respond_to?(:heap_slots)\n stats[:heap_slots] = ObjectSpace.heap_slots\n end\n\n\t\t stats[:start] = [cycle_start.tv_sec, cycle_start.tv_usec]\n stats[:state] = Roby::State\n Roby.synchronize do\n cycle_end(stats)\n end\n stats = Hash.new\n\n\t\t @cycle_start += cycle_length\n\t\t @cycle_index += 1\n\n\t\trescue Exception => e\n if !quitting?\n quit\n\n ExecutionEngine.fatal \"Execution thread quitting because of unhandled exception\"\n Roby.display_exception(ExecutionEngine.logger.io(:fatal), e)\n elsif !e.kind_of?(Interrupt)\n ExecutionEngine.fatal \"Execution thread FORCEFULLY quitting because of unhandled exception\"\n Roby.display_exception(ExecutionEngine.logger.io(:fatal), e)\n raise\n end\n\t\tend\n\t end\n\n\tensure\n\t GC.enable if !already_disabled_gc\n\n\t if !plan.known_tasks.empty?\n\t\tExecutionEngine.warn \"the following tasks are still present in the plan:\"\n\t\tplan.known_tasks.each do |t|\n\t\t ExecutionEngine.warn \" #{t}\"\n\t\tend\n\t end\n\tend", "def cartman_hates(thing)\n while true\n puts \"What's there to hate about #{thing}?\"\nend; end", "def serialize_inst_loop bytes, instr\n\t\t\tserialize_blocktype bytes, instr.blocktype\n\t\t\tinstr.instructions.each do |i|\n\t\t\t\tserialize_instruction bytes, i\n\t\t\tend\n\t\t\tbytes.push OP_BLOCK_END\n\t\tend", "def loadcpu3( num1, num2 )\n c_mul_add_add_loop(1000000, num1, num2)\nend", "def game_loop\n end", "def runtime; end", "def opn_while\n -> do\n if mem[dp].zero?\n @ff += 1\n elsif @call_stack.last != ip\n @call_stack.push(ip)\n end\n end\n end", "def loop_test\n fibonacci = Fibonacci.new\n fibonacci.get_via_loop(TEST_VALUE)\n end", "def next_instruction\n inst = @program[@current_inst]\n @current_inst += 1\n inst\n end", "def current_cycle(name = T.unsafe(nil)); end", "def continue\n\n # FIXME: with the ruby-supported stepping, we might not\n # need the below any more.\n # I'm guessing the stack size can't ever reach this\n @next_level = 32000\n\n @next_thread = nil\n if @settings[:traceprint]\n @core.step_count = 1 # traceprint will avoid stopping\n else\n @core.step_count = -1 # No more event stepping\n end\n @leave_cmd_loop = true # Break out of the processor command loop.\n end", "def run\n while !@halted && !@needs_input && @pc < mem.size\n opcode, params = Opcode.get_opcode_and_params(self, pc)\n if opcode == nil\n end\n\n Intcode.log(\"%5i %05i: %s\" % [pc, mem[pc], opcode.debug(self, params)])\n opcode.exec(self, params)\n end\n\n if @halted\n return :halted\n elsif @needs_input\n return :needs_input\n elsif @pc >= mem.size\n return :pc_range_err\n end\n end", "def d(ruby_str)\n puts RubyVM::InstructionSequence.new(ruby_str).disasm\nend", "def add\r\n node = mul()\r\n\r\n loop do\r\n if consume(\"+\")\r\n node = new_binary(ND_ADD, node, mul())\r\n elsif consume(\"-\")\r\n node = new_binary(ND_SUB, node, mul())\r\n else\r\n return node\r\n end\r\n end\r\nend", "def repeatHello(n)\n i = 0\n while i < n\n puts 'hello'\n i += 1\n end\nend" ]
[ "0.6558414", "0.63045776", "0.61335677", "0.61002433", "0.5985722", "0.59512186", "0.5949716", "0.5918068", "0.5918068", "0.5800301", "0.5762464", "0.57480127", "0.5734648", "0.57213163", "0.57209873", "0.5666757", "0.5648005", "0.56174916", "0.5610652", "0.5610652", "0.5593509", "0.55809486", "0.5573024", "0.55516505", "0.55516505", "0.5506892", "0.55054164", "0.5471359", "0.5438597", "0.5434465", "0.5424928", "0.5393662", "0.5390827", "0.5344836", "0.5323084", "0.53101516", "0.5299234", "0.5258199", "0.5252753", "0.52424896", "0.523776", "0.52370995", "0.5232031", "0.52165097", "0.52101743", "0.52068174", "0.52049565", "0.52041405", "0.52028", "0.51968515", "0.5188257", "0.5186437", "0.5181037", "0.5179571", "0.5168463", "0.5167743", "0.5155941", "0.51518106", "0.51511645", "0.5147004", "0.51398456", "0.51374304", "0.51361924", "0.5122111", "0.5110061", "0.5109655", "0.5103079", "0.50949544", "0.5090742", "0.50886816", "0.50864094", "0.5081718", "0.5065895", "0.5061316", "0.50604653", "0.50603944", "0.5058516", "0.50577617", "0.50482756", "0.50456804", "0.50378865", "0.50372714", "0.5036561", "0.5028718", "0.5024288", "0.5018264", "0.5015482", "0.50107515", "0.5009616", "0.50083417", "0.5003326", "0.49964362", "0.49901223", "0.4988644", "0.49866772", "0.4984582", "0.49800754", "0.49698937", "0.49647808", "0.49629173" ]
0.49930918
92
Gets the callee property value. Endpoint that answered this segment.
def callee return @callee end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callee_number\n return @callee_number\n end", "def outgoing_value\n @attrs[\"outgoing\"]\n end", "def ref\n @messaging['optin']['ref']\n end", "def callee=(value)\n @callee = value\n end", "def endpoint\n data[:endpoint]\n end", "def endpoint\n data[:endpoint]\n end", "def callee_number=(value)\n @callee_number = value\n end", "def route\n return @children['route'][:value]\n end", "def caller_number\n return @caller_number\n end", "def callee\n @method\n end", "def user_ref\n @messaging['optin']['user_ref']\n end", "def end_point; get(end_param) end", "def receiver\n chain = @call.receiver_chain\n last = chain[-1]\n last.nil? ? chain[-2] : last\n end", "def value\n @method.call\n end", "def recipient\n return @recipient\n end", "def recipient\n return @recipient\n end", "def caller\n return @caller\n end", "def caller\n return @caller\n end", "def call_id\n return @call_id\n end", "def endpoint(value = nil)\n if value\n @endpoint = value\n else\n @endpoint\n end\n end", "def endpoint(value = nil)\n @endpoint = value if value\n\n return @endpoint if @endpoint\n\n superclass.respond_to?(:endpoint) ? superclass.endpoint : nil\n end", "def addr\n @addr ||= @stream.connection.socket.peeraddr[3] rescue nil\n end", "def peeraddr\n @socket.peeraddr\n end", "def value\n data[ address ]\n end", "def get\n @value\n end", "def referer\n @request[FREFERER]\n end", "def value\n \t@calc_stack[-1]\n end", "def value\n @value ||= rule.block ? rule.block.call(self) : to_s\n end", "def listener_endpoint\n data[:listener_endpoint]\n end", "def get_value_with_method_name(method_name)\n get_contact_detail_value(hash_from_method_name(method_name))\n end", "def line\n return 0 unless self.method\n # We subtract 1 because the ip is actually set to what it should do\n # next, not what it's currently doing (unless we are at the start of\n # a new context).\n if self.from_eval? and self.env.caller_env\n ip = self.env.caller_env.registration_ip - 1\n else\n ip = self.ip - 1\n ip = 0 if ip < 0\n end\n self.method.line_from_ip(ip)\n end", "def getEndPoint()\n geoObject().lastPoint() ;\n end", "def member\n return @member\n end", "def sender\n @payload[:sender]\n end", "def value\n @property_hash[:value]\n end", "def eoutvar\n self\n end", "def get_value\n @get_value_handler.call\n end", "def value\n data[1]\n end", "def info\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def return_value\n @return_value\n end", "def endpoint\n @endpoint ||= begin\n if self.endpoint_type && self.endpoint_id\n self.endpoint_type.constantize.find_by_id(self.endpoint_id)\n elsif self.route && self.route.mode == 'Endpoint'\n self.route.endpoint\n end\n end\n end", "def endpoint\n @endpoint ||= begin\n if self.endpoint_type && self.endpoint_id\n self.endpoint_type.constantize.find_by_id(self.endpoint_id)\n elsif self.route && self.route.mode == 'Endpoint'\n self.route.endpoint\n end\n end\n end", "def value\n case @value\n when Proc\n @value.call\n else\n @value\n end\n end", "def caller=(value)\n @caller = value\n end", "def caller=(value)\n @caller = value\n end", "def peeraddr\n\t\tif self.instance_of?(UNIXServer) \n\t\t\traise Errno::ENOTCONN, \"Transport endpoint is not connected - getpeername(2)\", caller\n\t\telse\n\t\t\t[@af,@path]\n\t\tend\n\tend", "def office_fax_number\n self.dig_for_string(\"agentSummary\", \"office\", \"faxNumber\")\n end", "def receiver(sexp)\n if call_site?(sexp)\n sexp[1]\n end\n end", "def value()\n \t\t@stack.last\n end", "def upper_address\n return @upper_address\n end", "def business_phone\n self.dig_for_string(\"agentSummary\", \"businessPhone\")\n end", "def address\n read_attribute(:value)\n end", "def get_value\n send_request(FUNCTION_GET_VALUE, [], '', 2, 'S')\n end", "def recipient_email\n return @recipient_email\n end", "def recipient_email\n return @recipient_email\n end", "def getvalue\n raise \"getvalue in eventhandler. remove if does not happen in 2018\"\n source.getvalue\n end", "def variable(node)\n while %i[call field method_add_arg method_add_block].include?(node.receiver.sexp_type)\n node = node.receiver\n end\n return if %i[fcall hash].include?(node.receiver.sexp_type)\n\n node.receiver\n end", "def get_Email()\n \t return @outputs[\"Email\"]\n \tend", "def office_email_address\n self.dig_for_string(\"agentSummary\", \"office\", \"emailAddress\")\n end", "def sender\n @payload['sender']\n end", "def method_property\n @method_property\n end", "def call_number\n call['dispCallNumber'] || fields['dispCallNumber']\n end", "def address\n return @address\n end", "def address\n return @address\n end", "def caller_number=(value)\n @caller_number = value\n end", "def get_endpoint()\n end", "def endpoint_name\n self.class.endpoint_name\n end", "def value\n return @value\n end", "def value\n return @value\n end", "def value\n return @value\n end", "def get_caller\n caller[1].split(\":\")[0]\n end", "def get_value\n @value\n end", "def value\n self[@name]\n end", "def value\n $stderr.puts \"WARNING, you probably don't want to read value, if you do, please use #raw_value. Called from: #{caller.first}\"\n raw_value\n end", "def office_address\n self.dig_for_hash(\"agentSummary\", \"office\", \"officeAddress\")\n end", "def manifest_property\n manifest[name_of(caller)]\n end", "def email_address\n @data['emailAddress']\n end", "def handle_getaddr\n @node.connections.sample.send_getaddr\n {:state => \"Sending getaddr...\"}\n end", "def get_CallbackID()\n \t return @outputs[\"CallbackID\"]\n \tend", "def get_CallbackID()\n \t return @outputs[\"CallbackID\"]\n \tend", "def get_CallbackID()\n \t return @outputs[\"CallbackID\"]\n \tend", "def get_CallbackID()\n \t return @outputs[\"CallbackID\"]\n \tend", "def get_CallbackID()\n \t return @outputs[\"CallbackID\"]\n \tend", "def get_UserID()\n \t return @outputs[\"UserID\"]\n \tend", "def get_WOEID()\n \t return @outputs[\"WOEID\"]\n \tend", "def get_WOEID()\n \t return @outputs[\"WOEID\"]\n \tend", "def contact_phone\n self.contact[:contact_phone]\n end", "def get_peeraddr\n Socket.unpack_sockaddr_in(get_peername).reverse\n end", "def value\n @value ||= @block.call\n end", "def peer_ip\n peername[0]\n end", "def value\n self['value']\n end", "def get_URI()\n \t return @outputs[\"URI\"]\n \tend", "def get_URI()\n \t return @outputs[\"URI\"]\n \tend", "def get_URI()\n \t return @outputs[\"URI\"]\n \tend", "def get_URI()\n \t return @outputs[\"URI\"]\n \tend", "def property\n @property\n end", "def profile\n @property[:profile]\n end", "def callerid_name\n @callerid_name ||= @callerid.gsub(/(.*)\\s*\\<.*\\>/, '\\1').strip\n end", "def email_address\n self.dig_for_string(\"agentSummary\", \"emailAddress\")\n end", "def value\n record.send(name).value\n end" ]
[ "0.65004194", "0.6003591", "0.58587825", "0.5806105", "0.5760108", "0.5760108", "0.57471466", "0.5636676", "0.5607761", "0.5594807", "0.5541302", "0.5511753", "0.54547656", "0.5419744", "0.5333241", "0.5323504", "0.53224605", "0.53224605", "0.52929014", "0.52490246", "0.52383006", "0.52038795", "0.51966107", "0.51700115", "0.51456046", "0.5128264", "0.5119468", "0.51034236", "0.5086635", "0.5083108", "0.5067714", "0.506614", "0.5058625", "0.5055243", "0.5053424", "0.50471145", "0.50434697", "0.50385714", "0.503656", "0.50288606", "0.5014082", "0.5014082", "0.50049", "0.5003557", "0.5003557", "0.4986381", "0.49806932", "0.49792945", "0.49790406", "0.49636284", "0.49615726", "0.49613467", "0.49509794", "0.49501255", "0.49501255", "0.4948671", "0.49485567", "0.4948431", "0.494783", "0.49455693", "0.49353296", "0.492797", "0.49230665", "0.49230665", "0.49196598", "0.49088287", "0.48961926", "0.48937345", "0.48937345", "0.48937345", "0.4893062", "0.48914272", "0.48857006", "0.48797783", "0.48766765", "0.4873237", "0.48721746", "0.4868367", "0.48667502", "0.48667502", "0.48667502", "0.48667502", "0.48659477", "0.48622832", "0.48599705", "0.48599705", "0.48558733", "0.48548287", "0.4852729", "0.484919", "0.48488435", "0.4846012", "0.4846012", "0.4846012", "0.4846012", "0.48435682", "0.4841054", "0.4839258", "0.4833385", "0.48323447" ]
0.6532976
0
Sets the callee property value. Endpoint that answered this segment.
def callee=(value) @callee = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callee_number=(value)\n @callee_number = value\n end", "def caller=(value)\n @caller = value\n end", "def caller=(value)\n @caller = value\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def caller_number=(value)\n @caller_number = value\n end", "def set_caller\n @caller = Caller.find(params[:id])\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set(value)\n # Set a name for looking up associated options like the event.\n name = self.class.value_name(value)\n\n call = self.class.value_option(name, :call) || :none\n\n if call == :instead\n call_valuemethod(name, value)\n elsif call == :none\n # They haven't provided a block, and our parent does not have\n # a provider, so we have no idea how to handle this.\n self.fail \"#{self.class.name} cannot handle values of type #{value.inspect}\" unless @resource.provider\n call_provider(value)\n else\n # LAK:NOTE 20081031 This is a change in behaviour -- you could\n # previously specify :call => [;before|:after], which would call\n # the setter *in addition to* the block. I'm convinced this\n # was never used, and it makes things unecessarily complicated.\n # If you want to specify a block and still call the setter, then\n # do so in the block.\n devfail \"Cannot use obsolete :call value '#{call}' for property '#{self.class.name}'\"\n end\n end", "def call_routes=(value)\n @call_routes = value\n end", "def callee\n return @callee\n end", "def call_back_url=(value)\n @children['call-back-url'][:value] = value\n end", "def endpoint(value = nil)\n if value\n @endpoint = value\n else\n @endpoint\n end\n end", "def set_Receiver(value)\n set_input(\"Receiver\", value)\n end", "def set_Receiver(value)\n set_input(\"Receiver\", value)\n end", "def callee_number\n return @callee_number\n end", "def set_endpoint\n @endpoint = Endpoint.find params[:id]\n end", "def call_id=(value)\n @call_id = value\n end", "def fax_set(number)\n self.fax.set number\n end", "def call_options=(value)\n @call_options = value\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def endpoint(endpoint)\n @endpoint = endpoint\n self\n end", "def set_recipient\n end", "def set_phone_call\n @phone_call = PhoneCall.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call_your_friend\n @call_your_friend = CallYourFriend.find(params[:id])\n end", "def set_endpoint\n @endpoint = Endpoint.find(params[:id])\n end", "def set_endpoint\n @endpoint = Endpoint.find(params[:id])\n end", "def forward_to=(value)\n @forward_to = value\n end", "def set_port_of_call\n @port_of_call = PortOfCall.find(params[:id])\n end", "def call_chain_id=(value)\n @call_chain_id = value\n end", "def call_chain_id=(value)\n @call_chain_id = value\n end", "def set_friendship\n end", "def newCall\n if params.has_key?([:callerName])\n callerName = params[:callerName]\n session[:value] = [params[:callerName]]\n end\n end", "def set_referrer\n @referrer = Referrer.find(params[:id])\n end", "def recipient=(value)\n @recipient = value\n end", "def set_call_detail\n @call_detail = CallDetail.find(params[:id])\n end", "def set_call_request\n @call_request = CallRequest.find(params[:id])\n end", "def call_end_sub_reason=(value)\n @call_end_sub_reason = value\n end", "def recipient=(value)\n @recipient = value\n end", "def addr= addr\n\t\t\t@addr = addr\n\t\t\t@verified = false\n\t\t\t@request_queue.addr = addr\n\t\tend", "def on_call_property_void(node)\n node.update(:call_property)\n end", "def endpoint=(_arg0); end", "def set(receiver, value)\n receiver.send(writer, value)\n end", "def set_to(value)\n @native.set_current_value(value)\n end", "def setpoint\n @setpoint\n end", "def set_call_to_action\n @call_to_action = CallToAction.find(params[:id])\n end", "def endpoint= new_endpoint\n @grpc.push_endpoint = String new_endpoint\n end", "def set_calldetail\n @calldetail = Calldetail.find(params[:id])\n end", "def reply_to=(value)\n @reply_to = value\n end", "def set_family_member\n end", "def reply_to=( val )\n header[:reply_to] = val\n end", "def sent_to_me=(value)\n @sent_to_me = value\n end", "def sender=(value)\n @sender = value\n end", "def sender=(value)\n @sender = value\n end", "def set_caller_params\n end", "def set_address\n end", "def endpoint=(endpoint)\n if endpoint.end_with?('/')\n @endpoint = endpoint\n else\n @endpoint = \"#{endpoint}/\"\n end\n end", "def set_endpoint(endpoint)\n @client.instance_variable_set(\"@endpoint\", endpoint)\n end", "def reply_to(value = nil)\n if value.nil?\n @reply_to\n else\n @reply_to = value\n end\n end", "def set_help_call_answer\n @help_call_answer = HelpCallAnswer.find(params[:id])\n end", "def successful_call=(value)\n @successful_call = value\n end", "def set_roll_call_answer\n @roll_call_answer = RollCallAnswer.find(params[:id])\n end", "def on_exception=(value)\n raise TypeError, 'on_exception must be a Proc or respond to #call' unless value.is_a?(Proc) || value.respond_to?(:call)\n \n @on_exception = value\n end", "def set_outgoing\n @outgoing = Outgoing.find(params[:id])\n end", "def set_outgoing\n @outgoing = Outgoing.find(params[:id])\n end", "def management_console_endpoint=(value)\n reset_agent\n @management_console_endpoint = value\n end", "def incoming_context=(value)\n @incoming_context = value\n end", "def update\n @caller = Caller.find(params[:id])\n \n respond_to do |format|\n if @caller.update_attributes(params[:caller])\n format.html { redirect_to @caller, notice: 'Caller was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caller.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_elder_member\n @elder_member = ElderMember.find(params[:id])\n end", "def sender=(cm)\n Ruby.primitive :sendsite_set_sender\n raise PrimitiveFailure, \"primitive failed\"\n end", "def set_caller_id(idSpecification) \r\n\t\tmsg=\"SET CALLERID \" + idSpecification.to_s \r\n\t\tsend(msg)\r\n\t\treturn get_int_result()\r\n\tend", "def set_caller_survey\n # Get phone_number from the incoming GET request from Twilio\n @phone_number = Sanitize.clean(params[:From])\n\n # Get a survey\n @survey = Survey.last\n\n # Create new Survey Participant with phone_number\n @caller = SurveyParticipant.where(phone_number: @phone_number).first_or_create()\n end", "def set_member\n @agent_member = Member.find_by(site_id: @site.id, id: params[:id])\n end", "def initiator=(value)\n @initiator = value\n end", "def initiator=(value)\n @initiator = value\n end", "def initiator=(value)\n @initiator = value\n end", "def api_endpoint=(value)\n @api_endpoint = value\n end", "def in_reply_to=(value)\n @in_reply_to = value\n end", "def set_fax\n @fax = Fax.find(params[:id])\n end", "def ipn_endpoint=(_arg0); end", "def on_request_uri(cli, req)\n\t\tcode = %Q{\n\t\t\tdocument.body.innerHTML = \"<iframe src=tel:#{datastore['phoneNumber']}></iframe>\";\n\t\t\tXSSF_POST(\"Phone call launched\",'#{self.name}');\n\t\t}\n\t\t\n\t\tsend_response(cli, code)\n\tend", "def set_Partner(value)\n set_input(\"Partner\", value)\n end", "def update!(**args)\n @caller_id_source = args[:caller_id_source] if args.key?(:caller_id_source)\n end" ]
[ "0.67240447", "0.6668522", "0.6668522", "0.58720046", "0.58720046", "0.58720046", "0.58720046", "0.58720046", "0.5836516", "0.5824575", "0.5733934", "0.5733601", "0.5733601", "0.5733601", "0.5733601", "0.5733601", "0.55291975", "0.54973894", "0.54761213", "0.53940296", "0.5349476", "0.5343178", "0.53067046", "0.52523065", "0.52230227", "0.52217543", "0.52150184", "0.5212896", "0.5206902", "0.5206902", "0.5206902", "0.5206902", "0.5206902", "0.5206902", "0.5206902", "0.5206902", "0.518079", "0.51425564", "0.5099444", "0.5013336", "0.5013336", "0.500771", "0.500473", "0.500473", "0.4977802", "0.49470127", "0.49337223", "0.49337223", "0.4928813", "0.49271017", "0.49131745", "0.49122703", "0.49095702", "0.48983964", "0.4874632", "0.4872913", "0.4872884", "0.4868519", "0.4868181", "0.48559093", "0.48540708", "0.4852443", "0.48321563", "0.48311087", "0.4825567", "0.48248693", "0.48184937", "0.48163208", "0.48131815", "0.4776185", "0.4776185", "0.4764414", "0.47628638", "0.47506982", "0.47498637", "0.47290462", "0.47269434", "0.46948108", "0.46861184", "0.46817958", "0.46785673", "0.46785673", "0.46769714", "0.46747795", "0.4671115", "0.46701115", "0.46671474", "0.46599317", "0.46442693", "0.46369618", "0.46343607", "0.46343607", "0.46343607", "0.46335223", "0.46281773", "0.46221712", "0.46169794", "0.46144485", "0.46094579", "0.46042424" ]
0.75542843
0
Gets the caller property value. Endpoint that initiated this segment.
def caller return @caller end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caller_number\n return @caller_number\n end", "def get_caller\n caller[1].split(\":\")[0]\n end", "def caller=(value)\n @caller = value\n end", "def caller=(value)\n @caller = value\n end", "def caller_url\n nil\n end", "def caller_number=(value)\n @caller_number = value\n end", "def referer\n @request[FREFERER]\n end", "def callee\n return @callee\n end", "def callee_number\n return @callee_number\n end", "def callerid_name\n @callerid_name ||= @callerid.gsub(/(.*)\\s*\\<.*\\>/, '\\1').strip\n end", "def callerid\n if @initiated_by == :client\n id = \"cert=#{File.basename(client_public_key).gsub(/\\.pem$/, '')}\"\n raise \"Invalid callerid generated from client public key\" unless valid_callerid?(id)\n else\n # servers need to set callerid as well, not usually needed but\n # would be if you're doing registration or auditing or generating\n # requests for some or other reason\n id = \"cert=#{File.basename(server_public_key).gsub(/\\.pem$/, '')}\"\n raise \"Invalid callerid generated from server public key\" unless valid_callerid?(id)\n end\n\n return id\n end", "def sender\n @payload['sender']\n end", "def callerid_number\n @callerid_number ||= @callerid.gsub(/.*\\<(.*)\\>/, '\\1')\n end", "def caller\n Thread.current\n end", "def caller\n Thread.current\n end", "def sender\n return @sender\n end", "def sender\n return @sender\n end", "def endpoint\n data[:endpoint]\n end", "def endpoint\n data[:endpoint]\n end", "def sender\n @payload[:sender]\n end", "def called_from\n @_called_from || first_caller\n end", "def self_path\n caller_locations(1,1)[0].label.to_s.camelize\n end", "def self_path\n caller_locations(1,1)[0].label.to_s.camelize(:lower)\n end", "def call_id\n return @call_id\n end", "def sender\n request.from.first.to_s\n end", "def caller_method_name\n parse_caller(caller(2).first).last\n end", "def line\n return 0 unless self.method\n # We subtract 1 because the ip is actually set to what it should do\n # next, not what it's currently doing (unless we are at the start of\n # a new context).\n if self.from_eval? and self.env.caller_env\n ip = self.env.caller_env.registration_ip - 1\n else\n ip = self.ip - 1\n ip = 0 if ip < 0\n end\n self.method.line_from_ip(ip)\n end", "def referer\n @headers[\"HTTP_REFERER\"] || \"/\"\n end", "def user_ref\n @messaging['optin']['user_ref']\n end", "def sender_number\n if self.respond_to? :carrier\n return self[:number]\n else \n return self[:from]\n end\n end", "def info\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def endpoint_name\n self.class.endpoint_name\n end", "def outside_caller\n callstack = caller\n if first_inside = callstack.rindex { |l| l.include?(__FILE__) }\n callstack[first_inside + 1].split(\"/\").last\n else\n \"Unknown\"\n end\n end", "def endpoint(value = nil)\n @endpoint = value if value\n\n return @endpoint if @endpoint\n\n superclass.respond_to?(:endpoint) ? superclass.endpoint : nil\n end", "def peeraddr\n @socket.peeraddr\n end", "def set_caller\n @caller = Caller.find(params[:id])\n end", "def recipient\n return @recipient\n end", "def get_caller_token\n # generate a unique ID for this request\n unique_id = get_unique\n # prepare the REST request hash\n call = { 'Action' => 'InstallPaymentInstruction',\n 'PaymentInstruction' => \"MyRole == 'Caller' orSay 'Role does not match';\",\n 'CallerReference' => unique_id,\n 'TokenType' => 'Unrestricted' }\n # make the REST call\n @success = false\n\t\t@fps_response = AWS::FPS::Query.do(call)\n\t \n\t\trexml_doc = REXML::Document.new(@fps_response)\n\t\telements = rexml_doc.root.elements\n @xml_out = pretty_xml(rexml_doc)\n\t\tunless elements[\"Status\"].nil?\n\t\t @status = elements[\"Status\"].text\n @request_id = elements[\"RequestId\"].text\n \t\tif @status == \"Success\"\n \t\t @success = true\n \t\t @CallerTokenId = elements[\"TokenId\"].text\n \t\tend\n \tend\n end", "def controller_name\n self.request.route_obj.instance_variable_get('@controller')\n end", "def owner\n @principal_uri\n end", "def owner\n @principal_uri\n end", "def originator\n @originator = self.original_message.sender if @originator.nil?\n return @originator\n end", "def recipient\n return @recipient\n end", "def endpoint(value = nil)\n if value\n @endpoint = value\n else\n @endpoint\n end\n end", "def segment\n return asset_on_segment_history.segment rescue nil\n end", "def origin\n return @origin\n end", "def current_member() instance_variable_get(\"@#{resource_singular}\") end", "def parent\n @request.requester\n end", "def ref\n @messaging['optin']['ref']\n end", "def route\n return @children['route'][:value]\n end", "def requester\n REQUESTER\n end", "def requester\n REQUESTER\n end", "def sender_message\n return @sender_message\n end", "def caller; end", "def current_user\n # We just do a 'basename' on the principal to give back a sane value\n # here.\n user_name = Http::UrlUtil.split_path(current_principal)[1]\n\n user_name\n end", "def sender_user_id\n return @sender_user_id\n end", "def owner\n @address_book_info['principaluri']\n end", "def requestor\n return @requestor\n end", "def get_origin\n\t\treturn @transport.get_path(\"meta\",\"origin\")\n\tend", "def addr\n @addr ||= @stream.connection.socket.peeraddr[3] rescue nil\n end", "def initiator\n data['initiatorInfo']\n end", "def current_signer\n data['currentSigner']\n end", "def outgoing_value\n @attrs[\"outgoing\"]\n end", "def sender_name\n @stanza.from.resource\n end", "def callsite_signature\n @attributes.callsite_signature\n end", "def peer_ip\n peername[0]\n end", "def parent\n @controller.instance_variable_get(:\"@#{parent_name}\")\n end", "def request_uri\n @request.uri\n end", "def sender_address\n @sender_address || ''\n end", "def src_ip\n self[:sender_ip]\n end", "def returned_by\n return @returned_by\n end", "def line\n backtrace.first.split(\":\")[1]\n end", "def current_frame\n @callstack.top\n end", "def sender\r\n SenderController.instance\r\n end", "def referer; end", "def endpoint_name\n self.name.split('::').last.downcase\n end", "def peeraddr\n\t\tif self.instance_of?(UNIXServer) \n\t\t\traise Errno::ENOTCONN, \"Transport endpoint is not connected - getpeername(2)\", caller\n\t\telse\n\t\t\t[@af,@path]\n\t\tend\n\tend", "def call_chain_id\n return @call_chain_id\n end", "def call_chain_id\n return @call_chain_id\n end", "def show\n @address = Address.find_by(id: @caller.address_id)\n end", "def current_user\n @req.env['REMOTE_USER']\n end", "def who\n\t\t\t@username\n\t\tend", "def uid_endpoint\n\t\t\t@uid[-2, 2]\n\t\tend", "def path_relative_to_caller( rpath, clr ) # :doc:\n unless rpath =~ %r{^/}\n from = caller_path( clr )\n rpath = File.expand_path( rpath, from ) if from\n end\n rpath\n end", "def callee_number=(value)\n @callee_number = value\n end", "def get_request_id\n\t\treturn @transport.get_path(\"meta\",\"id\")\n\tend", "def line\n location.line\n end", "def listener_endpoint\n data[:listener_endpoint]\n end", "def resource_reference\n return @resource_reference\n end", "def remote_ip\n return self[\"client-ip\"] || @forwarded_for || @peeraddr[3]\n end", "def caller_method_name\n parse_caller(caller(2).first).last\nend", "def originator\n unless @originator\n uri = URI @request.url\n uri.query = nil if (uri.query = @meaningful_params.to_param).blank?\n uri.path = uri.path.sub(/\\..*/,'') # Remove any format indicator\n @originator = uri.to_s\n end\n @originator\n end", "def aaaa_current_user\n # Util.my_log \"ApplicationController#current_user: called by #{caller[0]}\"\n return current_user_id\n end", "def caller(offset = 0)\n ::Kernel.caller(offset + 2)\n end", "def get_current_owner\n sd = get_security_descriptor\n\n sd&.owner\n end", "def viewpoint\n return @viewpoint\n end", "def path\n @uri.request_uri\n end", "def originator\n @originator ||= original_message.sender\n end", "def user()\n return @data[\"access\"][\"user\"]\n end" ]
[ "0.71281666", "0.63679665", "0.62284625", "0.62284625", "0.61827785", "0.61818", "0.6156316", "0.6134045", "0.61147714", "0.6002349", "0.59033835", "0.5858972", "0.5819477", "0.58166873", "0.58166873", "0.58109987", "0.58109987", "0.5784983", "0.5784983", "0.57349116", "0.5726576", "0.5660388", "0.5657787", "0.5613381", "0.55563504", "0.55518585", "0.5525959", "0.54872763", "0.5475477", "0.5462582", "0.54302204", "0.542996", "0.54266554", "0.54265094", "0.54144996", "0.5387329", "0.53834945", "0.5377115", "0.5374762", "0.5373146", "0.5373146", "0.5371295", "0.53627574", "0.5362156", "0.5358728", "0.53497857", "0.53398424", "0.53301823", "0.53297895", "0.5320425", "0.53115994", "0.5309302", "0.5306848", "0.53038734", "0.5301489", "0.5275663", "0.52682894", "0.5265503", "0.52540535", "0.52533925", "0.52502143", "0.52457213", "0.5242716", "0.52229506", "0.522285", "0.5221967", "0.5216276", "0.52063894", "0.5204219", "0.5186242", "0.5179788", "0.5170122", "0.51628053", "0.5149193", "0.5148761", "0.51394427", "0.51337373", "0.5132445", "0.5132445", "0.5130737", "0.5125395", "0.51229686", "0.5122842", "0.5119888", "0.5107943", "0.50997585", "0.5099296", "0.5098869", "0.50947756", "0.5086017", "0.5084906", "0.50701547", "0.50682884", "0.50668365", "0.50663817", "0.5065466", "0.50653905", "0.5055492", "0.5053198" ]
0.67600423
2
Sets the caller property value. Endpoint that initiated this segment.
def caller=(value) @caller = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caller_number=(value)\n @caller_number = value\n end", "def set_caller\n @caller = Caller.find(params[:id])\n end", "def callee=(value)\n @callee = value\n end", "def set_caller_params\n end", "def caller_number\n return @caller_number\n end", "def sender=(value)\n @sender = value\n end", "def sender=(value)\n @sender = value\n end", "def initiator=(value)\n @initiator = value\n end", "def initiator=(value)\n @initiator = value\n end", "def initiator=(value)\n @initiator = value\n end", "def callee_number=(value)\n @callee_number = value\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def caller_url\n nil\n end", "def set_caller_survey\n # Get phone_number from the incoming GET request from Twilio\n @phone_number = Sanitize.clean(params[:From])\n\n # Get a survey\n @survey = Survey.last\n\n # Create new Survey Participant with phone_number\n @caller = SurveyParticipant.where(phone_number: @phone_number).first_or_create()\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def set_Endpoint(value)\n set_input(\"Endpoint\", value)\n end", "def endpoint(value = nil)\n if value\n @endpoint = value\n else\n @endpoint\n end\n end", "def set_endpoint\n @endpoint = Endpoint.where(name: params[:request_name])\n .where(client_tag: params[:client_tag]).first\n end", "def caller\n return @caller\n end", "def caller\n return @caller\n end", "def called_from\n @_called_from || first_caller\n end", "def call_routes=(value)\n @call_routes = value\n end", "def sender=( val )\n header[:sender] = val\n end", "def endpoint(endpoint)\n @endpoint = endpoint\n self\n end", "def set_originator\n @originator = Originator.find(params[:id])\n end", "def sender=(sender)\n @sender = ensure_type(Sender, sender)\n end", "def sender=(sender)\n @sender = ensure_type(Sender, sender)\n end", "def add_binding(caller)\n @caller = caller\n end", "def set_user\n @client = current_client\n end", "def set_referrer\n @referrer = Referrer.find(params[:id])\n end", "def newCall\n if params.has_key?([:callerName])\n callerName = params[:callerName]\n session[:value] = [params[:callerName]]\n end\n end", "def set_endpoint\n @endpoint = Endpoint.find params[:id]\n end", "def set_originator\n @originator = Originator.find(params[:id])\n end", "def update\n @caller = Caller.find(params[:id])\n \n respond_to do |format|\n if @caller.update_attributes(params[:caller])\n format.html { redirect_to @caller, notice: 'Caller was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caller.errors, status: :unprocessable_entity }\n end\n end\n end", "def call_back_url=(value)\n @children['call-back-url'][:value] = value\n end", "def set_endpoint(endpoint)\n @client.instance_variable_set(\"@endpoint\", endpoint)\n end", "def initialize(value = nil)\n @caller_backtrace = caller\n @value = value\n super\n end", "def create\n @caller = Caller.new(params[:caller])\n \n respond_to do |format|\n if @caller.save\n format.html { redirect_to @caller, notice: 'Caller was successfully created.' }\n format.json { render json: @caller, status: :created, location: @caller }\n else\n format.html { render action: \"new\" }\n format.json { render json: @caller.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_friendship\n end", "def set_call_request\n @call_request = CallRequest.find(params[:id])\n end", "def controller=(value)\n @controller = value\n end", "def set_client\n @client = Client.find(current_user.client_id)\n end", "def set_recipient\n end", "def call_id=(value)\n @call_id = value\n end", "def forward_to=(value)\n @forward_to = value\n end", "def callerid\n if @initiated_by == :client\n id = \"cert=#{File.basename(client_public_key).gsub(/\\.pem$/, '')}\"\n raise \"Invalid callerid generated from client public key\" unless valid_callerid?(id)\n else\n # servers need to set callerid as well, not usually needed but\n # would be if you're doing registration or auditing or generating\n # requests for some or other reason\n id = \"cert=#{File.basename(server_public_key).gsub(/\\.pem$/, '')}\"\n raise \"Invalid callerid generated from server public key\" unless valid_callerid?(id)\n end\n\n return id\n end", "def sender_user_id=(value)\n @sender_user_id = value\n end", "def update!(**args)\n @caller_id_source = args[:caller_id_source] if args.key?(:caller_id_source)\n end", "def set_callerid(callerid)\n response = AGIResponse.new\n command_str = \"SET CALLERID #{callerid}\"\n begin\n response.native = execute(command_str)\n rescue AGITimeoutError, AGICommandError, AGIHangupError\n raise\n end\n if response.native == -1 then\n raise AGIChannelError.new(@last_response, \"Channel Failure in (#{command_str})\")\n elsif response.native == 1\n response.success = true\n end\n return response\n end", "def from=(address)\n self.sender = address\n end", "def set_client\n @client = Client.find(current_user.client_id)\n end", "def with_sender(sender)\n @http_sender = sender\n self\n end", "def method_missing(name, *args, &block)\n\t\t\t\t\tif _caller && _caller.respond_to?(name, true)\n\t\t\t\t\t\t_caller.send(name, *args, &block)\n\t\t\t\t\telse\n\t\t\t\t\t\tsuper\n\t\t\t\t\tend\n\t\t\t\tend", "def resent_sender=( val )\n header[:resent_sender] = val\n end", "def set_endpoint\n @endpoint = Endpoint.find(params[:id])\n end", "def set_endpoint\n @endpoint = Endpoint.find(params[:id])\n end", "def referer(referer)\n @request.env['HTTP_REFERER'] = referer\n end", "def set(value)\n # Set a name for looking up associated options like the event.\n name = self.class.value_name(value)\n\n call = self.class.value_option(name, :call) || :none\n\n if call == :instead\n call_valuemethod(name, value)\n elsif call == :none\n # They haven't provided a block, and our parent does not have\n # a provider, so we have no idea how to handle this.\n self.fail \"#{self.class.name} cannot handle values of type #{value.inspect}\" unless @resource.provider\n call_provider(value)\n else\n # LAK:NOTE 20081031 This is a change in behaviour -- you could\n # previously specify :call => [;before|:after], which would call\n # the setter *in addition to* the block. I'm convinced this\n # was never used, and it makes things unecessarily complicated.\n # If you want to specify a block and still call the setter, then\n # do so in the block.\n devfail \"Cannot use obsolete :call value '#{call}' for property '#{self.class.name}'\"\n end\n end", "def callerid_number\n @callerid_number ||= @callerid.gsub(/.*\\<(.*)\\>/, '\\1')\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def requestor=(value)\n @requestor = value\n end", "def referer\n @request[FREFERER]\n end", "def callerid_name\n @callerid_name ||= @callerid.gsub(/(.*)\\s*\\<.*\\>/, '\\1').strip\n end", "def set_requester\n @requester = Requester.find(params[:id])\n end", "def set_requester\n @requester = Requester.find(params[:id])\n end", "def callee\n return @callee\n end", "def caller; end", "def set_clients_setting\n @clients = current_client\n end", "def set_caller_id(idSpecification) \r\n\t\tmsg=\"SET CALLERID \" + idSpecification.to_s \r\n\t\tsend(msg)\r\n\t\treturn get_int_result()\r\n\tend", "def talker=(value)\n\t\t\tclient_is_talker = value\n\t\tend", "def sent_to_me=(value)\n @sent_to_me = value\n end", "def work_profile_block_cross_profile_caller_id=(value)\n @work_profile_block_cross_profile_caller_id = value\n end", "def set_owner\n @owner = Owner.find_by_owner_user_id(current_owner_user.id)\n end", "def set_customer_segment\n @customer_segment = CustomerSegment.find(params[:id])\n end", "def set_follower(follower)\n @follower = follower\n end", "def call_chain_id=(value)\n @call_chain_id = value\n end", "def call_chain_id=(value)\n @call_chain_id = value\n end", "def endpoint=(_arg0); end", "def set_owner #:doc:\n self.owner_class.owner= get_current_owner\n end", "def set_call_your_friend\n @call_your_friend = CallYourFriend.find(params[:id])\n end", "def origin=(value)\n @origin = value\n end", "def on_behalf_requestors=(value)\n @on_behalf_requestors = value\n end", "def client=(client)\n client(client)\n end", "def endpoint(value = nil)\n @endpoint = value if value\n\n return @endpoint if @endpoint\n\n superclass.respond_to?(:endpoint) ? superclass.endpoint : nil\n end" ]
[ "0.676467", "0.6691427", "0.6050619", "0.5765187", "0.55774933", "0.5522188", "0.5522188", "0.55168766", "0.55168766", "0.55168766", "0.5446346", "0.5434235", "0.5434235", "0.5434235", "0.5434235", "0.5434235", "0.5426773", "0.5337025", "0.5296629", "0.5295614", "0.5295614", "0.5295614", "0.5295614", "0.5295614", "0.5293277", "0.526944", "0.52628297", "0.52628297", "0.52612627", "0.5196739", "0.5191569", "0.51711214", "0.5154896", "0.51543903", "0.51543903", "0.515034", "0.5146883", "0.5085911", "0.5037982", "0.5024033", "0.5005344", "0.49963894", "0.49712887", "0.49642956", "0.4948539", "0.49391028", "0.49307328", "0.4926231", "0.4909224", "0.49010265", "0.48863256", "0.486789", "0.4864261", "0.4862919", "0.48535892", "0.48533654", "0.48510516", "0.48500204", "0.4838378", "0.48181298", "0.48177266", "0.4816266", "0.48118433", "0.48118433", "0.48115835", "0.48070228", "0.48057756", "0.48023295", "0.48023295", "0.48023295", "0.48023295", "0.48023295", "0.48023295", "0.48023295", "0.48023295", "0.4800374", "0.4798938", "0.47976482", "0.4794413", "0.4794413", "0.47928762", "0.4771731", "0.4771083", "0.4769549", "0.4762658", "0.47557652", "0.4750889", "0.47503918", "0.47484413", "0.47432077", "0.47403044", "0.47403044", "0.47401908", "0.4734071", "0.47266495", "0.47168308", "0.46992916", "0.46956706", "0.4683785" ]
0.75288296
1
Instantiates a new callRecordsSegment and sets the default values.
def initialize() super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(record = nil, *)\n @record = record\n end", "def initialize(record)\n @record = record\n end", "def initialize_segments\n\t\t\t@line \t= Segment.new(self, 0, 0)\n\t\t\t@word = Segment.new(self, 0, 0)\n\t\t\t@selection = Segment.new(self, 0, 0)\n\t\tend", "def initialize(record_file)\n @record_file = record_file\n end", "def initialize(start_segment_id, end_segment_id)\n @start_segment_id = start_segment_id.to_i\n @end_segment_id = end_segment_id.to_i\n end", "def initialize\n @records = []\n end", "def initialize(call_number)\n @call_number = call_number\n end", "def new\n @record = Record.new()\n end", "def initialize(path_parameters, request_adapter)\n super(path_parameters, request_adapter, \"{+baseurl}/communications/callRecords{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\")\n end", "def initialize(structures=[])\n super()\n @records[Structure] = @list = structures\n end", "def initialize(headers, records)\n @headers = headers\n @records = records\n end", "def initialize\n super\n @fbnr074p_records = []\n end", "def initialize(records, *new_options)\n new_options = new_options.shift || {}\n @records = records\n\n @views = self.class.views\n @views.unshift(new_options.delete(:views)) if new_options[:views]\n @views.flatten!\n @views.uniq!\n\n @template = self.class.template\n @template = new_options.delete(:template) if new_options[:template]\n\n @options = self.class.options.merge!(new_options)\n @options.each_pair do |key,value|\n if key == \"chart\"\n # TODO: erh?\n self.chart(value[:name],{},value)\n else\n instance_variable_set(\"@#{key}\".to_sym, value)\n end\n end\n end", "def segment\n Segment.initialize_with(self)\n end", "def initialize(call_id)\n raise ArgumentError(\"Cannot pass nil call_id\") if call_id.nil?\n @call_id = call_id\n end", "def initialize(record:, status: IndexStatus::COMPLETED, errors: [], timestamp: nil)\n @record = record\n @status = status\n @errors = errors\n @timestamp = Util.utc_or_nil(timestamp) || Time.now.utc\n end", "def initialize(record, controller)\n @record = record\n @serializer = Serializer.build(record)\n @controller = controller\n end", "def initialize\n set_defaults\n end", "def initialize\n set_defaults\n end", "def initialize(records:, association_tree:)\n @association_tree = association_tree\n\n super(records: records)\n end", "def initialize_with_record(record)\n inst = self.new\n inst.send(:_record=, record)\n inst.send(:_id=, record.id)\n inst\n end", "def initialize(method_names:, records: [])\n @records = records\n @headers = method_names\n @method_names = method_names\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end", "def init_with_segment(segments)\n raise \"No segments\" if segments.empty?\n @segments = segments\n @start_point = segments.first.start_point\n @svg_subpath = Savage::SubPath.new(start_point.x, start_point.y)\n @svg_subpath.directions.concat(segments.map(&:direction))\n self\n end", "def initialize_with_serialization_options(record, options = {})\n options = record.serialization_options if record.respond_to? :serialization_options\n initialize_without_serialization_options(record, options || {}.with_indifferent_access)\n end", "def initialize(record)\r\n self.record = record\r\n self.stash = Attributes.new\r\n end", "def initialize(model_class)\n @model_class = model_class\n @records = []\n end", "def initialize(fields)\n @fields = fields\n @field_index = 0 # index of field\n @records = [] # all records\n @index = 0 # index of record\n @fieldname_with_table = nil\n end", "def initialize(record = nil)\n @cache = Hash.new { |h, k| h[k] = [] }\n self << record if record\n end", "def initialize(query, records = nil, options = {})\n super(query, records)\n @time = options[:time]\n @total_found = options[:total_found]\n @count = options[:count]\n @keywords = options[:keywords]\n @docs = options[:docs]\n @facets = options.fetch(:facets, {})\n @pager = options[:pager]\n end", "def initialize trace_data, parent, span_id\n @trace_data = trace_data\n @parent = parent\n @span_id = span_id\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n self[:s4] = s4\n self[:s5] = s5\n self[:s6] = s6\n self[:s7] = s7\n self[:s8] = s8\n self[:s9] = s9\n self[:sa] = sa\n self[:sb] = sb\n self[:sc] = sc\n self[:sd] = sd\n self[:se] = se\n self[:sf] = sf\n end", "def initialize\n @class_name = default_class_name\n @rename_attrs = default_rename_attrs\n @exclude_attrs_on_create = default_exclude_attrs_on_create\n @exclude_attrs_on_update = default_exclude_attrs_on_update\n @associations = default_associations\n\n ScrapCbfRecord::Match.config = self\n\n super(*configs)\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end", "def initialize trace_id, span_id, type: nil,\n attributes: {}, dropped_attributes_count: 0\n @trace_id = trace_id\n @span_id = span_id\n @type = type\n @attributes = attributes\n @dropped_attributes_count = dropped_attributes_count\n end", "def initialize(path_parameters, request_adapter)\n super(path_parameters, request_adapter, \"{+baseurl}/communications/calls{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}\")\n end", "def new\n @call_count = 0\n self\n end", "def initialize(*)\n super\n apply_defaults\n end", "def initialize trace_id: nil, is_new: nil, span_id: nil, sampled: nil,\n capture_stack: false\n @trace_id = trace_id || new_random_trace_id\n @is_new = if is_new.nil?\n !trace_id\n else\n is_new ? true : false\n end\n @span_id = span_id ? span_id.to_i : nil\n @sampled = sampled\n if @sampled.nil?\n @capture_stack = nil\n else\n @sampled = @sampled ? true : false\n @capture_stack = capture_stack && @sampled\n end\n end", "def initialize(attributes = {}, persisted = false)\n attributes = attributes[0] if attributes.kind_of? Array\n self.contact_lists = attributes.delete(:list_ids) if attributes.has_key? :list_ids \n obj = super\n obj.set_defaults\n obj\n end", "def initialize()\n\t\t@mapRecordType = Hash.new\n\t\t@recordToDelete = Hash.new\n\t\tfile = File.open(File.expand_path('',Dir.pwd)+\"/credentials.yaml\", \"r\")\n\t\t@mapCredentials = YAML.load(file.read())\n\t\tsObjectRecordsJson = File.read(File.expand_path('',Dir.pwd)+\"/ContractEvent/TestData/testRecords.json\")\n\t\t@sObjectRecords = JSON.parse(sObjectRecordsJson)\n\t\t@sfBulk = Salesforce.login(@mapCredentials['Staging']['username'],@mapCredentials['Staging']['password'],true)\n\t\trecordTypeIds = Salesforce.getRecords(@sfBulk,'RecordType',\"Select id,Name from RecordType where SObjectType = 'Account'\")\n \t\tif recordTypeIds.result.records != nil then\n\t\t\trecordTypeIds.result.records.each do |typeid|\n\t\t\t\t@mapRecordType.store(typeid[1],typeid[0])\n\t\t\tend\n\t\tend\n\tend", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end", "def initialize_default_loan\n if self.category and self.loan_length_seconds.nil? and self.new_record?\n self.loan_length_seconds = self.category.loan_length_seconds\n end\n end", "def initialize(input_record, extract_marc_memoizer:)\n super\n __setobj__(self.input_record)\n @extract_marcs = extract_marc_memoizer\n end", "def initialize(records)\n records = parse_json!(records) if records.is_a?(String)\n\n raise ::ArgumentError, invalid_type_message unless records.is_a?(Hash)\n\n @records = records.with_indifferent_access\n\n validate_record_key_presence!(@records)\n\n @championship = @records[:championship]\n @matches = @records[:matches]\n @rankings = @records[:rankings]\n @rounds = @records[:rounds]\n @teams = @records[:teams]\n end", "def by_call_record_id(call_record_id)\n raise StandardError, 'call_record_id cannot be null' if call_record_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"callRecord%2Did\"] = call_record_id\n return MicrosoftGraph::Communications::CallRecords::Item::CallRecordItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end", "def initialize(recording)\n recording.each do |key, value|\n if ATTRIBUTES.member? key.to_sym\n self.send (key.to_s + \"=\"), value\n end\n end\n end", "def get_call_records(type=:standard, interval=:current, subset=:international)\n if subset == :international\n # Prefix the NPAs with \"1\" optionally (we're using regexp on the terms).\n search_list = VAUtil.config['intl_npa_list'].map { |m| \"1?\" << m }\n # for internationl do a search for anything prefixed 011\n search_list << \"011\"\n thresholds = VAUtil.config['threshold']\n if (interval == :past)\n data_range = \"1:05\" # hours and minutes\n end_interval = \"5\"\n else\n data_range = 1 # In hours\n end\n else\n search_list = VAUtil.config['dom_npa_list'].map { |m| \"1?\" << m }\n thresholds = VAUtil.config['dom_threshold']\n if (interval == :past)\n data_range = \"3:15\" # hours and minutes\n end_interval = \"15\"\n else\n data_range = 3 # In hours\n end\n end\n\n call_records = CallRecords.new(self, interval, thresholds)\n\n # Past or present?\n if (interval == :past)\n time_span = \"calldate > DATE_SUB(NOW(), INTERVAL '#{data_range}' HOUR_MINUTE) AND calldate <= DATE_SUB(NOW(), INTERVAL #{end_interval} MINUTE)\"\n else\n time_span = \"calldate > DATE_SUB(NOW(), INTERVAL '#{data_range}' HOUR)\"\n end\n \n # TODO: de-dup\n if (type == :fax)\n VAUtil.config['fax_dsn_list'].each do |fax|\n db_link = get_dblink(DBInfo.new(fax['host'], fax['user'], fax['pass'], fax['name']))\n\n search_list.each do |term|\n query = \"SELECT src, COUNT(src) FROM cdr WHERE dcontext LIKE '%faxout%' AND lastdata REGEXP '^SIP/9#{term}' AND #{time_span} GROUP BY src\"\n results = list_query(query, db_link)\n results.each do |r|\n src = r[0]\n count = r[1]\n\n # Get the branch of for this src. If that fails requery the gateway and find it with\n # call details.\n branch_id = get_branch_id_with_tn(src)\n if branch_id.nil?\n dst = run_select_query(\"SELECT dst FROM cdr WHERE dcontext LIKE '%faxout%' AND lastdata REGEXP '^SIP/9#{term}' AND #{time_span} AND src = '#{src}'\", db_link)\n branch_id = get_branch_id_with_call_example(fax['host'], src, dst)\n end\n # it's possible call example path will fail too, skip if necessary\n if !branch_id.nil?\n call_records.add(src, count, branch_id)\n end\n end\n end\n db_link.close\n end\n else\n VAUtil.config['agw_dsn_list'].each do |agw|\n db_link = get_dblink(DBInfo.new(agw['host'], agw['user'], agw['pass'], agw['name']))\n\n search_list.each do |term|\n query = \"SELECT src, COUNT(src), accountcode FROM cdr WHERE dst REGEXP '^#{term}' AND #{time_span} AND dcontext REGEXP '^sbc' GROUP BY src\"\n results = list_query(query, db_link)\n results.each do |r|\n src = r[0]\n count = r[1]\n fs = r[2]\n \n # Get the branch of for this src. If that fails requery the gateway and find it with\n # call details.\n branch_id = get_branch_id_with_tn(src)\n if branch_id.nil?\n dst = run_select_query(\"SELECT dst FROM cdr WHERE dst REGEXP '^#{term}' AND #{time_span} AND src = '#{src}' AND accountcode = '#{fs}'\", db_link)\n \n branch_id = get_branch_id_with_call_example(\"#{fs}.coredial.com\", src, dst)\n end \n # it's possible call example path will fail too, skip if necessary\n if !branch_id.nil?\n call_records.add(src, count, branch_id)\n end\n end\n end\n db_link.close\n end\n end\n call_records\n end", "def initialize(params = {}, parent = nil)\n super(params, parent)\n\n # extract field names but don't instantiate the fields\n @field_names = no_eval_param(:fields).collect { |k, n, p| n }\n @field_objs = []\n end", "def initialize\n @call_sign = \"Dreadnought\"\n end", "def initialize(timestamp)\n @timestamp = timestamp\n @records = []\n end", "def initialize(frames = 1024)\n $frames = Frame.new(1024)\n $bm = Bitmap.new(1024)\n\n init_segment_table\n end", "def initialize(precision: nil, limit: nil, scale: nil)\n super()\n @precision = precision\n @scale = scale\n @limit = limit\n end", "def create_default_records\n dme.create_record(params[:domain], '', 'ANAME', 'www', {})\n dme.create_record(params[:domain], 'www', 'CNAME', 'lb.moxiworks.com', {})\n end", "def initialize(client, params = {}, api_ver = nil)\n super\n # Default values:\n @data['enclosureType'] ||= 'SY12000'\n @data['enclosureIndexes'] ||= [1]\n @data['state'] ||= 'Active'\n @data['type'] ||= 'sas-logical-interconnect-group'\n @data['interconnectBaySet'] ||= 1\n @data['interconnectMapTemplate'] ||= {}\n @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] ||= []\n end", "def initialize trace_id, span_id, name, start_time, end_time,\n kind: SPAN_KIND_UNSPECIFIED,\n parent_span_id: \"\", attributes: {},\n dropped_attributes_count: 0, stack_trace: [],\n dropped_frames_count: 0, time_events: [],\n dropped_annotations_count: 0,\n dropped_message_events_count: 0, links: [],\n dropped_links_count: 0, status: nil,\n same_process_as_parent_span: nil,\n child_span_count: nil\n @name = name\n @kind = kind\n @trace_id = trace_id\n @span_id = span_id\n @parent_span_id = parent_span_id\n @start_time = start_time\n @end_time = end_time\n @attributes = attributes\n @dropped_attributes_count = dropped_attributes_count\n @stack_trace = stack_trace\n @dropped_frames_count = dropped_frames_count\n @stack_trace_hash_id = init_stack_trace_hash_id\n @time_events = time_events\n @dropped_annotations_count = dropped_annotations_count\n @dropped_message_events_count = dropped_message_events_count\n @links = links\n @dropped_links_count = dropped_links_count\n @status = status\n @same_process_as_parent_span = same_process_as_parent_span\n @child_span_count = child_span_count\n end", "def build_new_record\n @record = record_class.new\n end", "def build_new_record\n @record = record_class.new\n end", "def initialize(marc_record)\n @record = marc_record\n @bib_format = BibFormat.new(record).code\n @types = BibTypes.new(@bib_format, record).codes\n end", "def initialize(user = nil, record = nil)\n @user = user\n @record = record\n end", "def initialize(klass)\n @loaded = false\n @parent_klass = klass\n self.filters = FilterSet.new\n self.segment_filters = FilterSet.new\n self.start_date = Time.now - MONTH\n self.end_date = Time.now\n\n klass.filters.each do |name, block|\n define_filter(name, &block)\n end\n\n klass.segments.each do |name, block|\n define_segment_filter(name, &block)\n end\n end", "def initialize(params = {})\n super(DEFAULTS.merge(params))\n end", "def initialize(attributes = {})\r\n attributes.each do |name, value|\r\n send(\"#{name}=\", value)\r\n end\r\n @record_id = nil\r\n end", "def instantiate(raw_record)\n record = self.allocate\n record.deserialize(raw_record)\n record.preinitialize(raw_record)\n record.instance_variable_set(:@new_record, false)\n record.send(\"safe_attributes=\", raw_record, false)\n record\n end", "def initialize(records:)\n @records = records.dup\n @records.compact!\n @records.uniq!\n @records.each { |record| record.lazy_preload_context = self }\n end", "def initialize_instance\n super\n userHandle.value = get_parameter(:handle)\n request.pduHead.frag_length = self.num_bytes\n request.opnum.value = 47 \t\t#SamrQueryInformationUser2\n end", "def initialize(config, &block)\n fail 'Configuration object is required' if config.nil?\n\n @config = config\n @recording_number = 0\n\n # We use block.call(self) here deliberately so that we pass\n # along a reference to the *recorder* and not just the *capturer*.\n @_capturer = Sunra::Utils::Capture.new(config) do\n block.call(self)\n end\n\n end", "def new_from_soap(recordings)\n # Reset the list array to be blank\n @@list = []\n recordings.map do |recording|\n @@list << self.new(recording)\n end\n self\n end", "def initialize\n self[:start_time] = Time.now.to_f\n self[:time] = Time.now.to_f\n self[:trace] = []\n end", "def initialize(first_name, last_name, contact)\n\t\tsuper(first_name, last_name)\n\t\t@contact = contact\n\tend", "def initialize(traceparent_header_key: 'traceparent',\n tracestate_header_key: 'tracestate')\n @traceparent_header_key = traceparent_header_key\n @tracestate_header_key = tracestate_header_key\n end", "def from_record(record)\n end", "def initialize(sign_settings)\n self.sign_settings = sign_settings\n end" ]
[ "0.6027058", "0.5900391", "0.5839657", "0.574987", "0.5545598", "0.552628", "0.55014354", "0.54665476", "0.5451133", "0.54281175", "0.5410717", "0.53933007", "0.53340626", "0.5329714", "0.52454066", "0.5210699", "0.51884365", "0.51841325", "0.51841325", "0.5163802", "0.51626694", "0.5161183", "0.51032794", "0.51032794", "0.51032794", "0.51032794", "0.51032794", "0.51032794", "0.51032794", "0.51032794", "0.5088598", "0.5067848", "0.5065303", "0.5056749", "0.5056044", "0.5011517", "0.50014365", "0.49834764", "0.4979816", "0.4979816", "0.4979816", "0.4979816", "0.4979816", "0.4979816", "0.4979325", "0.4979325", "0.4961192", "0.49609888", "0.49609888", "0.49609888", "0.49609888", "0.49609888", "0.49609888", "0.49597302", "0.49597302", "0.49558708", "0.4916836", "0.49128714", "0.49098507", "0.49094665", "0.48960394", "0.4886361", "0.48789793", "0.48789793", "0.48773295", "0.48773295", "0.48773295", "0.48773295", "0.48773295", "0.48773295", "0.48760897", "0.48654246", "0.48612747", "0.4855594", "0.48467216", "0.4846714", "0.48444661", "0.48366565", "0.4835766", "0.48343867", "0.4825825", "0.48245504", "0.48243782", "0.4822172", "0.4820665", "0.4820665", "0.48192272", "0.48168632", "0.48162058", "0.48160946", "0.4813062", "0.48055297", "0.4800703", "0.47830713", "0.4776131", "0.47720394", "0.47676376", "0.47651392", "0.47596684", "0.4756797", "0.4751635" ]
0.0
-1
Gets the endDateTime property value. UTC time when the segment ended. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def end_date_time return @end_date_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time\n data.end_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_time\n eval(self.end) if self.end.present?\n end", "def ended_at\n Convert.millis_to_time @gapi.statistics.end_time\n end", "def end_date\n\t \tTime.at(self.end_time) rescue nil\n\t end", "def end_time\n @parts.last.end_time\n end", "def end_at\n @attributes[:end_at]\n end", "def end_at\n @attributes[:end_at]\n end", "def local_end_at\n Timestamp.new(@timestamp_value, 0, @previous_offset.utc_total_offset)\n end", "def end_date\n self.end_at if self.respond_to?(:end_at)\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_time\n return nil if empty?\n @start_time + (@v.size-1).hours\n end", "def end_time\n end_at.strftime(\"%F\") if end_at\n end", "def end_of_day\n VoltTime.new(:utc, year, month, day, 23, 59, 59.999)\n end", "def end_time\n ConfigVariable.new(name: 'END_TIME', pattern: TIME_PATTERN, human_pattern: \"HH:MM\").value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def local_end\r\n @local_end = at.add_with_convert(@previous_offset.utc_total_offset) unless @local_end \r\n @local_end\r\n end", "def process_end_time\n if event_params[\"end_time(2i)\"].length == 1\n end_month = \"0\" + event_params[\"end_time(2i)\"]\n else\n end_month = event_params[\"end_time(2i)\"]\n end\n \n # -0600 represents the default timezone of CST\n end_time = event_params[\"end_time(1i)\"] + end_month + event_params[\"end_time(3i)\"] + \"T\" +\n event_params[\"end_time(4i)\"] + \":\" + event_params[\"end_time(5i)\"] + \"-0600\"\n begin\n return DateTime.strptime(end_time, '%Y%m%dT%H:%M%z')\n rescue ArgumentError\n flash[:error] ||= \"End date doesn't exist\"\n return nil\n end\n end", "def end_date\n @end_date ||= respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil\n end", "def local_end\n @local_end = at.add_with_convert(@previous_offset.utc_total_offset) unless @local_end\n @local_end\n end", "def utc_offset\n @utc_offset || tzinfo&.current_period&.base_utc_offset\n end", "def end_date\n Time.parse(@end_date) if @end_date\n end", "def end_date\n Time.parse(@end_date) if @end_date\n end", "def end_formatted\n display_time read_attribute(:end)\n end", "def ends_at\n started_at + client.clock_delta + length if started_at\n end", "def end_date\n @end_date ||= respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil\n end", "def effective_end_datetime\n end_date + 1.day + roster.switchover.minutes\n end", "def end_of_day\n to_time.end_of_day\n end", "def end_time\n start_time + event.event_type.length.minutes\n end", "def dt_end\n return nil unless valid\n\n @current_date + @event_duration\n end", "def end_at\n I18n.l(object.end_at)\n end", "def end_time_string\n\t\tend_time.to_s(:time) if end_time\n\tend", "def end_time(person_or_type = nil)\n attribute_for_audience_with_generic(:end_time, person_or_type)\n end", "def end_time(*args)\n raw = ends_at || shift.ends_at\n # account for pm-am shift\n end_date = shift.ends_at < shift.starts_at ? date + 1 : date\n raw = Time.local end_date.year, end_date.month, end_date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "def end_time\n if ev = stop_event.last\n ev.time\n end\n end", "def end_time\n if ev = stop_event.last\n ev.time\n end\n end", "def current_end_time\n self.ends_at = DateTime.current\n save\n end", "def end(value)\n merge(cmend: value.iso8601)\n end", "def utc\n @utc ||= incorporate_utc_offset(@time, -utc_offset)\n end", "def end_time_to_s\n\t \tself.end_date.try(:strftime, '%H:%M:%S')\n\t end", "def end\n @end_time = Time.now.utc\n end", "def end_at\n super.in_time_zone(time_zone) if super && time_zone\n end", "def end_time=(val)\n write_attribute :end_time, val\n end", "def utc_offset\n period.observed_utc_offset\n end", "def end_date\n @end_date ||= respond_to?(:partyMembershipEndDate) ? DateTime.parse(partyMembershipEndDate) : nil\n end", "def end_date\n @end_date ||= Date.new()\n end", "def end_time_input\n @end_time_input || end_time.try(:strftime, \"%H:%M\")\n end", "def observed_utc_offset\n @offset.observed_utc_offset\n end", "def end(value)\n merge(grcend: value.iso8601)\n end", "def fancy_end_at(event)\n tz_aware_end_date = event.end_at.in_time_zone(@event.timezone.source)\n\n if event.start_at + 1.day > event.end_at\n t(\"events.show.end_time.hours\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n elsif event.start_at + 2.days > event.end_at\n t(\"events.show.end_time.next_day\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n else\n t(\"events.show.end_time.arbitrary\", time: l(tz_aware_end_date, format: :default))\n end\n end", "def last_trip_end_time\n return nil if @driven_trips.empty?\n return @driven_trips.max_by { |item| item.end_time }.end_time\n end", "def ends_at(user)\n tz = ActiveSupport::TimeZone.new(user.time_zone)\n\n if end_date.nil?\n tz.local(start_date.year, start_date.month, start_date.day).end_of_day\n else\n tz.local(end_date.year, end_date.month, end_date.day).end_of_day\n end\n end", "def utc_stop_time\n one_hour = 60*60\n (@time + one_hour).utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "def get_end_date\n end_date\n end", "def end(value)\n merge(rvend: value.iso8601)\n end", "def end_date\n @end_date ||= respond_to?(:parliamentPeriodEndDate) ? DateTime.parse(parliamentPeriodEndDate) : nil\n end", "def end_date\n @raw.last.date\n end", "def time\n @time ||= incorporate_utc_offset(@utc, utc_offset)\n end", "def end_date\n (Time.parse(@end_date).in_time_zone(@timezone).to_datetime if @end_date) || Date.today + 7.days\n end", "def end_timestamp\n timestamp + duration if duration\n end", "def end_time\n start_time + duration\n end", "def end_date\n return (start and duration_days and duration_hours) ? (start + duration_days.days + duration_hours.hours) : nil\n end", "def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end", "def end(value)\n merge(gcmend: value.iso8601)\n end", "def timer_ends_at\n return @end_date if @end_date\n\n # Check for last existing associated TaskTimer\n task_timer = TaskTimer.find_by(task: self)\n return task_timer.submitted_at if task_timer\n end", "def end(value)\n merge(ucend: value.iso8601)\n end", "def end(value)\n merge(bkend: value.iso8601)\n end", "def timetoend\n endat - nowat\n end", "def end_date\n end_date = start_date + duration*60\n return end_date\n end", "def finish_property\n if dtend_property\n dtend_property\n elsif duration_property\n (dtstart_property + duration_property)\n else\n dtstart_property\n end\n end", "def end\n ends_at.strftime(\"%R\")\n end", "def ends_at\n @ends_at ||= begin\n if period == :quarter\n starts_at.advance months: length * 3\n else\n starts_at.advance periods => length\n end\n end\n end", "def end_time\n return @start_time + @seconds_to_expiry\n end", "def observed_utc_offset; end", "def observed_utc_offset; end", "def observed_utc_offset; end", "def observed_utc_offset; end", "def end_date_icalendar\n\t\treturn end_date.utc.strftime(\"%Y%m%dT%H%M%S\")\n\tend", "def end_time\n\t\tstart + 1.day\n\tend", "def ending_at\n @ending_at ||= parse_or_at(@attrs[:ending_at]) if @attrs[:ending_at]\n end", "def getEndDate\r\n\t\t\t\t\treturn @endDate\r\n\t\t\t\tend", "def end(value)\n merge(leend: value.iso8601)\n end", "def cycle_end_time\n Time.at(*stats[:start]) + stats[:end]\n end", "def cycle_end_time\n Time.at(*stats[:start]) + stats[:end]\n end", "def end_time\n start_time + treatment.duration.minutes\n end", "def end_of_day_in_seconds\n @end_of_day_in_seconds ||= begin\n seconds_from_time(end_time).tap do |end_of_day_in_seconds|\n unless end_of_day_in_seconds > start_time_in_seconds\n raise(ConfigError, \"END_TIME must be after START_TIME\")\n end\n end\n end\n end", "def get_end_date\n if @params[:end_date].length > 0 && @params[:type] == 'advanced'\n return @params[:end_date].to_date\n else\n return ''\n end\n end", "def end_time=(end_time)\n assert_unloaded\n raise ArgumentError, \"you have already set end_date\" if @end_date\n @end_time = end_time\n end" ]
[ "0.6899383", "0.6835033", "0.66883427", "0.65824455", "0.65572745", "0.6471218", "0.63727134", "0.63727134", "0.63649833", "0.62673056", "0.6201399", "0.6201399", "0.6201399", "0.6201399", "0.6201399", "0.6201399", "0.6200145", "0.6195642", "0.61812514", "0.6168133", "0.6136669", "0.6107607", "0.60659987", "0.60334486", "0.5985167", "0.59769636", "0.5973849", "0.5967796", "0.5967796", "0.5962822", "0.5961481", "0.59481305", "0.5929406", "0.5923448", "0.59205985", "0.5920036", "0.5902025", "0.588009", "0.58258426", "0.58187354", "0.58086383", "0.58086383", "0.5769171", "0.5746105", "0.57427907", "0.5714014", "0.5704157", "0.5671925", "0.56396925", "0.56331563", "0.56302154", "0.5622769", "0.5610193", "0.5609929", "0.5609689", "0.56064165", "0.5595356", "0.558869", "0.5568867", "0.55621535", "0.5558318", "0.55575734", "0.55499405", "0.55238867", "0.5516775", "0.55053324", "0.5497046", "0.54743433", "0.5465823", "0.5463075", "0.5456738", "0.54481226", "0.54432005", "0.5411138", "0.5409023", "0.5392915", "0.5378387", "0.5377951", "0.5351801", "0.5342317", "0.5342317", "0.5342317", "0.5342317", "0.53254056", "0.5316732", "0.53071547", "0.5293161", "0.52847964", "0.52698624", "0.52698624", "0.5259395", "0.52573043", "0.52404135", "0.52328986" ]
0.6962315
6
Sets the endDateTime property value. UTC time when the segment ended. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def end_date_time=(value) @end_date_time = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_date_time=(value)\n @end_date_time = value\n end", "def end_time=(end_time)\n assert_unloaded\n raise ArgumentError, \"you have already set end_date\" if @end_date\n @end_time = end_time\n end", "def end_date=(end_date)\n assert_unloaded\n raise ArgumentError, \"you have already set end_time\" if @end_time\n @end_date = end_date\n end", "def set_end(t)\n @end_t = t\n end", "def end\n @end_time = Time.now.utc\n end", "def end_time=(val)\n write_attribute :end_time, val\n end", "def end_date\n\t \tTime.at(self.end_time) rescue nil\n\t end", "def set_ends_at\n return unless self.duration && self.starts_at\n self.ends_at = starts_at + duration.hours\n end", "def gc_set_end_time\n if end_time.nil?\n self.end_time = start_time\n end\n end", "def end=(new_end)\n @end = new_end ? new_end.to_i : nil\n end", "def end(value)\n merge(cmend: value.iso8601)\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end(value)\n merge(rvend: value.iso8601)\n end", "def end_date_time\n return @end_date_time\n end", "def end_time=(*_args)\n raise_invalid_argument(property_name: :end_time)\n end", "def end_at\n super.in_time_zone(time_zone) if super && time_zone\n end", "def end(value)\n merge(bkend: value.iso8601)\n end", "def end(value)\n merge(grcend: value.iso8601)\n end", "def save_end_at\n self.end_time = Time.zone.parse(\"#{date_published} #{@end_time_input}\" ) if ( @end_time_input.present? && date_published.present? )\n end", "def current_end_time\n self.ends_at = DateTime.current\n save\n end", "def end_time\n eval(self.end) if self.end.present?\n end", "def end(value)\n merge(ucend: value.iso8601)\n end", "def end_time\n ConfigVariable.new(name: 'END_TIME', pattern: TIME_PATTERN, human_pattern: \"HH:MM\").value\n end", "def process_end_time\n if event_params[\"end_time(2i)\"].length == 1\n end_month = \"0\" + event_params[\"end_time(2i)\"]\n else\n end_month = event_params[\"end_time(2i)\"]\n end\n \n # -0600 represents the default timezone of CST\n end_time = event_params[\"end_time(1i)\"] + end_month + event_params[\"end_time(3i)\"] + \"T\" +\n event_params[\"end_time(4i)\"] + \":\" + event_params[\"end_time(5i)\"] + \"-0600\"\n begin\n return DateTime.strptime(end_time, '%Y%m%dT%H:%M%z')\n rescue ArgumentError\n flash[:error] ||= \"End date doesn't exist\"\n return nil\n end\n end", "def end_date\n self.end_at if self.respond_to?(:end_at)\n end", "def end_date\n @end_date ||= respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil\n end", "def end(value)\n merge(gcmend: value.iso8601)\n end", "def review_history_period_end_date_time=(value)\n @review_history_period_end_date_time = value\n end", "def end_date\n @end_date ||= respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil\n end", "def set_end\n @end = End.find(params[:id])\n end", "def local_end\r\n @local_end = at.add_with_convert(@previous_offset.utc_total_offset) unless @local_end \r\n @local_end\r\n end", "def end_date\n Time.parse(@end_date) if @end_date\n end", "def end_date\n Time.parse(@end_date) if @end_date\n end", "def end_time\n data.end_time\n end", "def convert_to_end_at\n\t\tif @start_date.present? && @start_time.present? && @duration.present?\n\t\t\tself.end_at = Time.parse(\"#{@start_date} #{@start_time}\") + (@duration.to_f.hours+ (1.hours))\n\t\tend\n\tend", "def effective_end_datetime\n end_date + 1.day + roster.switchover.minutes\n end", "def end(value)\n merge(leend: value.iso8601)\n end", "def update_shift_end(shift_end)\n raise LogworkException::InvalidTime.new, \"Invalid end time format.\" unless Utilities.valid_time?(shift_end)\n\n shift = data[:shift] || {}\n shift[:end] = shift_end\n data[:shift] = shift\n manager.save_configuration\n end", "def ended_at\n Convert.millis_to_time @gapi.statistics.end_time\n end", "def end_date\n @end_date ||= Date.new()\n end", "def end_of_day\n VoltTime.new(:utc, year, month, day, 23, 59, 59.999)\n end", "def end_time\n end_at.strftime(\"%F\") if end_at\n end", "def ends_at=(val)\n raise Timely::ConfigurationError, \"starts_at must be set before setting ends_at\" unless starts_at\n\n duration_in_seconds = val - starts_at\n period_duration = period == :quarter ? 3.months : 1.send(period)\n\n self.length = (duration_in_seconds.to_f / period_duration).ceil\n\n reset\n end", "def local_end\n @local_end = at.add_with_convert(@previous_offset.utc_total_offset) unless @local_end\n @local_end\n end", "def end_at\n @attributes[:end_at]\n end", "def end_at\n @attributes[:end_at]\n end", "def end_time_input\n @end_time_input || end_time.try(:strftime, \"%H:%M\")\n end", "def dt_end\n return nil unless valid\n\n @current_date + @event_duration\n end", "def end_date=(end_date)\n if !end_date.nil? && end_date.to_s.length > 10\n fail ArgumentError, 'invalid value for \"end_date\", the character length must be smaller than or equal to 10.'\n end\n\n @end_date = end_date\n end", "def end_timestamp\n timestamp + duration if duration\n end", "def setBeginEndTime(bTime, eTime)\n @beginTime = bTime if(!bTime.nil?)\n @endTime = eTime if(!eTime.nil?) ;\n fixSecByBeginEndIfPossible() ;\n end", "def end_date=(end_date)\n validate_end_date_type(end_date)\n validate_history_range(start_date, end_date)\n @end_date = end_date\n end", "def setEndDateFormat(endDateFormat)\r\n\t\t\t\t\t@endDateFormat = endDateFormat\r\n\t\t\t\tend", "def end_date\n @end_date ||= respond_to?(:parliamentPeriodEndDate) ? DateTime.parse(parliamentPeriodEndDate) : nil\n end", "def end_time(person_or_type = nil)\n attribute_for_audience_with_generic(:end_time, person_or_type)\n end", "def set_start_end_time\n @start_date = Time.zone.local(*params[:reservation].sort.map(&:last)\n .map(&:to_i))\n @end_date = @start_date + params[:hours].to_i.hours\n end", "def end_date=(date)\n date = IncompleteDate.new date unless date.is_a? IncompleteDate or date.nil?\n @end_date = date\n end", "def local_end_at\n Timestamp.new(@timestamp_value, 0, @previous_offset.utc_total_offset)\n end", "def end_date\n @end_date ||= respond_to?(:partyMembershipEndDate) ? DateTime.parse(partyMembershipEndDate) : nil\n end", "def setEndDate(endDate)\r\n\t\t\t\t\t@endDate = endDate\r\n\t\t\t\tend", "def ends_at(user)\n tz = ActiveSupport::TimeZone.new(user.time_zone)\n\n if end_date.nil?\n tz.local(start_date.year, start_date.month, start_date.day).end_of_day\n else\n tz.local(end_date.year, end_date.month, end_date.day).end_of_day\n end\n end", "def ends_at\n started_at + client.clock_delta + length if started_at\n end", "def end(value)\n merge(gadrend: value.iso8601)\n end", "def end_time\n @parts.last.end_time\n end", "def end_date\n (Time.parse(@end_date).in_time_zone(@timezone).to_datetime if @end_date) || Date.today + 7.days\n end", "def set_EndSleepTime(value)\n set_input(\"EndSleepTime\", value)\n end", "def end_time\n return nil if empty?\n @start_time + (@v.size-1).hours\n end", "def fancy_end_at(event)\n tz_aware_end_date = event.end_at.in_time_zone(@event.timezone.source)\n\n if event.start_at + 1.day > event.end_at\n t(\"events.show.end_time.hours\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n elsif event.start_at + 2.days > event.end_at\n t(\"events.show.end_time.next_day\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n else\n t(\"events.show.end_time.arbitrary\", time: l(tz_aware_end_date, format: :default))\n end\n end", "def time_ended=(value)\n @time_ended = value\n end", "def ending_at(date)\n set_end_date_and_raise_error_if_end_is_eariler_than_start(date)\n self\n end", "def _record_end_time(records)\n end_time = DateTime.now\n unless records.empty?\n records.each do |record|\n record.end_at = end_time\n record.updated_at = end_time\n record.total_time += record.time_diff\n end\n end\n end", "def end_time_string\n\t\tend_time.to_s(:time) if end_time\n\tend", "def set_duration\n if self.end_time\n # self.duration = (end_time - start_time).to_i\n self.duration = (end_time - start_time).to_i\n else\n self.duration = DEFAULT_DURATION\n self.end_time = self.start_time + self.duration\n end\n end", "def end_of_day_in_seconds\n @end_of_day_in_seconds ||= begin\n seconds_from_time(end_time).tap do |end_of_day_in_seconds|\n unless end_of_day_in_seconds > start_time_in_seconds\n raise(ConfigError, \"END_TIME must be after START_TIME\")\n end\n end\n end\n end", "def end=(pt_or_entity)\n end", "def reset_end!\n @end = nil\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "def end(value)\n merge(orend: value.iso8601)\n end", "def end_time\n start_time + event.event_type.length.minutes\n end", "def end_formatted\n display_time read_attribute(:end)\n end", "def synthesize_end_date(params)\n Date.civil(params[:end_time][:year].to_i, params[:end_time][:month].to_i,\n params[:end_time][:day].to_i)\n end", "def end_time_after_start_time\n if self.end_time && self.end_time < self.start_time\n self.errors.add(:end_time, \"The end time must be after the start time\")\n end\n end" ]
[ "0.7250783", "0.6844995", "0.6517433", "0.6500622", "0.64702785", "0.6449737", "0.6152687", "0.61392915", "0.6139184", "0.60937876", "0.60534513", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60373616", "0.60180366", "0.599716", "0.59950686", "0.5955864", "0.59360224", "0.590422", "0.5878298", "0.5875524", "0.58302677", "0.57890403", "0.5754582", "0.57406765", "0.57099134", "0.57024", "0.5692661", "0.5689765", "0.564702", "0.5646588", "0.56396794", "0.5634463", "0.5634463", "0.56308854", "0.56126505", "0.560569", "0.5556041", "0.5555277", "0.554599", "0.55235493", "0.55200636", "0.54983956", "0.54909915", "0.5490185", "0.5453138", "0.5453138", "0.54349846", "0.5433671", "0.54191667", "0.5382122", "0.5355303", "0.5341352", "0.53312916", "0.5328988", "0.5328628", "0.5326539", "0.5305511", "0.52843654", "0.52831465", "0.52740186", "0.5242339", "0.52421844", "0.5234122", "0.52331936", "0.5220829", "0.52184254", "0.52075046", "0.5200769", "0.5197295", "0.5166217", "0.51613116", "0.5135", "0.5131824", "0.51086956", "0.5088348", "0.5070643", "0.50507796", "0.50507796", "0.50507796", "0.50507796", "0.50507796", "0.50507796", "0.50507796", "0.5039095", "0.5037314", "0.50208867", "0.5011721", "0.5009204" ]
0.73430943
5
Gets the failureInfo property value. Failure information associated with the segment if it failed.
def failure_info return @failure_info end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def failure_info=(value)\n @failure_info = value\n end", "def get_FailureDescription()\n \t return @outputs[\"FailureDescription\"]\n \tend", "def failure_message\n @message\n end", "def failure_type\n @attributes[:failure_type]\n end", "def error_details\n return @error_details\n end", "def display_failures\n @data[\"display_failures\"]\n end", "def failure_message\n build_failure_message(negated: false)\n end", "def failure_date_time\n return @failure_date_time\n end", "def failure_validation_value\n field = validation_result.errors.keys.first\n {\n error: 'ValidationError',\n field: field,\n reason: \"#{field}: #{validation_result.errors[field].first}\"\n }\n end", "def failure_message\n messages = [subject.inspect]\n attributes.each do |attribute|\n messages << subject.errors.full_messages_for(attribute)\n end\n messages.compact.join(\"\\n\")\n end", "def failure_column\n terminal_failures && input.column_of(failure_index)\n end", "def info\n if @succeeded then 'Success' else \"Failure message='#{@message}'\" end\n end", "def error\n @data['error']\n end", "def error\n @data['error']\n end", "def error_message_segment\n return unless error_segment\n error_segment[error_segment.index(\"200\")..-1]\n end", "def error\n data['error']\n end", "def failure_message\n @failures.map(&:failure_message).join(\" and \")\n end", "def error\n @obj['error']\n end", "def error_message\n @data[\"message\"]\n end", "def error_message\n @response_attributes['ErrorMessage'];\n end", "def failure\n @failure.call(self) if @failure\n end", "def failure_handling\n attributes.fetch(:failureHandling)\n end", "def error_details\n msg = ''\n @runner.failures.each do |checker|\n # msg << error(\"------- #{checker.name} -------\") << \"\\n\"\n # msg << error(\"#{checker.hint}\") << \"\\n\"\n checker.errors.details.each do |type, content|\n case type\n when :source\n content.each_line.with_index do |l, i|\n msg << yellow((i + 1).to_s.rjust(3)) << '|' << l\n end\n when Integer\n msg << info('Line: ') << yellow(type) << '|' << info(content)\n when Array\n msg << info('Pos: ') << yellow(type.join(',')) << '|' << info(content)\n when nil\n msg << info(content)\n end\n msg << \"\\n\"\n end\n end\n msg\n end", "def warning\n return @warning\n end", "def details\n response = cs_get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def failure_line\n terminal_failures && input.line_of(failure_index)\n end", "def message\n @error['message']\n end", "def error_message\n return @error_message\n end", "def failure_message\n if @found\n \"\\nexpected: #{@expect}\\n got: #{@actual}\\n\"\n else\n \"\\nCould not find a snapshot at #{snap_path}.\\n Failing \" \\\n \"instead of creating; save_snapshots is set to #{save_config}.\"\n end\n end", "def failures\n Hash[status.map { |device_key, v| [device_key, v[\"message\"]] } ]\n end", "def failure(msg)\n Detail::Fail.new(msg)\n end", "def diagnostics\n attributes.fetch(:diagnostics)\n end", "def diagnostics\n attributes.fetch(:diagnostics)\n end", "def diagnostics\n attributes.fetch(:diagnostics)\n end", "def verification_failed_message\n return \"Verification Failed\"\n end", "def full_error\n @response_attributes['FullError'];\n end", "def failure\n @failure.call(self) if @failure\n end", "def failed_message\n Online::OPERATION_FAILED_ADVICES[@data['error_code'].to_i || \"Errore sconosciuto (#{error_code})\"]\n end", "def query_failure_type\n @attributes[:query_failure_type]\n end", "def failed_text\n 'Failed: %d' % failed\n end", "def retry_failure_details(retry_key)\n if retry_key\n Resque.decode(Resque.redis.get(\"failure-#{retry_key}\"))\n else\n nil\n end\n end", "def failure_message(tally)\n failures = tally.instance_eval { @failures }\n failures.first.instance_eval { @message }\n end", "def details\n response = @create_send.get \"/segments/#{segment_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def failure\n if !block_given?\n if @cached_failure != nil\n return @cached_failure\n end\n return @cached_failure = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:failure, []).call(),::VertxUnit::Failure)\n end\n raise ArgumentError, \"Invalid arguments when calling failure()\"\n end", "def failure_message\n \"validation failed with #{@errors.inspect}, expected no validation errors\"\n end", "def failure\n @status = FAILURE_FLAG if @status == SUCCESS_FLAG\n end", "def error\n params[\"ErrDesc\"]\n end", "def failure_message; end", "def failure_message; end", "def failure_message; end", "def failure_message; end", "def failure_message; end", "def failure_message; end", "def failure_message; end", "def to_s\n error.nil? ? 'Failure()' : \"Failure(#{error.inspect})\"\n end", "def message # :nodoc:\n @properties['errorMessage'].dup\n end", "def message\n (job = delayed_job) && job.failed? ?\n job.last_error.lines.first.chomp.gsub(/^\\{/, '') :\n status.humanize\n end", "def failure?\n @status == FAILURE_FLAG\n end", "def dump_failure(counter, failure)\n end", "def dump_failure(counter, failure)\n end", "def failure_message\n @message += \"Expected: #{@expected}\\n\\n\"\n @message += \"Actual: #{@actual}\\n\\n\"\n @message += \"Differences\\n\\n\"\n\n add_diff_to_message(@actual, @expected)\n\n @message\n end", "def extract_error_details response\n if\n (response.http_response.status >= 300 ||\n response.request_type == :complete_multipart_upload) and\n body = response.http_response.body and\n error = Core::XML::Parser.parse(body) and\n error[:code]\n then\n [error[:code], error[:message]]\n end\n end", "def result_info\n return @result_info\n end", "def result_info\n return @result_info\n end", "def getError\n return @error\n end", "def failure_info(log_args)\n alert.send(failure_method, *log_args)\n end", "def error_segment\n segment(100)\n end", "def results_errno()\n r = attr_get(\"status\")\n if(r.eql?(\"passed\"))\n 0\n end\n r = attr_get(\"errno\")\n unless r\n r = -1\n end\n r\n end", "def failure_message(activity)\n case activity\n when 'skip_fact_check' then \"Could not skip fact check for this publication.\"\n when 'start_work' then \"Couldn't start work on #{description(resource).downcase}\"\n else \"Couldn't #{activity.to_s.humanize.downcase} for #{description(resource).downcase}\"\n end\n end", "def failure(failure_data)\n @current_status = :failure\n\n logger.error 'Failure(s) reported :'\n [*failure_data.errors].each { |e| logger.error \"\\t#{e}\" }\n\n add_failed_object(failure_data)\n\n failure_data.destroy_failed_object if(DataShift::Loaders::Configuration.call.destroy_on_failure)\n end", "def is_failed\n @status == Status::FAILURE\n end", "def failure_message\n if found.nil?\n found_count = 'none'\n found_string = nil\n else\n materialized_found = found.to_a\n found_count = \"#{materialized_found.length}:\"\n found_string = materialized_found.map {|job| strategy.pretty_print_job(job) }.join(\"\\n\")\n end\n [\n \"expected #{expected_count || 'any number of'} jobs matching #{expected.to_s},\",\n \"found #{found_count}\",\n found_string,\n ].compact.join(' ')\n end", "def error_details=(value)\n @error_details = value\n end", "def success\n @attributes[:success]\n end", "def success\n @attributes[:success]\n end", "def failed_at\n Time.at(self[Job::WORKFLOW_FINISHED_AT_FIELD].to_f) if failed?\n end", "def error_message\n @response.reason_phrase\n end", "def failed?\n\t\t\t\t@statistics.failed?\n\t\t\tend", "def retrieve_details(document)\n return nil unless document\n if wce = document['writeConcernError']\n return wce['errInfo']\n elsif we = document['writeErrors']&.first\n return we['errInfo']\n end\n end", "def error_message\n err = details[\"err\"] || details[\"errmsg\"] || details[\"$err\"]\n if code = details[\"code\"]\n \"failed with error #{code}: #{err.inspect}\\n\\n\" <<\n \"See #{ERROR_REFERENCE}\\nfor details about this error.\"\n elsif code = details[\"assertionCode\"]\n assertion = details[\"assertion\"]\n \"failed with error #{code}: #{assertion.inspect}\\n\\n\" <<\n \"See #{ERROR_REFERENCE}\\nfor details about this error.\"\n else\n \"failed with error #{err.inspect}\"\n end\n end", "def duration\n @data['duration']['value']\n end", "def message\n @errormsg\n end", "def extract_error_details response\n raise NotImplementedError\n end", "def errored_files\n @attributes[:errored_files]\n end", "def status_message\n @data[:status_message]\n end", "def stderr\n instance.options[:stderr]\n end", "def stderr\n instance.options[:stderr]\n end", "def status_infos\n data[:status_infos]\n end", "def stderr\n @result.stderr\n end", "def error\n return @error\n end", "def error\n return if success? unless parse_error?\n @data['error'] || @data['message']\n end", "def error\n @current_offset\n end", "def failed_count\n return @failed_count\n end", "def to_s\n return @error_description\n end", "def status_details(exception)\n StatusDetails.new(message: exception&.message, trace: exception&.backtrace&.join(\"\\n\"))\n end", "def stderr\n @cmd_result.stderr\n end", "def error_message\n self[:error_message]\n end", "def failure_message\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@metadata[:name])\n\n if @metadata[:args].count > 0\n args = prettify_args(*@metadata[:args])\n\n \"'#{actual}' should #{matcher} '#{args}'\"\n else\n \"'#{actual}' should #{matcher}\"\n end\n end", "def value!\n raise Result::Error, 'Failure objects do not have value'\n end", "def error\n get_ingest_run.error\n end" ]
[ "0.72006786", "0.608494", "0.60647535", "0.58346087", "0.57439595", "0.5595279", "0.5586554", "0.5483551", "0.5422048", "0.5390115", "0.5385124", "0.53712237", "0.53430057", "0.53430057", "0.5338135", "0.5261866", "0.5255741", "0.51621836", "0.5144921", "0.5144702", "0.51390153", "0.51164114", "0.50864816", "0.50805223", "0.50601643", "0.5042483", "0.50241387", "0.50130075", "0.49895746", "0.4987231", "0.4968651", "0.49575168", "0.49575168", "0.49575168", "0.49506652", "0.49398136", "0.49389532", "0.49278155", "0.4918704", "0.49149808", "0.4912787", "0.49081165", "0.49064317", "0.48960543", "0.4880816", "0.48789847", "0.48764104", "0.4861553", "0.4861553", "0.4861553", "0.4861553", "0.4861553", "0.4861553", "0.4861553", "0.48484468", "0.48479262", "0.48444408", "0.48321724", "0.48224115", "0.48224115", "0.48162404", "0.4785335", "0.4768407", "0.4768407", "0.47616634", "0.4757534", "0.47434548", "0.47404057", "0.4738487", "0.4712803", "0.4711116", "0.4705511", "0.47035703", "0.4697692", "0.4697692", "0.46950957", "0.46864143", "0.46779823", "0.46673092", "0.46624017", "0.46563798", "0.4656296", "0.46545777", "0.46443906", "0.46411163", "0.46286204", "0.46286204", "0.46155104", "0.46075293", "0.46023178", "0.4596641", "0.4596362", "0.4587281", "0.45864373", "0.4572667", "0.45601118", "0.45593166", "0.45575514", "0.4551543", "0.45481816" ]
0.78241456
0
Sets the failureInfo property value. Failure information associated with the segment if it failed.
def failure_info=(value) @failure_info = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info=(info)\n if info.nil?\n fail ArgumentError, 'invalid value for \"info\", info cannot be nil.'\n end\n @info = info\n end", "def failure_info\n return @failure_info\n end", "def mark_failure\n self.failure_occurred = true\n end", "def mark_failure\n self.failure_occurred = true\n end", "def info=(info)\n check_is_a!(info, ::Dopp::Section::Info)\n @attributes[:Info] = info.ref\n end", "def fail(task, error)\n @failure = error\n @complete = true\n end", "def failure_method=(val)\n @_failure_method = val if %w(:warn :fail).include(val)\n end", "def failure\n @failure.call(self) if @failure\n end", "def failure_date_time=(value)\n @failure_date_time = value\n end", "def failure(failure_data)\n @current_status = :failure\n\n logger.error 'Failure(s) reported :'\n [*failure_data.errors].each { |e| logger.error \"\\t#{e}\" }\n\n add_failed_object(failure_data)\n\n failure_data.destroy_failed_object if(DataShift::Loaders::Configuration.call.destroy_on_failure)\n end", "def failure\n @status = FAILURE_FLAG if @status == SUCCESS_FLAG\n end", "def failure\n @failure.call(self) if @failure\n end", "def info=(value)\n @info = value\n end", "def partial_failure=(value)\n @credential_handler.partial_failure = value\n end", "def set_failure\n @failure = Failure.find(params[:id]) if params[:id]\n @devices = Device.all_active\n @employees = Employee.all_active\n @technicians = Employee.all_technicians\n end", "def warning=(value)\n @warning = value\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n end", "def set_failure_message(msg)\n @failure_message = \"#{FailureMessages::OBJECT_PREFIX} #{msg}\"\n false\n end", "def failure!(message = nil, options = {})\n ensure_empty_status!\n\n errors.add(:base, message, options) if message.present?\n\n self.performable_status = :failure\n self\n end", "def failure_has_occurred!\r\n @failure_has_occurred = true\r\n end", "def error_details=(value)\n @error_details = value\n end", "def failure(exc=nil, record_number=nil)\n if exc\n self.exception = JobException.from_exception(exc)\n exception.server_name = server_name\n exception.record_number = record_number\n end\n self.failure_count = failure_count.to_i + 1\n self.server_name = nil\n fail\n end", "def error=(val)\n @error = val\n self.state = 'error'\n end", "def failed_count=(value)\n @failed_count = value\n end", "def custom_failure!\n @custom_failure = true\n end", "def set_failure_message(msg)\n @failure_message = \"#{FailureMessages::GENERAL_PREFIX} #{msg}\"\n false\n end", "def setAccessInfo(accessInfo)\n if accessInfo\n @accessInfo = accessInfo\n else\n @accessInfo = nil\n end\n end", "def result_info=(value)\n @result_info = value\n end", "def result_info=(value)\n @result_info = value\n end", "def failed_tasks=(value)\n @failed_tasks = value\n end", "def failed_tasks=(value)\n @failed_tasks = value\n end", "def dump_failure(counter, failure)\n end", "def dump_failure(counter, failure)\n end", "def failed_tasks_count=(value)\n @failed_tasks_count = value\n end", "def on_failure(message)\n @status.update_attributes(:failures=>(@status.failures+1) )\n @logger.error message\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n logger.info \"\\n\\n#{@err_msg}\\n\\n\"\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n logger.info \"\\n\\n#{@err_msg}\\n\\n\"\n end", "def failure(err_msg)\n @fail = true\n @err_msg = err_msg\n logger.info \"\\n\\n#{@err_msg}\\n\\n\"\n end", "def increment_failure_of(setting_name)\n self[setting_name][:failures] += 1\n\n current_profile = Profile.current\n increment_profile_failure_of(current_profile.name) if current_profile\n\n Sail.reset(setting_name) if self[setting_name][:failures] > Sail.configuration.failures_until_reset\n end", "def failed_runs=(value)\n @failed_runs = value\n end", "def fail(description, message, line, file)\n print yellow(\"F\")\n @details << \"FAILURE - #{test_detail(description, message)} #{line_info(line, file)}\".strip\n end", "def failure(job)\n self.successful = true\n self.complete = true\n self.state = 'Failed'\n update_sync_job\n end", "def error=(value)\n @error = value\n end", "def failure_message\n build_failure_message(negated: false)\n end", "def error=(value)\n doc['error'] = value.nil? ? nil : value.to_s\n end", "def failed_users=(value)\n @failed_users = value\n end", "def set_error(error)\n @mutex.synchronize { @task_error = error }\n end", "def set_fail\n @fail = Fail.find(params[:id])\n end", "def failure_has_not_occurred!\r\n @failure_has_occurred = false\r\n end", "def meeting_info=(value)\n @meeting_info = value\n end", "def failure\n if !block_given?\n if @cached_failure != nil\n return @cached_failure\n end\n return @cached_failure = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:failure, []).call(),::VertxUnit::Failure)\n end\n raise ArgumentError, \"Invalid arguments when calling failure()\"\n end", "def on_failure( &block )\n @on_failure = block\n end", "def faulty(aReason)\n @failure_reason = aReason\n end", "def update_failures!(failure, error, recs = nil)\n msg = error.to_s\n ids = recs&.map { |rec| manifest_item_id(rec) } || failure.keys\n ids.each do |id|\n if !failure[id]\n failure[id] = { error: msg }\n elsif !failure[id].is_a?(Hash)\n failure[id] = { error: [*failure[id], msg].uniq.join('; ') }\n else\n failure[id][:error] = [*failure[id][:error], msg].uniq.join('; ')\n end\n end\n end", "def processor_speed_check_failed_percentage=(value)\n @processor_speed_check_failed_percentage = value\n end", "def fail\n now = Time.now\n update_attributes(failed_at: now, completed_at: now)\n end", "def mean_time_to_failure_in_minutes=(value)\n @mean_time_to_failure_in_minutes = value\n end", "def mean_time_to_failure_in_minutes=(value)\n @mean_time_to_failure_in_minutes = value\n end", "def failure_message\n @message\n end", "def trigger_failure(data=nil)\n event.success = false\n event.data = data\n event.trigger\n end", "def failure(msg)\n Detail::Fail.new(msg)\n end", "def fail\n @counts.fails += 1\n puts_failure_data(header: FAIL_HEADER)\n end", "def failed_users_count=(value)\n @failed_users_count = value\n end", "def add_failure field_name:\n @failures << field_name\n end", "def update_failure\n logger.exception(\"Failed to connect to broker #{@alias}\")\n if @last_failed\n @retries += 1\n else\n @last_failed = true\n @retries = 0\n @failure_stats.update\n end\n true\n end", "def information=(info)\n self[:information] = info.force_encoding('UTF-8')\n end", "def trans_info=(trans_info)\n if !trans_info.nil? && trans_info.to_s.length > 50\n fail ArgumentError, 'invalid value for \"trans_info\", the character length must be smaller than or equal to 50.'\n end\n\n @trans_info = trans_info\n end", "def fail\n @failed = true\n end", "def cainfo=(value)\n Curl.set_option(:cainfo, value_for(value, :string), handle)\n end", "def override_failure_callback(&blk)\n @failure_callback = blk\n end", "def fail_student(student_name, test_name)\n boating_tests.map do |test|\n test.boating_test_status = \"Failed\"\n end\n end", "def report_failure\n @report.fail\n end", "def report_failure\n @report.fail\n end", "def set_membership_changed_info\n @membership_changed_info = \"membership status changed from #{aasm.from_state} to #{aasm.to_state} (event: #{aasm.current_event})\"\n end", "def failure_type\n @attributes[:failure_type]\n end", "def successful_call=(value)\n @successful_call = value\n end", "def success!(info = nil)\n @logger.error { info } if info\n @successes += 1\n end", "def debug_context_change=(val)\n Ruby.primitive :task_set_debug_context_change\n Kernel.raise PrimitiveFailure, \"primitive failed\"\n end", "def record_failure(metric, opts = {})\n record_status(metric, false, opts)\n end", "def update\n access(:update)\n checked_params = check_params(FAILURE_PROPERTIES)\n checked_params[\"device\"] = Device.find(failure_params[\"device_id\"])\n checked_params[\"announcer\"] = Employee.find(failure_params[\"announcer_id\"])\n if failure_params[\"technician_id\"]\n checked_params[\"technician\"] = Employee.find(failure_params[\"technician_id\"])\n end\n\n respond_to do |format|\n if @failure.update(checked_params)\n format.html { redirect_to @failure}\n format.json { render :show, status: :ok, location: @failure }\n else\n format.html { render :edit }\n format.json { render json: @failure.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_violation_description\n @violation_description = ViolationDescription.find(params[:id])\n end", "def fail(this_task, error)\n @__context__.fail(this_task, error)\n end", "def error_bar=(val)\n @error_bar = check_error_bar(val)\n end", "def failure(failure_details, args = {})\n task_failure_id = args[:task_failure_id]\n data = failure_details.merge({:exception => args[:exception].to_s})\n attrs = {\n :failure_details => data.to_yaml,\n :status => args[:status] || 'failure'\n }\n if task_failure_id.nil?\n Melinis::TaskFailure.create!({\n :task_processing_id => @current_run.id,\n :task_id => @task.id\n }.merge(attrs))\n else\n task_failure = Melinis::TaskFailure.find_by_id(task_failure_id)\n task_failure.increment(:retry_count).update_attributes(attrs)\n end\n end", "def secure_boot_check_failed_percentage=(value)\n @secure_boot_check_failed_percentage = value\n end", "def handle_failed_option param, value\n @options_ok = false\n end", "def on_failure(&block)\n @handlers[:failure] = block\n self\n end", "def add_failure(failure)\n self.failures = [] if self.failures.nil?\n self.failures << failure\n end", "def edit_info_error_label\n # unit_test_no_generate: edit_info_error_label, div.className(create_ats_regex_string(\"ats-editinfoerrorlbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(div.className(create_ats_regex_string(\"ats-editinfoerrorlbl\")), __method__)\n end", "def failed!\n @success = false\n end", "def failure_reason=(failure_reason)\n validator = EnumAttributeValidator.new('String', [\"unknown\", \"expired\", \"failed_to_prepare\"])\n unless validator.valid?(failure_reason)\n fail ArgumentError, \"invalid value for 'failure_reason', must be one of #{validator.allowable_values}.\"\n end\n @failure_reason = failure_reason\n end", "def fail!\n @success = false\n end", "def custom_extension_stage_instance_detail=(value)\n @custom_extension_stage_instance_detail = value\n end", "def set_info\n @info = Info.first\n end", "def error=(value) @error = true; end", "def failure_message\n if @found\n \"\\nexpected: #{@expect}\\n got: #{@actual}\\n\"\n else\n \"\\nCould not find a snapshot at #{snap_path}.\\n Failing \" \\\n \"instead of creating; save_snapshots is set to #{save_config}.\"\n end\n end", "def error_message=(value)\n @error_message = value\n end" ]
[ "0.5522867", "0.530572", "0.52207434", "0.52207434", "0.5138425", "0.5030642", "0.5016718", "0.5009727", "0.49940568", "0.49915618", "0.4876344", "0.4859861", "0.48050398", "0.4708275", "0.46937415", "0.46845797", "0.46688893", "0.46688893", "0.46688893", "0.46688893", "0.46426892", "0.46400508", "0.46331778", "0.4632622", "0.46242115", "0.4601601", "0.45956787", "0.45577678", "0.4549407", "0.45470297", "0.4536499", "0.4536499", "0.45235425", "0.45235425", "0.44653103", "0.44653103", "0.44403142", "0.44341248", "0.4420061", "0.4420061", "0.4420061", "0.44127634", "0.4397755", "0.4392043", "0.43658087", "0.43564442", "0.4344662", "0.43374938", "0.43307808", "0.4283019", "0.42703733", "0.426395", "0.4250543", "0.4250145", "0.4243934", "0.4234713", "0.42173997", "0.42075115", "0.42049512", "0.4196555", "0.4196555", "0.41891024", "0.41700062", "0.4162727", "0.41597244", "0.4134513", "0.4122616", "0.41208383", "0.41133693", "0.41026345", "0.40967035", "0.40916133", "0.40906304", "0.40857926", "0.40798587", "0.40798587", "0.40786636", "0.40760383", "0.40757588", "0.4069593", "0.40678364", "0.40662315", "0.40648183", "0.40608013", "0.40513536", "0.40513483", "0.40466496", "0.40376014", "0.40301782", "0.40290314", "0.4028961", "0.4021811", "0.401514", "0.4008144", "0.39960253", "0.39945427", "0.3992983", "0.39829054", "0.39771685", "0.39723352" ]
0.7837434
0
The deserialization information for the current model
def get_field_deserializers() return super.merge({ "callee" => lambda {|n| @callee = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallRecordsEndpoint.create_from_discriminator_value(pn) }) }, "caller" => lambda {|n| @caller = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallRecordsEndpoint.create_from_discriminator_value(pn) }) }, "endDateTime" => lambda {|n| @end_date_time = n.get_date_time_value() }, "failureInfo" => lambda {|n| @failure_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallRecordsFailureInfo.create_from_discriminator_value(pn) }) }, "media" => lambda {|n| @media = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRecordsMedia.create_from_discriminator_value(pn) }) }, "startDateTime" => lambda {|n| @start_date_time = n.get_date_time_value() }, }) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end", "def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"fileDetails\" => lambda {|n| @file_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n })\n end", "def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end", "def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"detectionType\" => lambda {|n| @detection_type = n.get_string_value() },\n \"method\" => lambda {|n| @method = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n \"weight\" => lambda {|n| @weight = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"maxImageSize\" => lambda {|n| @max_image_size = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"timeout\" => lambda {|n| @timeout = n.get_duration_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"applicationVersion\" => lambda {|n| @application_version = n.get_string_value() },\n \"headerValue\" => lambda {|n| @header_value = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"callEndSubReason\" => lambda {|n| @call_end_sub_reason = n.get_number_value() },\n \"callType\" => lambda {|n| @call_type = n.get_string_value() },\n \"calleeNumber\" => lambda {|n| @callee_number = n.get_string_value() },\n \"callerNumber\" => lambda {|n| @caller_number = n.get_string_value() },\n \"correlationId\" => lambda {|n| @correlation_id = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_number_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"failureDateTime\" => lambda {|n| @failure_date_time = n.get_date_time_value() },\n \"finalSipCode\" => lambda {|n| @final_sip_code = n.get_number_value() },\n \"finalSipCodePhrase\" => lambda {|n| @final_sip_code_phrase = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"inviteDateTime\" => lambda {|n| @invite_date_time = n.get_date_time_value() },\n \"mediaBypassEnabled\" => lambda {|n| @media_bypass_enabled = n.get_boolean_value() },\n \"mediaPathLocation\" => lambda {|n| @media_path_location = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"signalingLocation\" => lambda {|n| @signaling_location = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"successfulCall\" => lambda {|n| @successful_call = n.get_boolean_value() },\n \"trunkFullyQualifiedDomainName\" => lambda {|n| @trunk_fully_qualified_domain_name = n.get_string_value() },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"imageFile\" => lambda {|n| @image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n \"parentProcessCreationDateTime\" => lambda {|n| @parent_process_creation_date_time = n.get_date_time_value() },\n \"parentProcessId\" => lambda {|n| @parent_process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"parentProcessImageFile\" => lambda {|n| @parent_process_image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"processCommandLine\" => lambda {|n| @process_command_line = n.get_string_value() },\n \"processCreationDateTime\" => lambda {|n| @process_creation_date_time = n.get_date_time_value() },\n \"processId\" => lambda {|n| @process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"userAccount\" => lambda {|n| @user_account = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityUserAccount.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::OperationStatus) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"progress\" => lambda {|n| @progress = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DataPolicyOperationStatus) },\n \"storageLocation\" => lambda {|n| @storage_location = n.get_string_value() },\n \"submittedDateTime\" => lambda {|n| @submitted_date_time = n.get_date_time_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"completedUnits\" => lambda {|n| @completed_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"progressObservationDateTime\" => lambda {|n| @progress_observation_date_time = n.get_date_time_value() },\n \"totalUnits\" => lambda {|n| @total_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"units\" => lambda {|n| @units = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"provisioningStepType\" => lambda {|n| @provisioning_step_type = n.get_enum_value(MicrosoftGraph::Models::ProvisioningStepType) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ProvisioningResult) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"downloadUri\" => lambda {|n| @download_uri = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fulfilledDateTime\" => lambda {|n| @fulfilled_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodEndDateTime\" => lambda {|n| @review_history_period_end_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodStartDateTime\" => lambda {|n| @review_history_period_start_date_time = n.get_date_time_value() },\n \"runDateTime\" => lambda {|n| @run_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AccessReviewHistoryStatus) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end", "def read_object\n if @version == 0\n return amf0_deserialize\n else\n return amf3_deserialize\n end\n end", "def get_field_deserializers()\n return {\n \"destinationFileName\" => lambda {|n| @destination_file_name = n.get_string_value() },\n \"sourceFile\" => lambda {|n| @source_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return {\n \"newText\" => lambda {|n| @new_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"numBytes\" => lambda {|n| @num_bytes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"oldText\" => lambda {|n| @old_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"startNum\" => lambda {|n| @start_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"audioDeviceName\" => lambda {|n| @audio_device_name = n.get_string_value() },\n \"bookingType\" => lambda {|n| @booking_type = n.get_enum_value(MicrosoftGraph::Models::BookingType) },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"capacity\" => lambda {|n| @capacity = n.get_number_value() },\n \"displayDeviceName\" => lambda {|n| @display_device_name = n.get_string_value() },\n \"emailAddress\" => lambda {|n| @email_address = n.get_string_value() },\n \"floorLabel\" => lambda {|n| @floor_label = n.get_string_value() },\n \"floorNumber\" => lambda {|n| @floor_number = n.get_number_value() },\n \"isWheelChairAccessible\" => lambda {|n| @is_wheel_chair_accessible = n.get_boolean_value() },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"nickname\" => lambda {|n| @nickname = n.get_string_value() },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"videoDeviceName\" => lambda {|n| @video_device_name = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"targetType\" => lambda {|n| @target_type = n.get_enum_value(MicrosoftGraph::Models::FeatureTargetType) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"activationUrl\" => lambda {|n| @activation_url = n.get_string_value() },\n \"activitySourceHost\" => lambda {|n| @activity_source_host = n.get_string_value() },\n \"appActivityId\" => lambda {|n| @app_activity_id = n.get_string_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"contentInfo\" => lambda {|n| @content_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fallbackUrl\" => lambda {|n| @fallback_url = n.get_string_value() },\n \"historyItems\" => lambda {|n| @history_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ActivityHistoryItem.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::Status) },\n \"userTimezone\" => lambda {|n| @user_timezone = n.get_string_value() },\n \"visualElements\" => lambda {|n| @visual_elements = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VisualInfo.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"malwareIdentifier\" => lambda {|n| @malware_identifier = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"lastActionDateTime\" => lambda {|n| @last_action_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operation\" => lambda {|n| @operation = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"identityType\" => lambda {|n| @identity_type = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"dataLocationCode\" => lambda {|n| @data_location_code = n.get_string_value() },\n \"hostname\" => lambda {|n| @hostname = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Root.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return {\n \"address\" => lambda {|n| @address = n.get_string_value() },\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"relevanceScore\" => lambda {|n| @relevance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"selectionLikelihood\" => lambda {|n| @selection_likelihood = n.get_enum_value(MicrosoftGraph::Models::SelectionLikelihoodInfo) },\n }\n end", "def get_field_deserializers()\n return {\n \"hashes\" => lambda {|n| @hashes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Hashes.create_from_discriminator_value(pn) }) },\n \"mimeType\" => lambda {|n| @mime_type = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"processingMetadata\" => lambda {|n| @processing_metadata = n.get_boolean_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"configurationVersion\" => lambda {|n| @configuration_version = n.get_number_value() },\n \"errorCount\" => lambda {|n| @error_count = n.get_number_value() },\n \"failedCount\" => lambda {|n| @failed_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"notApplicableCount\" => lambda {|n| @not_applicable_count = n.get_number_value() },\n \"pendingCount\" => lambda {|n| @pending_count = n.get_number_value() },\n \"successCount\" => lambda {|n| @success_count = n.get_number_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"format\" => lambda {|n| @format = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookChartDataLabelFormat.create_from_discriminator_value(pn) }) },\n \"position\" => lambda {|n| @position = n.get_string_value() },\n \"separator\" => lambda {|n| @separator = n.get_string_value() },\n \"showBubbleSize\" => lambda {|n| @show_bubble_size = n.get_boolean_value() },\n \"showCategoryName\" => lambda {|n| @show_category_name = n.get_boolean_value() },\n \"showLegendKey\" => lambda {|n| @show_legend_key = n.get_boolean_value() },\n \"showPercentage\" => lambda {|n| @show_percentage = n.get_boolean_value() },\n \"showSeriesName\" => lambda {|n| @show_series_name = n.get_boolean_value() },\n \"showValue\" => lambda {|n| @show_value = n.get_boolean_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"errorDetails\" => lambda {|n| @error_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::GenericError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n \"targetId\" => lambda {|n| @target_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"contentSource\" => lambda {|n| @content_source = n.get_string_value() },\n \"hitId\" => lambda {|n| @hit_id = n.get_string_value() },\n \"isCollapsed\" => lambda {|n| @is_collapsed = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rank\" => lambda {|n| @rank = n.get_number_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resultTemplateId\" => lambda {|n| @result_template_id = n.get_string_value() },\n \"summary\" => lambda {|n| @summary = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"audioRoutingGroups\" => lambda {|n| @audio_routing_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AudioRoutingGroup.create_from_discriminator_value(pn) }) },\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_string_value() },\n \"callOptions\" => lambda {|n| @call_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallOptions.create_from_discriminator_value(pn) }) },\n \"callRoutes\" => lambda {|n| @call_routes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRoute.create_from_discriminator_value(pn) }) },\n \"callbackUri\" => lambda {|n| @callback_uri = n.get_string_value() },\n \"chatInfo\" => lambda {|n| @chat_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatInfo.create_from_discriminator_value(pn) }) },\n \"contentSharingSessions\" => lambda {|n| @content_sharing_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ContentSharingSession.create_from_discriminator_value(pn) }) },\n \"direction\" => lambda {|n| @direction = n.get_enum_value(MicrosoftGraph::Models::CallDirection) },\n \"incomingContext\" => lambda {|n| @incoming_context = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IncomingContext.create_from_discriminator_value(pn) }) },\n \"mediaConfig\" => lambda {|n| @media_config = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaConfig.create_from_discriminator_value(pn) }) },\n \"mediaState\" => lambda {|n| @media_state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallMediaState.create_from_discriminator_value(pn) }) },\n \"meetingInfo\" => lambda {|n| @meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MeetingInfo.create_from_discriminator_value(pn) }) },\n \"myParticipantId\" => lambda {|n| @my_participant_id = n.get_string_value() },\n \"operations\" => lambda {|n| @operations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CommsOperation.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Participant.create_from_discriminator_value(pn) }) },\n \"requestedModalities\" => lambda {|n| @requested_modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Modality.create_from_discriminator_value(pn) }) },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"source\" => lambda {|n| @source = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ParticipantInfo.create_from_discriminator_value(pn) }) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::CallState) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"targets\" => lambda {|n| @targets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InvitationParticipantInfo.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"toneInfo\" => lambda {|n| @tone_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ToneInfo.create_from_discriminator_value(pn) }) },\n \"transcription\" => lambda {|n| @transcription = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallTranscriptionInfo.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"teacherNumber\" => lambda {|n| @teacher_number = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"key\" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"usage\" => lambda {|n| @usage = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"allowMultipleLines\" => lambda {|n| @allow_multiple_lines = n.get_boolean_value() },\n \"appendChangesToExistingText\" => lambda {|n| @append_changes_to_existing_text = n.get_boolean_value() },\n \"linesForEditing\" => lambda {|n| @lines_for_editing = n.get_number_value() },\n \"maxLength\" => lambda {|n| @max_length = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"textType\" => lambda {|n| @text_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"assignCategories\" => lambda {|n| @assign_categories = n.get_collection_of_primitive_values(String) },\n \"copyToFolder\" => lambda {|n| @copy_to_folder = n.get_string_value() },\n \"delete\" => lambda {|n| @delete = n.get_boolean_value() },\n \"forwardAsAttachmentTo\" => lambda {|n| @forward_as_attachment_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"forwardTo\" => lambda {|n| @forward_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"markAsRead\" => lambda {|n| @mark_as_read = n.get_boolean_value() },\n \"markImportance\" => lambda {|n| @mark_importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"moveToFolder\" => lambda {|n| @move_to_folder = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"permanentDelete\" => lambda {|n| @permanent_delete = n.get_boolean_value() },\n \"redirectTo\" => lambda {|n| @redirect_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"stopProcessingRules\" => lambda {|n| @stop_processing_rules = n.get_boolean_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"acceptMappedClaims\" => lambda {|n| @accept_mapped_claims = n.get_boolean_value() },\n \"knownClientApplications\" => lambda {|n| @known_client_applications = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"oauth2PermissionScopes\" => lambda {|n| @oauth2_permission_scopes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PermissionScope.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preAuthorizedApplications\" => lambda {|n| @pre_authorized_applications = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PreAuthorizedApplication.create_from_discriminator_value(pn) }) },\n \"requestedAccessTokenVersion\" => lambda {|n| @requested_access_token_version = n.get_number_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdByAppId\" => lambda {|n| @created_by_app_id = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"level\" => lambda {|n| @level = n.get_number_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PageLinks.create_from_discriminator_value(pn) }) },\n \"order\" => lambda {|n| @order = n.get_number_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSection\" => lambda {|n| @parent_section = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"userTags\" => lambda {|n| @user_tags = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return {\n \"failedRuns\" => lambda {|n| @failed_runs = n.get_number_value() },\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulRuns\" => lambda {|n| @successful_runs = n.get_number_value() },\n \"totalRuns\" => lambda {|n| @total_runs = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_guid_value() },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"recommendedActions\" => lambda {|n| @recommended_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RecommendedAction.create_from_discriminator_value(pn) }) },\n \"resolvedTargetsCount\" => lambda {|n| @resolved_targets_count = n.get_number_value() },\n \"simulationEventsContent\" => lambda {|n| @simulation_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SimulationEventsContent.create_from_discriminator_value(pn) }) },\n \"trainingEventsContent\" => lambda {|n| @training_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TrainingEventsContent.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"hint\" => lambda {|n| @hint = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"secretText\" => lambda {|n| @secret_text = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"locations\" => lambda {|n| @locations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LocationConstraintItem.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"suggestLocation\" => lambda {|n| @suggest_location = n.get_boolean_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"activityType\" => lambda {|n| @activity_type = n.get_string_value() },\n \"chainId\" => lambda {|n| @chain_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"previewText\" => lambda {|n| @preview_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"recipient\" => lambda {|n| @recipient = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkNotificationRecipient.create_from_discriminator_value(pn) }) },\n \"templateParameters\" => lambda {|n| @template_parameters = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkActivityTopic.create_from_discriminator_value(pn) }) },\n }\n end", "def metadata\n self.class.metadata\n end", "def get_field_deserializers()\n return {\n \"activityIdentifier\" => lambda {|n| @activity_identifier = n.get_string_value() },\n \"countEntitled\" => lambda {|n| @count_entitled = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEntitledForProvisioning\" => lambda {|n| @count_entitled_for_provisioning = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowed\" => lambda {|n| @count_escrowed = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowedRaw\" => lambda {|n| @count_escrowed_raw = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExported\" => lambda {|n| @count_exported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExports\" => lambda {|n| @count_exports = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImported\" => lambda {|n| @count_imported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedDeltas\" => lambda {|n| @count_imported_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedReferenceDeltas\" => lambda {|n| @count_imported_reference_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::SynchronizationTaskExecutionResult) },\n \"timeBegan\" => lambda {|n| @time_began = n.get_date_time_value() },\n \"timeEnded\" => lambda {|n| @time_ended = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"transportKey\" => lambda {|n| @transport_key = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"activeDeviceCount\" => lambda {|n| @active_device_count = n.get_number_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"modelAppHealthScore\" => lambda {|n| @model_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceAccess\" => lambda {|n| @resource_access = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAccess.create_from_discriminator_value(pn) }) },\n \"resourceAppId\" => lambda {|n| @resource_app_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end", "def get_field_deserializers()\n return {\n \"anchor\" => lambda {|n| @anchor = n.get_boolean_value() },\n \"apiExpressions\" => lambda {|n| @api_expressions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::StringKeyStringValuePair.create_from_discriminator_value(pn) }) },\n \"caseExact\" => lambda {|n| @case_exact = n.get_boolean_value() },\n \"defaultValue\" => lambda {|n| @default_value = n.get_string_value() },\n \"flowNullValues\" => lambda {|n| @flow_null_values = n.get_boolean_value() },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },\n \"multivalued\" => lambda {|n| @multivalued = n.get_boolean_value() },\n \"mutability\" => lambda {|n| @mutability = n.get_enum_value(MicrosoftGraph::Models::Mutability) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"referencedObjects\" => lambda {|n| @referenced_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ReferencedObject.create_from_discriminator_value(pn) }) },\n \"required\" => lambda {|n| @required = n.get_boolean_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::AttributeType) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"averageBlueScreens\" => lambda {|n| @average_blue_screens = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"averageRestarts\" => lambda {|n| @average_restarts = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"blueScreenCount\" => lambda {|n| @blue_screen_count = n.get_number_value() },\n \"bootScore\" => lambda {|n| @boot_score = n.get_number_value() },\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceCount\" => lambda {|n| @device_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"diskType\" => lambda {|n| @disk_type = n.get_enum_value(MicrosoftGraph::Models::DiskType) },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"loginScore\" => lambda {|n| @login_score = n.get_number_value() },\n \"manufacturer\" => lambda {|n| @manufacturer = n.get_string_value() },\n \"model\" => lambda {|n| @model = n.get_string_value() },\n \"modelStartupPerformanceScore\" => lambda {|n| @model_startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCount\" => lambda {|n| @restart_count = n.get_number_value() },\n \"startupPerformanceScore\" => lambda {|n| @startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"connectingIP\" => lambda {|n| @connecting_i_p = n.get_string_value() },\n \"deliveryAction\" => lambda {|n| @delivery_action = n.get_string_value() },\n \"deliveryLocation\" => lambda {|n| @delivery_location = n.get_string_value() },\n \"directionality\" => lambda {|n| @directionality = n.get_string_value() },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"messageFingerprint\" => lambda {|n| @message_fingerprint = n.get_string_value() },\n \"messageReceivedDateTime\" => lambda {|n| @message_received_date_time = n.get_date_time_value() },\n \"messageSubject\" => lambda {|n| @message_subject = n.get_string_value() },\n \"networkMessageId\" => lambda {|n| @network_message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"application\" => lambda {|n| @application = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preventsDownload\" => lambda {|n| @prevents_download = n.get_boolean_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"webHtml\" => lambda {|n| @web_html = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"uploadUrl\" => lambda {|n| @upload_url = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"attributeMappings\" => lambda {|n| @attribute_mappings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeMapping.create_from_discriminator_value(pn) }) },\n \"enabled\" => lambda {|n| @enabled = n.get_boolean_value() },\n \"flowTypes\" => lambda {|n| @flow_types = n.get_enum_value(MicrosoftGraph::Models::ObjectFlowTypes) },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectMappingMetadataEntry.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Filter.create_from_discriminator_value(pn) }) },\n \"sourceObjectName\" => lambda {|n| @source_object_name = n.get_string_value() },\n \"targetObjectName\" => lambda {|n| @target_object_name = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appHangCount\" => lambda {|n| @app_hang_count = n.get_number_value() },\n \"crashedAppCount\" => lambda {|n| @crashed_app_count = n.get_number_value() },\n \"deviceAppHealthScore\" => lambda {|n| @device_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"messageId\" => lambda {|n| @message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"replyChainMessageId\" => lambda {|n| @reply_chain_message_id = n.get_string_value() },\n \"threadId\" => lambda {|n| @thread_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return {\n \"bargeInAllowed\" => lambda {|n| @barge_in_allowed = n.get_boolean_value() },\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"initialSilenceTimeoutInSeconds\" => lambda {|n| @initial_silence_timeout_in_seconds = n.get_number_value() },\n \"maxRecordDurationInSeconds\" => lambda {|n| @max_record_duration_in_seconds = n.get_number_value() },\n \"maxSilenceTimeoutInSeconds\" => lambda {|n| @max_silence_timeout_in_seconds = n.get_number_value() },\n \"playBeep\" => lambda {|n| @play_beep = n.get_boolean_value() },\n \"prompts\" => lambda {|n| @prompts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Prompt.create_from_discriminator_value(pn) }) },\n \"stopTones\" => lambda {|n| @stop_tones = n.get_collection_of_primitive_values(String) },\n }\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"response\" => lambda {|n| @response = n.get_enum_value(MicrosoftGraph::Models::ResponseType) },\n \"time\" => lambda {|n| @time = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"driveId\" => lambda {|n| @drive_id = n.get_string_value() },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"shareId\" => lambda {|n| @share_id = n.get_string_value() },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"siteId\" => lambda {|n| @site_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"activeMalwareDetectionCount\" => lambda {|n| @active_malware_detection_count = n.get_number_value() },\n \"category\" => lambda {|n| @category = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareCategory) },\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"distinctActiveMalwareCount\" => lambda {|n| @distinct_active_malware_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"servicePrincipalId\" => lambda {|n| @service_principal_id = n.get_string_value() },\n \"servicePrincipalName\" => lambda {|n| @service_principal_name = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"riskDetections\" => lambda {|n| @risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskDetection.create_from_discriminator_value(pn) }) },\n \"riskyServicePrincipals\" => lambda {|n| @risky_service_principals = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyServicePrincipal.create_from_discriminator_value(pn) }) },\n \"riskyUsers\" => lambda {|n| @risky_users = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyUser.create_from_discriminator_value(pn) }) },\n \"servicePrincipalRiskDetections\" => lambda {|n| @service_principal_risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ServicePrincipalRiskDetection.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n })\n end", "def get_field_deserializers()\n return super.merge({\n })\n end", "def get_field_deserializers()\n return super.merge({\n })\n end", "def get_field_deserializers()\n return {\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"failedUsers\" => lambda {|n| @failed_users = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulUsers\" => lambda {|n| @successful_users = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"durationInSeconds\" => lambda {|n| @duration_in_seconds = n.get_number_value() },\n \"joinDateTime\" => lambda {|n| @join_date_time = n.get_date_time_value() },\n \"leaveDateTime\" => lambda {|n| @leave_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"actionName\" => lambda {|n| @action_name = n.get_string_value() },\n \"actionState\" => lambda {|n| @action_state = n.get_enum_value(MicrosoftGraph::Models::ActionState) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"azureAdUserId\" => lambda {|n| @azure_ad_user_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n \"userSid\" => lambda {|n| @user_sid = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_guid_value() },\n \"cloudServiceDeploymentEnvironment\" => lambda {|n| @cloud_service_deployment_environment = n.get_string_value() },\n \"cloudServiceDeploymentId\" => lambda {|n| @cloud_service_deployment_id = n.get_string_value() },\n \"cloudServiceInstanceName\" => lambda {|n| @cloud_service_instance_name = n.get_string_value() },\n \"cloudServiceName\" => lambda {|n| @cloud_service_name = n.get_string_value() },\n \"deviceDescription\" => lambda {|n| @device_description = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"mediaLegId\" => lambda {|n| @media_leg_id = n.get_guid_value() },\n \"mediaQualityList\" => lambda {|n| @media_quality_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeleconferenceDeviceMediaQuality.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"participantId\" => lambda {|n| @participant_id = n.get_guid_value() },\n }\n end", "def _before_validation\n serialize_deserialized_values\n super\n end", "def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"kind\" => lambda {|n| @kind = n.get_string_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"criterion1\" => lambda {|n| @criterion1 = n.get_string_value() },\n \"criterion2\" => lambda {|n| @criterion2 = n.get_string_value() },\n \"dynamicCriteria\" => lambda {|n| @dynamic_criteria = n.get_string_value() },\n \"filterOn\" => lambda {|n| @filter_on = n.get_string_value() },\n \"icon\" => lambda {|n| @icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookIcon.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operator\" => lambda {|n| @operator = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end" ]
[ "0.6510734", "0.63224316", "0.6322254", "0.63094735", "0.62954384", "0.6238735", "0.6232461", "0.62155676", "0.6200175", "0.6199403", "0.6173917", "0.61733985", "0.61705345", "0.61631054", "0.61620396", "0.6158031", "0.6156071", "0.6142402", "0.613998", "0.6138061", "0.61200523", "0.6089013", "0.60869795", "0.6079146", "0.60785794", "0.6070405", "0.6063533", "0.60625833", "0.6061235", "0.60584134", "0.6055769", "0.6051312", "0.60465735", "0.6046329", "0.6031944", "0.6029311", "0.6028314", "0.60255736", "0.6022033", "0.60210633", "0.6009887", "0.5988654", "0.59844214", "0.59793943", "0.5975247", "0.5969614", "0.596824", "0.5966432", "0.5965554", "0.596292", "0.5951651", "0.5950895", "0.59456754", "0.59448177", "0.593984", "0.59362113", "0.5935833", "0.59319806", "0.59312665", "0.59307545", "0.5930406", "0.5926444", "0.5926136", "0.59240156", "0.5922303", "0.591605", "0.591336", "0.5913327", "0.59130335", "0.5910617", "0.5906052", "0.5906045", "0.59042066", "0.5903306", "0.5902868", "0.59027255", "0.5902389", "0.5902219", "0.5901496", "0.58978146", "0.5891392", "0.5890228", "0.5885622", "0.5885429", "0.5884738", "0.5883899", "0.5883899", "0.5883899", "0.58811784", "0.5878516", "0.5877111", "0.5869185", "0.5844199", "0.58430207", "0.58408237", "0.58383596", "0.58362466", "0.5836192", "0.5835942", "0.5834559", "0.583357" ]
0.0
-1
Gets the media property value. Media associated with this segment.
def media return @media end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media=(value)\n @media = value\n end", "def media\n parse(delete('media'))\n end", "def media\n self\n end", "def media_config\n return @media_config\n end", "def media_duration\n return @media_duration\n end", "def media_config=(value)\n @media_config = value\n end", "def mediatype\n media_type\n end", "def media(source)\n if source.media? && source.media.count == 1\n source.media[0].media_url.to_s\n else\n nil\n end\n end", "def media_sizes\n return @media_sizes\n end", "def media_type\n @media_type || parse_and_return(:@media_type)\n end", "def media_state\n return @media_state\n end", "def type\n Medium.find(self.source.medium_id).media\n end", "def media_path\n @media_path ||= Pathname.new(source_dir).join(data['media_path'] || './media').to_s\n end", "def media_path_location\n return @media_path_location\n end", "def media_id\n changes['media_id']\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def media_duration=(value)\n @media_duration = value\n end", "def set_media\n @media = Media.find(params[:id])\n end", "def media_sizes=(value)\n @media_sizes = value\n end", "def media\n MediaInfoTracksDecorator.new(media_info_tracks)\n end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Media.V1.MediaProcessorInstance #{values}>\"\n end", "def media_for_blog_post(id)\n media_data = Mediahelper.get_media_content_by_media_content_id(id);\n return media_data;\n end", "def value\n if meta_key.is_dynamic?\n case meta_key.label\n when \"uploaded by\"\n return media_resource.user\n when \"uploaded at\"\n return media_resource.created_at #old# .to_formatted_s(:date_time) # TODO media_resource.upload_session.created_at ??\n when \"copyright usage\"\n copyright = media_resource.meta_data.get(\"copyright status\").value.first || Meta::Copyright.default # OPTIMIZE array or single element\n return copyright.usage(read_attribute(:value))\n when \"copyright url\"\n copyright = media_resource.meta_data.get(\"copyright status\").value.first || Meta::Copyright.default # OPTIMIZE array or single element\n return copyright.url(read_attribute(:value))\n #when \"public access\"\n # return media_resource.acl?(:view, :all)\n #when \"media type\"\n # return media_resource.media_type\n #when \"gps\"\n # return media_resource.media_file.meta_data[\"GPS\"]\n end\n else\n case meta_key.object_type\n when \"Meta::Copyright\", \"Meta::Department\", \"Person\"\n meta_references.map(&:reference) #.map(&:to_s)\n when \"Meta::Term\", \"Meta::Keyword\"\n meta_keywords.map(&:meta_term) #.map(&:to_s)\n when \"Meta::Date\"\n meta_dates.map(&:to_s).join(' - ')\n when \"Meta::Country\"\n text\n else\n text\n end\n end\n end", "def get_media_for_filename\n ((media.nil? || media.empty?) ? DEFAULT_MEDIA : media).map {|m|\n case \n when m.match(/max-width/)\n \"maxwidth\"\n else\n m\n end\n }.join('.')\n end", "def media_upload\n if @discovery_document['mediaUpload']\n return @media_upload ||= Google::APIClient::MediaUpload.new(self, self.method_base, @discovery_document['mediaUpload'])\n else\n return nil\n end\n end", "def to_s\n '<Twilio::REST::Media::V1>'\n end", "def media_leg_id\n return @media_leg_id\n end", "def media_text\n if @media_text.nil?\n @media_text = FeedTools::XmlHelper.select_not_blank([\n FeedTools::XmlHelper.try_xpaths(self.channel_node, [\n \"media:text/text()\"\n ], :select_result_value => true),\n FeedTools::XmlHelper.try_xpaths(self.root_node, [\n \"media:text/text()\"\n ], :select_result_value => true)\n ])\n unless @media_text.blank?\n @media_text = FeedTools::HtmlHelper.unescape_entities(@media_text)\n @media_text = FeedTools::HtmlHelper.sanitize_html(@media_text)\n @media_text.strip!\n else\n @media_text = nil\n end\n end\n return @media_text\n end", "def media_url\n if self.is_logo?\n self.structure.logo.url(:thumbnail_email_cropped)\n else\n media = Media.where(id: self.media_id).first\n return if media.nil?\n if media.type == 'Media::Video'\n media.thumbnail_url\n else\n media.image.url(:thumbnail_email_cropped)\n end\n end\n end", "def find_media(media_u_id)\n\t\t\tif !@media.nil? \n\t\t\t\treturn @media.find { |m| m.u_id == media_u_id }\n\t\t\tend\n\t\t\treturn nil\n\t\tend", "def find_media_by_id(message_id)\n UploadedMedium.find(message_id)\n end", "def count_media\n general_data['nb_media']\n end", "def media_state=(value)\n @media_state = value\n end", "def media_types\n return @media_types\n end", "def media() @media = Media.new end", "def subtype\n return unless media_type\n\n media_type.split('/').last\n end", "def medium\n return @medium\n end", "def retrieve_media_url(tweet)\n retrieve_media_element(tweet, 'media_url')\n end", "def get(entry_id, version=-1)\n\t\t\tkparams = {}\n\t\t\t# Media entry id\n\t\t\tclient.add_param(kparams, 'entryId', entry_id);\n\t\t\t# Desired version of the data\n\t\t\tclient.add_param(kparams, 'version', version);\n\t\t\tclient.queue_service_action_call('media', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def mediatype\n\t\treturn \"%s/%s\" % [ self.type || '*', self.subtype || '*' ]\n\tend", "def media_type; end", "def media_type; end", "def get_media_info(search_result)\n\t\t\tkparams = {}\n\t\t\t# KalturaSearchResult object extends KalturaSearch and has all fields required for media:add\n\t\t\tclient.add_param(kparams, 'searchResult', search_result);\n\t\t\tclient.queue_service_action_call('search', 'getMediaInfo', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def set_media_content\n @media_content = MediaContent.find(params[:id])\n end", "def media_path_location=(value)\n @media_path_location = value\n end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Intelligence.V2.MediaInstance #{values}>\"\n end", "def version\n media_types.first.version\n end", "def find_case_media\n\t\t@case_medium = CaseMedium.find(params[:id])\n\tend", "def primary_medium\n primary_source_medium = source_media.select{ |sm| sm.main }.compact.first\n primary_source_medium.medium if primary_source_medium\n end", "def get_audio\n return @audio\n end", "def content_media_url\n return 'admin/content/media'\n end", "def media(url)\n append(Media.new(url))\n end", "def get_media(account_id, media_id, opts = {})\n data, _status_code, _headers = get_media_with_http_info(account_id, media_id, opts)\n data\n end", "def set_media_attachment\r\n @media_attachment = MediaAttachment.find(params[:id])\r\n end", "def set_media_object\n @media_object = MediaObject.find(params[:id])\n end", "def to_s\n '<Twilio.Intelligence.V2.MediaPage>'\n end", "def type\n return unless media_type\n\n media_type.split('/').first\n end", "def to_s\n '<Twilio.Media.V1.MediaProcessorPage>'\n end", "def media\n super\n end", "def media_content_rating_canada\n return @media_content_rating_canada\n end", "def set_custom_media_entry\n @custom_media_entry = CustomMediaEntry.find(params[:id])\n end", "def show\n @media_attribute = MediaAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @media_attribute }\n end\n end", "def extract_media!(options)\n case options\n when String\n options\n when Hash\n min = options.delete :min\n ratio = options.delete :ratio\n media = options.delete :media\n\n webkit = options.delete :webkit\n ratio_attribute = webkit ? \"-webkit-min-device-pixel-ratio\" : \"min-device-pixel-ratio\"\n\n min = \"(min-width: #{min}px)\" if min\n ratio = case ratio\n when Float\n \"(#{ratio_attribute}: #{ratio})\"\n when Integer\n \"(#{ratio_attribute}: %.1f)\" % ratio\n when nil\n else\n raise ArgumentError.new(\"Only Float && Integer allowed\")\n end\n media = \"(#{media})\" if media\n\n [min, ratio, media].select { |e| !e.nil? }.join(\" and \")\n else\n raise ArgumentError.new(\"Only hash && string allowed\")\n end\n end", "def get_media(cloud_file)\n uri = {file_path: cloud_file.path} if cloud_file.path\n\n media = format_response(Dropbox.successful_request?(:media, access_token, uri))\n media[:url]\n end", "def set_emulated_media(media:)\n {\n method: \"Emulation.setEmulatedMedia\",\n params: { media: media }.compact\n }\n end", "def media_status\n super\n end", "def media_colors\n return @media_colors\n end", "def set_media_file\n @media_file = MediaFile.find(params[:id])\n end", "def set_media_file\n @media_file = MediaFile.find(params[:id])\n end", "def music_volume\n return @music_volume\n end", "def case_media_list\n\t\t@case_media_attachments = @surgery_case.case_media.case_media_attachments\n\tend", "def media_list\n @redis.hkeys(\"contact_media:#{self.id}\") - ['pagerduty']\n end", "def media_leg_id=(value)\n @media_leg_id = value\n end", "def set_mediation\n @mediation = Mediation.find(params[:id])\n end", "def monitored_media_servers\r\n MonitoredMediaServersController.instance\r\n end", "def media_option\n super\n end", "def media_type\r\ncontent_mime_type.to_s\r\nend", "def find_medium(id)\n self.class.get(\"/media/#{id}.json?apikey=#{apikey}\")\n end", "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Media.V1.MediaProcessorInstance #{values}>\"\n end", "def site_asset_media_url(src)\n rewrite_asset_path(DmCms::MediaUrlService.call(src))\n end", "def get_mediaitem_fields()\n @restv9.get_mediaItems_fields()\n end", "def get_instance(payload)\n MediaInstance.new(@version, payload, sid: @solution[:sid])\n end", "def media_type\n hyper_schema_link.media_type\n end", "def media_content_rating_france\n return @media_content_rating_france\n end", "def media_colors=(value)\n @media_colors = value\n end", "def set_admin_media_location\n @admin_media_location = Admin::MediaLocation.find(params[:id])\n end", "def media_types=(value)\n @media_types = value\n end", "def set_media_file\n @media_file = MediaFile.find(params[:id])\n end", "def medium_names\n primary_media | secondary_media | component_media\n end", "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Media.V1.MediaProcessorContext #{context}>\"\n end", "def media_elements_at\n case self.kind\n when AUDIO, VIDEO1, VIDEO2\n resp = self.media_elements_slides.first\n resp.nil? ? nil : resp.media_element\n when COVER, IMAGE1, IMAGE3\n self.media_elements_slides.first\n when IMAGE2\n resp = [nil, nil]\n mes = self.media_elements_slides\n resp[mes[0].position - 1] = mes[0] if !mes[0].nil?\n resp[mes[1].position - 1] = mes[1] if !mes[1].nil?\n resp\n when IMAGE4\n resp = [nil, nil, nil, nil]\n mes = self.media_elements_slides\n resp[mes[0].position - 1] = mes[0] if !mes[0].nil?\n resp[mes[1].position - 1] = mes[1] if !mes[1].nil?\n resp[mes[2].position - 1] = mes[2] if !mes[2].nil?\n resp[mes[3].position - 1] = mes[3] if !mes[3].nil?\n resp\n else\n nil\n end\n end", "def media_quality_list\n return @media_quality_list\n end", "def width\r\n @content[pn(:MediaBox)][2]\r\n end" ]
[ "0.75548327", "0.7418938", "0.69695705", "0.6866331", "0.64596444", "0.6458818", "0.6394781", "0.6318138", "0.6283729", "0.62132555", "0.61702025", "0.6126942", "0.6081915", "0.607812", "0.60400516", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.5974739", "0.59455806", "0.5859409", "0.58593327", "0.5826506", "0.5815215", "0.5731715", "0.57279086", "0.5702186", "0.5697594", "0.5691036", "0.5689207", "0.56820935", "0.5665283", "0.5656295", "0.56296986", "0.5605089", "0.5582692", "0.55576974", "0.5555977", "0.55290294", "0.545102", "0.54416925", "0.54350764", "0.5402234", "0.53965896", "0.53965896", "0.5385514", "0.5363126", "0.5360825", "0.5355899", "0.5325019", "0.5318968", "0.531011", "0.529583", "0.52926666", "0.5270056", "0.52697587", "0.5250293", "0.52413917", "0.52341306", "0.5227989", "0.5217067", "0.521566", "0.5205868", "0.52010757", "0.5192683", "0.5190826", "0.5187986", "0.51871425", "0.5140387", "0.5136204", "0.51320356", "0.51320356", "0.5120208", "0.5115139", "0.51039374", "0.5098313", "0.5088878", "0.5070868", "0.5059675", "0.5055818", "0.5048451", "0.5047336", "0.5045378", "0.50245786", "0.5021448", "0.50195074", "0.5006556", "0.5000124", "0.4994399", "0.49896744", "0.4989507", "0.4977526", "0.49762782", "0.497168", "0.49658054", "0.49656823" ]
0.773355
0
Sets the media property value. Media associated with this segment.
def media=(value) @media = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def set_Media(value)\n set_input(\"Media\", value)\n end", "def media_config=(value)\n @media_config = value\n end", "def set_media\n @media = Media.find(params[:id])\n end", "def set_media_object\n @media_object = MediaObject.find(params[:id])\n end", "def setMediaAsset(media, asset)\n # Set the asset identifiers\n media['asset'] = asset\n end", "def set_media_content\n @media_content = MediaContent.find(params[:id])\n end", "def set_emulated_media(media:)\n {\n method: \"Emulation.setEmulatedMedia\",\n params: { media: media }.compact\n }\n end", "def set_media_file\n @media_file = MediaFile.find(params[:id])\n end", "def set_media_file\n @media_file = MediaFile.find(params[:id])\n end", "def media_state=(value)\n @media_state = value\n end", "def set_media_attachment\r\n @media_attachment = MediaAttachment.find(params[:id])\r\n end", "def media_sizes=(value)\n @media_sizes = value\n end", "def media_duration=(value)\n @media_duration = value\n end", "def media\n parse(delete('media'))\n end", "def set_media_file\n @media_file = MediaFile.find(params[:id])\n end", "def set_custom_media_entry\n @custom_media_entry = CustomMediaEntry.find(params[:id])\n end", "def media_text=(new_media_text)\n @media_text = new_media_text\n end", "def mediaobject=(mo)\n # Removes existing association\n if self.mediaobject.present?\n self.mediaobject.parts_with_order_remove self\n self.mediaobject.parts -= [self]\n end\n\n self._mediaobject=(mo)\n unless self.mediaobject.nil?\n self.mediaobject.parts_with_order += [self]\n self.mediaobject.parts += [self]\n end\n end", "def set_media(opts)\n opts = check_params(opts,[:media_types])\n super(opts)\n end", "def media_path_location=(value)\n @media_path_location = value\n end", "def set_media_type\n @media_type = MediaType.find(params[:id])\n end", "def set_plsbgmusic_mediafile\n @plsbgmusic_mediafile = PlsbgmusicMediafile.find(params[:id])\n end", "def media_types=(value)\n @media_types = value\n end", "def set_media(bridge, structure)\n if structure.medias.any?\n is_logo = false\n media = structure.medias.first.id\n else\n is_logo = true\n media = structure.id\n end\n\n bridge.media_id = media\n bridge.is_logo = is_logo\n bridge.save\n end", "def set_media_plan\n @media_plan = MediaPlan.find(params[:id])\n end", "def set_admin_media_location\n @admin_media_location = Admin::MediaLocation.find(params[:id])\n end", "def set_mediation\n @mediation = Mediation.find(params[:id])\n end", "def set_admin_media_type\n @admin_media_type = Admin::MediaType.find(params[:id])\n end", "def set_medio_video\n @medio_video = MedioVideo.find(params[:id])\n end", "def media() @media = Media.new end", "def media(url)\n append(Media.new(url))\n end", "def media_colors=(value)\n @media_colors = value\n end", "def set_media_tag\n\t\t# Creating the limitation for the media attachment tags\n\t\tmedia_tag_limit = setting.build_media_tag(media_tag_limit: params[:media_tag_limit])\n\t\t# creating the media tags limit\n\t\tif media_tag_limit.save\n\t\t# response to the JSON\n\t\t render json: { success: true,message: \"Media Tag limit Successfully Updated.\",response: {media_tag_limit: media_tag_limit.media_tag_limit.as_json }},:status=>200\n\t else\n\t render :json=> { success: false, message: media_tag_limit.errors },:status=> 203\n\t end\t\n\tend", "def media_option\n super\n end", "def media_leg_id=(value)\n @media_leg_id = value\n end", "def set_medi_session\n @medi_session = MediSession.find(params[:id])\n end", "def set_media_asset\n @media_asset = MediaAsset.find(params[:id])\n redirect_to(media_assets_url) unless current_user.organization == @media_asset.organization\n end", "def media\n return @media\n end", "def assign_media(media)\n Role.new(media, self)\n end", "def media\n self\n end", "def set_artist_medium\n @artist_medium = ArtistMedia.find(params[:id])\n end", "def media(url, **keyword_args)\n append(Media.new(url, **keyword_args))\n end", "def initialize(media)\n @media = media\n end", "def add_media\n @media = Media.find_by_id(params[:media_id])\n add_media_update\n end", "def set_question_media\n\t\t@question_media = QuestionMediaAttachment.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Question Media Attachment ID !'}, status: 400 if @question_media.nil?\n\tend", "def update_from_media(media, params = {})\n api_result = @session.execute!(\n :api_method => @session.drive.files.update,\n :media => media,\n :parameters => {\n \"fileId\" => self.id,\n \"uploadType\" => \"media\",\n })\n return @session.wrap_api_file(api_result.data)\n end", "def set_med\n @med = Med.find(params[:id])\n end", "def set_med\n @med = Med.find(params[:id])\n end", "def set_default_media_type\n self.media_type = ::MIME::Types[self.content_type].first.try(:media_type) || 'file'\n end", "def update!(**args)\n @media_key = args[:media_key] if args.key?(:media_key)\n end", "def set_Video(value)\n set_alias(\"Video\", value)\n end", "def media_path\n @media_path ||= Pathname.new(source_dir).join(data['media_path'] || './media').to_s\n end", "def set_social_media_image\n @social_media_image = SocialMediaImage.find(params[:id])\n end", "def set_social_media_account\n @social_media_account = SocialMediaAccount.find(params[:id])\n end", "def set_media_upload_limit\n\t\t# Creating the limitation for the question tags\n\t\tmedia_upload_limit = setting.build_media_upload(media_upload_limit: params[:media_upload_limit])\n\t\t# creating the question tags limit\n\t\tif media_upload_limit.save\n\t\t# response to the JSON\n\t\t render json: { success: true,message: \"Media Upload limit Successfully Updated.\",response: {media_upload_limit: media_upload_limit.media_upload_limit.as_json }},:status=>200\n\t else\n\t render :json=> { success: false, message: media_upload_limit.errors },:status=> 203\n\t end\t\n\tend", "def media_params\n params.require(:media).permit([ :name, :folder_id ])\n end", "def update_medium(id, options={})\n self.class.put(\"/media/#{id}.json?apikey=#{apikey}\", :query => {:medium => options}, :body => {})\n end", "def usb_port_vmedia=(usb_port_vmedia)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(usb_port_vmedia)\n fail ArgumentError, \"invalid value for \\\"usb_port_vmedia\\\", must be one of #{validator.allowable_values}.\"\n end\n @usb_port_vmedia = usb_port_vmedia\n end", "def set_attributes\n attr_accessor :media_errors\n end", "def media_upload\n if @discovery_document['mediaUpload']\n return @media_upload ||= Google::APIClient::MediaUpload.new(self, self.method_base, @discovery_document['mediaUpload'])\n else\n return nil\n end\n end", "def medium=(value)\n @medium = value\n end", "def media\n super\n end", "def publishWithMedia(mediaFile, options )\n @me.put_picture(mediaFile,options)\n end", "def set_VideoContent(value)\n set_input(\"VideoContent\", value)\n end", "def media\n MediaInfoTracksDecorator.new(media_info_tracks)\n end", "def site_asset_media_url(src)\n rewrite_asset_path(DmCms::MediaUrlService.call(src))\n end", "def set_medium\n @medium = Medium.find(params[:id])\n end", "def media_config\n return @media_config\n end", "def remove_media\n @media = Media.find_by_id(params[:media_id])\n remove_media_update\n end", "def set_maudio\n @maudio = Maudio.find(params[:id])\n end", "def initialize(media_elem)\n super()\n\n @id = nil\n @media_url = nil # メディアの URL\n @media_url_https = nil # メディアの SSL URL\n @url = nil # メディア URL(展開)\n @display_url = nil\n @type = MEDIA_TYPE_VIDEO\n @sizes = nil\n @indices = nil\n @video_info = nil\n end", "def set_medium\n @medium = Medium.find(params[:id])\n end", "def set_medium\n @medium = Medium.find(params[:id])\n end", "def set_medium\n @medium = Medium.find(params[:id])\n end", "def set_media_sfp(opts)\n opts = check_params(opts,[:media_types])\n super(opts)\n end", "def media_content_rating_canada=(value)\n @media_content_rating_canada = value\n end", "def media_status\n super\n end", "def set_medicina\n @medicina = Medicina.find(params[:id])\n end", "def media_content_rating_france=(value)\n @media_content_rating_france = value\n end", "def media_type\n @media_type || parse_and_return(:@media_type)\n end", "def swfupload_file=(data)\n self.music_attach = data\n end", "def set_medicaldevice\n @medicaldevice = Medicaldevice.find(params[:id])\n end", "def mediatype\n media_type\n end", "def update_attr\n #sanity checks \n @persona = current_persona\n @mediaset = @persona.mediasets.find(params[:id])\n \n respond_to do |format|\n @mediaset.update_attributes( params[:mediaset] )\n format.json{ respond_with_bip(@mediaset) }\n end\n end", "def media_id\n changes['media_id']\n end", "def initialize(media_asset_instance)\n @media_asset = media_asset_instance\n end", "def media_params\n params.require(:media).permit(:url, :description, :media_type_id, :climb_ids, :pull_quote, :ascent_ids => [])\n end", "def media(source)\n if source.media? && source.media.count == 1\n source.media[0].media_url.to_s\n else\n nil\n end\n end", "def set_custom_medium\n @custom_medium = CustomMedium.find(params[:id])\n end", "def initialize(media_elem)\n super()\n\n @id = nil\n @media_url = nil # メディアの URL\n @media_url_https = nil # メディアの SSL URL\n @url = nil # メディア URL(展開)\n @display_url = nil\n @expanded_url = nil\n @type = MEDIA_TYPE_PHOTO # only \"photo\" for now\n @sizes = nil\n @indices = nil\n end", "def update\n @media = Media.find(params[:id])\n\n respond_to do |format|\n if @media.update_attributes(params[:media])\n flash[:notice] = 'Media was successfully updated.'\n format.html { redirect_to(@media) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @media.errors, :status => :unprocessable_entity }\n end\n end\n end", "def media_attachment_params\r\n params.permit(:media_id, :met_start, :met_end, :media_attachable_type, :media_attachable_id)\r\n end", "def set_media_history\n @media_history = MediaHistory.find(params[:id])\n end" ]
[ "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7867402", "0.7476403", "0.7286296", "0.6815662", "0.67164767", "0.6706243", "0.66996133", "0.669862", "0.669862", "0.66427255", "0.65458715", "0.65317374", "0.65056884", "0.63480896", "0.6325884", "0.62846535", "0.6203505", "0.6203025", "0.6170657", "0.61646223", "0.615361", "0.60317075", "0.60096586", "0.59901583", "0.59860265", "0.5967282", "0.5883027", "0.5869685", "0.5833693", "0.5814678", "0.57766795", "0.57136905", "0.56960666", "0.5629445", "0.5595406", "0.5584406", "0.55775756", "0.5555051", "0.55396277", "0.5518912", "0.54733586", "0.544523", "0.5384508", "0.53628707", "0.53565776", "0.5333652", "0.53176206", "0.53176206", "0.53158915", "0.5310679", "0.52929914", "0.529166", "0.5287808", "0.52840036", "0.52825546", "0.52578086", "0.52570504", "0.5242309", "0.52185655", "0.5182635", "0.5181379", "0.51803017", "0.51760316", "0.5146272", "0.5141163", "0.51396286", "0.5134583", "0.5129906", "0.51285964", "0.5123772", "0.51151025", "0.5092913", "0.5092913", "0.5092913", "0.50925946", "0.50827545", "0.50813556", "0.5070071", "0.50412774", "0.5040084", "0.5035949", "0.50204945", "0.501108", "0.5010885", "0.50079495", "0.49998093", "0.49983424", "0.49936536", "0.49793077", "0.4979274", "0.4966559", "0.49608278", "0.49607345" ]
0.8655443
0
Serializes information the current object
def serialize(writer) raise StandardError, 'writer cannot be null' if writer.nil? super writer.write_object_value("callee", @callee) writer.write_object_value("caller", @caller) writer.write_date_time_value("endDateTime", @end_date_time) writer.write_object_value("failureInfo", @failure_info) writer.write_collection_of_object_values("media", @media) writer.write_date_time_value("startDateTime", @start_date_time) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize\n end", "def serialize(object) end", "def serialize; end", "def serialize; end", "def serialize\n \n end", "def serialize\n raise NotImplementedError\n end", "def serialize\n raise NotImplementedError\n end", "def dump\r\n super + to_s\r\n end", "def serialize\n self.to_hash.to_json\n end", "def serialized\n serializer_class.new(self).serializable_hash\n end", "def serialize\n @raw_data\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"identityType\", @identity_type)\n end", "def serialize\n @serializer.serialize(self.output)\n end", "def serialize(_object, data); end", "def serialize(_object, data); end", "def to_json\n\t\t\tself.instance_variable_hash\n\t\tend", "def serializer; end", "def serialize!\n end", "def serialize(object)\n object.serializable_hash\n end", "def serialize(object)\n object.to_s\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"device\", @device)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"keyStrength\", @key_strength)\n end", "def marshal\n Marshal.dump self\n end", "def marshal\n Marshal.dump self\n end", "def marshal\n Marshal.dump self\n end", "def inspect\n serialize.to_s\n end", "def serialize\n YAML::dump(self)\n end", "def inspect()\n serialize.to_s()\n end", "def inspect()\n serialize.to_s()\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_collection_of_object_values(\"answers\", @answers)\n writer.write_object_value(\"assignment\", @assignment)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionCalloutInstances\", @custom_extension_callout_instances)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"requestor\", @requestor)\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_enum_value(\"state\", @state)\n writer.write_string_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"initiator\", @initiator)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_date_time_value(\"visibleHistoryStartDateTime\", @visible_history_start_date_time)\n end", "def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end", "def serialize(object, data); end", "def serialize\n JSON.generate(to_h)\n end", "def serialiaze\n Logger.d(\"Serializing the User object\")\n save_to_shared_prefs(@context, self.class, self)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"life\", @life)\n writer.write_object_value(\"per\", @per)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end", "def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"owner\", @owner)\n writer.write_collection_of_object_values(\"properties\", @properties)\n writer.write_string_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"targetTypes\", @target_types)\n end", "def write\n hash = attributes_hash\n write_value(serializer_class.dump(hash))\n @_cache = hash # set @_cache after the write\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end", "def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend", "def _dump(depth)\n scrooge_fetch_remaining\n scrooge_invalidate_updateable_result_set\n scrooge_dump_flag_this\n str = Marshal.dump(self)\n scrooge_dump_unflag_this\n str\n end", "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "def to_dump\n @time = Time.now\n Base64.encode64(Marshal.dump(self))\n end", "def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend", "def inspect\n serialize.to_s\n end", "def inspect\n serialize.to_s\n end", "def inspect\n serialize.to_s\n end", "def serialize(options={})\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"apiConnectorConfiguration\", @api_connector_configuration)\n writer.write_collection_of_object_values(\"identityProviders\", @identity_providers)\n writer.write_collection_of_object_values(\"languages\", @languages)\n writer.write_collection_of_object_values(\"userAttributeAssignments\", @user_attribute_assignments)\n writer.write_collection_of_object_values(\"userFlowIdentityProviders\", @user_flow_identity_providers)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"clientContext\", @client_context)\n writer.write_object_value(\"resultInfo\", @result_info)\n writer.write_enum_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_number_value(\"memberCount\", @member_count)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_enum_value(\"tagType\", @tag_type)\n writer.write_string_value(\"teamId\", @team_id)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_object_value(\"resource\", @resource)\n writer.write_object_value(\"weight\", @weight)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"firstSeenDateTime\", @first_seen_date_time)\n writer.write_object_value(\"host\", @host)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"version\", @version)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"large\", @large)\n writer.write_object_value(\"medium\", @medium)\n writer.write_object_value(\"small\", @small)\n writer.write_object_value(\"source\", @source)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_enum_value(\"allowedTargetScope\", @allowed_target_scope)\n writer.write_object_value(\"automaticRequestSettings\", @automatic_request_settings)\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionStageSettings\", @custom_extension_stage_settings)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"expiration\", @expiration)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"questions\", @questions)\n writer.write_object_value(\"requestApprovalSettings\", @request_approval_settings)\n writer.write_object_value(\"requestorSettings\", @requestor_settings)\n writer.write_object_value(\"reviewSettings\", @review_settings)\n writer.write_collection_of_object_values(\"specificAllowedTargets\", @specific_allowed_targets)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end", "def serializable_hash\n self.attributes\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"modalities\", @modalities)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_collection_of_object_values(\"participants\", @participants)\n writer.write_collection_of_object_values(\"sessions\", @sessions)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"version\", @version)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"axes\", @axes)\n writer.write_object_value(\"dataLabels\", @data_labels)\n writer.write_object_value(\"format\", @format)\n writer.write_object_value(\"height\", @height)\n writer.write_object_value(\"left\", @left)\n writer.write_object_value(\"legend\", @legend)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"series\", @series)\n writer.write_object_value(\"title\", @title)\n writer.write_object_value(\"top\", @top)\n writer.write_object_value(\"width\", @width)\n writer.write_object_value(\"worksheet\", @worksheet)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"name\", @name)\n writer.write_enum_value(\"scenarios\", @scenarios)\n end", "def serialize\n JSON.dump(@hash)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_boolean_value(\"isUsable\", @is_usable)\n writer.write_boolean_value(\"isUsableOnce\", @is_usable_once)\n writer.write_number_value(\"lifetimeInMinutes\", @lifetime_in_minutes)\n writer.write_string_value(\"methodUsabilityReason\", @method_usability_reason)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"temporaryAccessPass\", @temporary_access_pass)\n end", "def to_s\r\n dump\r\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"deviceCount\", @device_count)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_enum_value(\"platform\", @platform)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_object_value(\"sizeInByte\", @size_in_byte)\n writer.write_string_value(\"version\", @version)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_string_value(\"roleTemplateId\", @role_template_id)\n writer.write_collection_of_object_values(\"scopedMembers\", @scoped_members)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"options\", @options)\n writer.write_boolean_value(\"protected\", @protected)\n end", "def serialize(io)\n Encoder.encode(io, self)\n io\n end", "def _dump() end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"authenticationConfiguration\", @authentication_configuration)\n writer.write_object_value(\"clientConfiguration\", @client_configuration)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"endpointConfiguration\", @endpoint_configuration)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"body\", @body)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"imageUrl\", @image_url)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"bundles\", @bundles)\n writer.write_string_value(\"driveType\", @drive_type)\n writer.write_collection_of_object_values(\"following\", @following)\n writer.write_collection_of_object_values(\"items\", @items)\n writer.write_object_value(\"list\", @list)\n writer.write_object_value(\"owner\", @owner)\n writer.write_object_value(\"quota\", @quota)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"sharePointIds\", @share_point_ids)\n writer.write_collection_of_object_values(\"special\", @special)\n writer.write_object_value(\"system\", @system)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"feature\", @feature)\n writer.write_string_value(\"featureGroup\", @feature_group)\n writer.write_string_value(\"impactDescription\", @impact_description)\n writer.write_boolean_value(\"isResolved\", @is_resolved)\n writer.write_enum_value(\"origin\", @origin)\n writer.write_collection_of_object_values(\"posts\", @posts)\n writer.write_string_value(\"service\", @service)\n writer.write_enum_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_object_values(\"deviceStates\", @device_states)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_object_value(\"installSummary\", @install_summary)\n writer.write_object_value(\"largeCover\", @large_cover)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_date_time_value(\"publishedDateTime\", @published_date_time)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_collection_of_object_values(\"userStateSummary\", @user_state_summary)\n end", "def inspect\n attributes = [\n \"name=#{name.inspect}\",\n \"key=#{key.inspect}\",\n \"data_type=#{data_type.inspect}\",\n ]\n \"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_object_values(\"categories\", @categories)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"developer\", @developer)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_object_value(\"largeIcon\", @large_icon)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"notes\", @notes)\n writer.write_string_value(\"owner\", @owner)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_enum_value(\"publishingState\", @publishing_state)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"platformType\", @platform_type)\n writer.write_number_value(\"settingCount\", @setting_count)\n writer.write_collection_of_object_values(\"settingStates\", @setting_states)\n writer.write_enum_value(\"state\", @state)\n writer.write_number_value(\"version\", @version)\n end", "def _dump()\n #This is a stub, used for indexing\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"templateId\", @template_id)\n writer.write_collection_of_object_values(\"values\", @values)\n end", "def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"containers\", @containers)\n writer.write_object_value(\"controller\", @controller)\n writer.write_collection_of_object_values(\"ephemeralContainers\", @ephemeral_containers)\n writer.write_collection_of_object_values(\"initContainers\", @init_containers)\n writer.write_object_value(\"labels\", @labels)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"namespace\", @namespace)\n writer.write_object_value(\"podIp\", @pod_ip)\n writer.write_object_value(\"serviceAccount\", @service_account)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"detectionStatus\", @detection_status)\n writer.write_object_value(\"imageFile\", @image_file)\n writer.write_string_value(\"mdeDeviceId\", @mde_device_id)\n writer.write_date_time_value(\"parentProcessCreationDateTime\", @parent_process_creation_date_time)\n writer.write_object_value(\"parentProcessId\", @parent_process_id)\n writer.write_object_value(\"parentProcessImageFile\", @parent_process_image_file)\n writer.write_string_value(\"processCommandLine\", @process_command_line)\n writer.write_date_time_value(\"processCreationDateTime\", @process_creation_date_time)\n writer.write_object_value(\"processId\", @process_id)\n writer.write_object_value(\"userAccount\", @user_account)\n end", "def inspect\n self.to_hash.inspect\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end", "def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end", "def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activationUrl\", @activation_url)\n writer.write_string_value(\"activitySourceHost\", @activity_source_host)\n writer.write_string_value(\"appActivityId\", @app_activity_id)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_object_value(\"contentInfo\", @content_info)\n writer.write_string_value(\"contentUrl\", @content_url)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"fallbackUrl\", @fallback_url)\n writer.write_collection_of_object_values(\"historyItems\", @history_items)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"userTimezone\", @user_timezone)\n writer.write_object_value(\"visualElements\", @visual_elements)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"basis\", @basis)\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"datePurchased\", @date_purchased)\n writer.write_object_value(\"firstPeriod\", @first_period)\n writer.write_object_value(\"period\", @period)\n writer.write_object_value(\"rate\", @rate)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end", "def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end" ]
[ "0.7951372", "0.7645999", "0.7579812", "0.7579812", "0.7440032", "0.720861", "0.720861", "0.7207583", "0.7016516", "0.70007193", "0.6992252", "0.69838214", "0.69723576", "0.69666415", "0.69666415", "0.6942002", "0.69417155", "0.6933786", "0.6913977", "0.6891677", "0.68810964", "0.687664", "0.687664", "0.687664", "0.6875119", "0.68510306", "0.68364877", "0.68364877", "0.6825542", "0.6815931", "0.68061364", "0.68006235", "0.67944074", "0.67717844", "0.67341864", "0.67289317", "0.66964674", "0.66828746", "0.6673492", "0.6668077", "0.6666333", "0.6659732", "0.6656788", "0.66513675", "0.6635875", "0.66275525", "0.66275525", "0.66275525", "0.6627384", "0.66165835", "0.66141444", "0.6611379", "0.6597342", "0.65968686", "0.6594517", "0.6592636", "0.6583964", "0.6580536", "0.65803635", "0.6575503", "0.65716475", "0.65712893", "0.6566952", "0.6560253", "0.65554273", "0.65410006", "0.65346783", "0.6527361", "0.6525178", "0.65242875", "0.65235287", "0.65174305", "0.65141636", "0.6508169", "0.6499713", "0.6498714", "0.6496881", "0.6486202", "0.6482482", "0.64814615", "0.6479782", "0.6476621", "0.6475453", "0.64677024", "0.64633876", "0.64619535", "0.6461202", "0.6457243", "0.64497435", "0.6439583", "0.6433183", "0.643078", "0.6424316", "0.6420337", "0.6420337", "0.6420337", "0.6420337", "0.6420337", "0.6418776", "0.64156514" ]
0.65378475
66
Gets the startDateTime property value. UTC time when the segment started. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def start_date_time return @start_date_time end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end", "def utc_start_time\n @time.utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "def start_time\n dtstart.to_datetime\n end", "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n end", "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end", "def start_date_time\n return nil unless start_date && start_time\n DateTime.new(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone)\n end", "def start_time\n data.start_time\n end", "def start_time\n data.start_time\n end", "def started_date_time\n return @started_date_time\n end", "def local_start_at\n Timestamp.new(@timestamp_value, 0, @offset.utc_total_offset)\n end", "def start_time\n return @start_time\n end", "def start_date_time\n return @start_date_time\n end", "def started_at\n Convert.millis_to_time @gapi.statistics.start_time\n end", "def started_at\n # from TAI to Unix\n @started_at ||= @raw ? Time.at((@raw[0] << 32) + @raw[1] - 4611686018427387914) : nil\n end", "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "def start_time\n @parts.first.start_time\n end", "def start_time\n @internal_data.start_time\n end", "def start_time\n @start_time\n end", "def started_at\n Time.parse(self.result_payload[\"started_at\"]) if self.result_payload && self.result_payload[\"started_at\"]\n end", "def get_start_time()\n return process_stamp(@start_time)\n end", "def started_at\n Time.parse @gapi.start_time\n rescue StandardError\n nil\n end", "def local_start\r\n @local_start = at.add_with_convert(@offset.utc_total_offset) unless @local_start\r\n @local_start\r\n end", "def local_start\n @local_start = at.add_with_convert(@offset.utc_total_offset) unless @local_start\n @local_start\n end", "def format_datetime\n self.start_time = self.start_time.in_time_zone(\"UTC\")\n end", "def format_datetime\n self.start_time = self.start_time.in_time_zone(\"UTC\")\n end", "def time\n @time ||= incorporate_utc_offset(@utc, utc_offset)\n end", "def start_date_time\n return @start_datetime if @exec_date.nil? && @start_after.nil?\n # set tomorrow as default\n date = (@exec_date || date_add(_date_, 1)).split(\"-\").map(&:to_i)\n # set midnight as default\n time = (@start_after || \"00:00:00\").split(\":\").map(&:to_i)\n return Time.new(date[0], date[1], date[2], time[0], time[1], time[2])\n end", "def start_t\n self.start_time.strftime(\"%I:%M\") if self.start_time\n end", "def start_time\n begin_date\n end", "def start_at\n @attributes[:start_at]\n end", "def start_at\n @attributes[:start_at]\n end", "def started_date_time=(value)\n @started_date_time = value\n end", "def started_at\n date_at :start\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_time\n\t\t\treturn @start_time.strftime('%H:%M')\n\t\tend", "def start_time=(value)\n @start_time = value\n end", "def time_offset\n calc_time_offset unless @time_offset\n @time_offset\n end", "def start_time\n start_at.strftime(\"%F\") if start_at\n end", "def start_time\n self.date\n end", "def start_date\n Time.parse(@start_date) if @start_date\n end", "def start_date\n (Time.parse(@start_date).in_time_zone(@timezone).to_datetime if @start_date) || Date.today\n end", "def start_time\n eval(start) if start.present?\n end", "def current_offset\n ::Time.new.utc_offset\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_on\n @data.has_key?('start_on') ? Time.parse(data['start_on']) : nil\n end", "def start_time=(val)\n if val.kind_of?(Time) || val.kind_of?(DateTime)\n self.start_minute_of_a_day = val.minute_of_a_day\n elsif val.kind_of?(String)\n self.start_minute_of_a_day = Time.zone.parse(val).minute_of_a_day\n end\n end", "def start_time(*args)\n raw = starts_at || shift.starts_at\n raw = Time.local date.year, date.month, date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "def start_time\n self.day\n end", "def offset\n if @time\n @time.utc_offset\n elsif @datetime\n (3600*24*@datetime.offset).to_i\n else\n 0\n end\n end", "def started_at_date\n if !@started_at_date_string\n @started_at_date_string = self.start_date_time.strftime(\"%A %-m/%d/%Y\")\n end\n @started_at_date_string\n end", "def start_time\n start\n end", "def offset\n if @time\n @time.utc_offset\n elsif @datetime\n (3600*24*@datetime.offset).to_i\n elsif @timestamp_with_offset\n @timestamp_with_offset.utc_offset\n else\n 0\n end\n end", "def utc_offset\n @utc_offset || tzinfo&.current_period&.base_utc_offset\n end", "def start_formatted\n display_time read_attribute(:start)\n end", "def started_at\n @rufus ? @rufus.started_at : nil\n end", "def start_time\n by_date\n end", "def start_time\n # API results are in milliseconds since the unix epoch\n epoch_msec = raw_result.fetch('time')\n epoch_sec = epoch_msec / 1000\n\n Time.at(epoch_sec).ctime\n end", "def start(value)\n merge(ucstart: value.iso8601)\n end", "def observed_utc_offset\n @offset.observed_utc_offset\n end", "def starts_at\n read_attribute(:starts_at)\n end", "def start(value)\n merge(cmstart: value.iso8601)\n end", "def start_date\n return start\n end", "def js_start_time\n time = read_attribute :start_time\n time_format(time)\n end", "def recording_start_datetime(full_path, utc_offset)\r\n if File.exists? full_path\r\n #access_time = File.atime full_path\r\n #change_time = File.ctime full_path\r\n modified_time = File.mtime full_path\r\n\r\n file_name = File.basename full_path\r\n\r\n datetime_from_file = modified_time\r\n\r\n # _yyyyMMdd_HHmmss.\r\n file_name.scan(/.*_(\\d{4})(\\d{2})(\\d{2})_(\\d{2})(\\d{2})(\\d{2})\\..+/) do |year, month, day, hour, min ,sec|\r\n datetime_from_file = DateTime.new(year.to_i, month.to_i, day.to_i, hour.to_i, min.to_i, sec.to_i, utc_offset)\r\n end\r\n datetime_from_file\r\n else\r\n nil\r\n end\r\n end", "def start_time(ride)\n return nil unless ride.points.any?\n ride.points.first.time\n end", "def start_date(starts)\n if starts.nil?\n t = Time.now\n t = Time.utc(t.year, t.month, t.day)\n t = t - 24 * 60 * 60 \n \"start\" + time_str(t)\n elsif starts.kind_of?(Time)\n \"start\" + time_str(starts)\n end\n end", "def start_time_to_s\n\t \tself.start_date.try(:strftime, '%H:%M:%S')\n\t end", "def starttimestamp(value)\n merge(starttimestamp: value.iso8601)\n end", "def start_of_time\n Date.jd(0).strftime(\"%Y-%m-%d\")\n end", "def retrieve_start_timestamp(experiment)\n if timestamp = get(experiment.handle.to_s, 'started_at')\n Time.parse(timestamp)\n end\n end", "def to_datetime\n @to_datetime ||= utc.to_datetime.new_offset(Rational(utc_offset, 86_400))\n end", "def start(value)\n merge(rvstart: value.iso8601)\n end", "def start_date\n @raw.first.date\n end", "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end", "def start(value)\n merge(gadrstart: value.iso8601)\n end", "def start_time=(_start_time)\n Time.use_zone(screen.time_zone) do\n if _start_time.kind_of?(Hash)\n # convert to time, strip off the timezone offset so it reflects local time\n t = DateTime.strptime(\"#{_start_time[:date]} #{_start_time[:time]}\".gsub(I18n.t('time.am'), \"am\").gsub(I18n.t('time.pm'), \"pm\"), \"#{I18n.t('time.formats.date_long_year')} %I:%M %P\")\n write_attribute(:start_time, Time.zone.parse(Time.iso8601(t.to_s).to_s(:db)))\n else\n write_attribute(:start_time, _start_time)\n end\n end\n end", "def start_time_in_seconds\n @start_time_in_seconds ||= seconds_from_time(start_time)\n end", "def started_at; end", "def started_at; end", "def started_at; end" ]
[ "0.71682936", "0.70000684", "0.6914536", "0.68673843", "0.67584425", "0.66408116", "0.6514147", "0.6514147", "0.65047127", "0.65036494", "0.6453193", "0.6439327", "0.64325476", "0.64277023", "0.6382145", "0.6289503", "0.627477", "0.624708", "0.6233226", "0.62318784", "0.61815786", "0.6148705", "0.6139417", "0.6071246", "0.6071246", "0.6063831", "0.604542", "0.6013082", "0.5982263", "0.59482545", "0.59482545", "0.59406847", "0.59347475", "0.59214526", "0.59214526", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.5916426", "0.59110373", "0.5909966", "0.58980155", "0.5870509", "0.58665705", "0.585675", "0.5851182", "0.58488894", "0.5845876", "0.5816465", "0.5805796", "0.57850224", "0.57826555", "0.57741004", "0.5768343", "0.5766836", "0.57454634", "0.57404995", "0.573834", "0.56820416", "0.56693476", "0.56674755", "0.56665236", "0.56485736", "0.5630355", "0.5629607", "0.56282634", "0.55770093", "0.5568323", "0.55646807", "0.5560094", "0.55508393", "0.5531121", "0.55231553", "0.5514365", "0.5504208", "0.55033886", "0.54979444", "0.54805136", "0.5464018", "0.545017", "0.5440882", "0.5438449", "0.5437399", "0.5437399", "0.5437399" ]
0.6578073
15
Sets the startDateTime property value. UTC time when the segment started. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z
def start_date_time=(value) @start_date_time = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_started_at\n if @started_at_date_string && @started_at_time_string\n self.start_date_time = Time.parse(\"#{@started_at_date_string} #{@started_at_time_string}\")\n end\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_time=(value)\n @start_time = value\n end", "def started_date_time=(value)\n @started_date_time = value\n end", "def format_datetime\n self.start_time = self.start_time.in_time_zone(\"UTC\")\n end", "def format_datetime\n self.start_time = self.start_time.in_time_zone(\"UTC\")\n end", "def started_at=(started_at)\n self[:started_at]=(started_at)\n update_finish_at\n end", "def start_time=(_start_time)\n Time.use_zone(screen.time_zone) do\n if _start_time.kind_of?(Hash)\n # convert to time, strip off the timezone offset so it reflects local time\n t = DateTime.strptime(\"#{_start_time[:date]} #{_start_time[:time]}\".gsub(I18n.t('time.am'), \"am\").gsub(I18n.t('time.pm'), \"pm\"), \"#{I18n.t('time.formats.date_long_year')} %I:%M %P\")\n write_attribute(:start_time, Time.zone.parse(Time.iso8601(t.to_s).to_s(:db)))\n else\n write_attribute(:start_time, _start_time)\n end\n end\n end", "def start_time=(val)\n if val.kind_of?(Time) || val.kind_of?(DateTime)\n self.start_minute_of_a_day = val.minute_of_a_day\n elsif val.kind_of?(String)\n self.start_minute_of_a_day = Time.zone.parse(val).minute_of_a_day\n end\n end", "def starts_at=(starts_at)\n if starts_at.is_a? String\n self[:starts_at] = Time.parse(starts_at).utc\n elsif starts_at.is_a? Time\n self[:starts_at] = starts_at.utc\n else\n raise 'starts_at unrecognized class #{starts_at.class}'\n end\n end", "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def set_starts_at_time_and_date\n self.starts_at_time = starts_at.strftime(\"%H:%M\")\n self.starts_at_date = starts_at.strftime(\"%Y-%m-%d\")\n end", "def setup_start_at\n return unless start_at.blank?\n \n self.start_at = Time.now\n end", "def setup_start_at\n return unless start_at.blank?\n \n self.start_at = Time.now\n end", "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end", "def start_date_time\n return nil unless start_date && start_time\n DateTime.new(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone)\n end", "def setStart\n @start = Time.now\n end", "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n end", "def start\n @start_time = Time.now.utc\n end", "def start_time=(value)\n if value.is_a?(Time) || value.is_a?(DateTime)\n @start_time = value.to_time\n else\n raise TypeError, \"A Duration's start_time must be a Time or DateTime object.\"\n end\n end", "def start_time=(value)\n if value.is_a?(Time) || value.is_a?(DateTime)\n @start_time = value.to_time\n else\n raise TypeError, \"A Duration's start_time must be a Time or DateTime object.\"\n end\n end", "def utc_start_time\n @time.utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "def start_time=(_start_time)\n if _start_time.kind_of?(Hash)\n return if _start_time[:date].empty?\n # convert entered time to local time in the server's time zone in english\n t = DateTime.strptime(\"#{_start_time[:date]} #{_start_time[:time]}\".gsub(I18n.t('time.am'), \"am\").gsub(I18n.t('time.pm'), \"pm\"), \"#{I18n.t('time.formats.date_long_year')} %I:%M %P\")\n write_attribute(:start_time, Time.zone.parse(Time.iso8601(t.to_s).to_s(:db)))\n else\n write_attribute(:start_time, _start_time)\n end\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_time\n dtstart.to_datetime\n end", "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "def starts_at=(val)\n raise Timely::ConfigurationError, \"period must be set before setting starts_at\" unless period\n\n if val == :hour\n @starts_at = val.change(min: 0, sec: 0)\n else\n @starts_at = val.send(\"beginning_of_#{period}\")\n end\n\n reset\n end", "def before_start\n self.started_at = Time.now\n end", "def convert_to_start_at\n\t\tunless @start_date.blank? && @start_time.blank? \n\t\t\tself.start_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\tend\n\tend", "def local_start\r\n @local_start = at.add_with_convert(@offset.utc_total_offset) unless @local_start\r\n @local_start\r\n end", "def local_start\n @local_start = at.add_with_convert(@offset.utc_total_offset) unless @local_start\n @local_start\n end", "def set_current_time\n current_time = Time.zone.now.strftime(\"%B %e at %I:%M %p\")\n self.start_time = current_time\n end", "def start_date_time\n return @start_datetime if @exec_date.nil? && @start_after.nil?\n # set tomorrow as default\n date = (@exec_date || date_add(_date_, 1)).split(\"-\").map(&:to_i)\n # set midnight as default\n time = (@start_after || \"00:00:00\").split(\":\").map(&:to_i)\n return Time.new(date[0], date[1], date[2], time[0], time[1], time[2])\n end", "def start\n @started_at ? false : @started_at = Time.now\n end", "def start=(value)\n\t\t\t@start = value\n\t\tend", "def start(value = nil)\n return @start unless value\n @start = _parse_time(value)\n end", "def start(value)\n merge(ucstart: value.iso8601)\n end", "def change_time_to_beginning_of_hour\n self.starts_at = self.starts_at.beginning_of_hour()\n self.ends_at = self.starts_at.end_of_hour()\n end", "def start(value)\n merge(rvstart: value.iso8601)\n end", "def start_at\n super.in_time_zone(time_zone) if super && time_zone\n end", "def start_date=(start_date)\n assert_unloaded\n @start_date = start_date\n end", "def starttimestamp(value)\n merge(starttimestamp: value.iso8601)\n end", "def start(value)\n merge(cmstart: value.iso8601)\n end", "def start!\n @started_at = nil\n self.class.start!\n end", "def _record_start_time(records)\n start_time = DateTime.now\n unless records.empty?\n records.each do |record|\n record.start_at = start_time\n record.end_at = nil\n record.updated_at = start_time\n end\n end\n end", "def startpoint=(startPoint)\n @elementHash[:startpoint] = startPoint\n end", "def started_at_date=(date_string)\n @started_at_date_string = date_string\n end", "def local_start_at\n Timestamp.new(@timestamp_value, 0, @offset.utc_total_offset)\n end", "def set_BeginDate(value)\n set_input(\"BeginDate\", value)\n end", "def start(value)\n merge(gadrstart: value.iso8601)\n end", "def set_start\n @start = Start.find(params[:id])\n end", "def set_start\n @start = Start.find(params[:id])\n end", "def start(begin_offset = 0)\n super\n @on = resolve(@on)\n @origin = resolve(@origin)\n @delta = resolve(@end) - @origin\n end", "def start(begin_offset = 0)\n super\n @on = resolve(@on)\n @origin_x = resolve(@origin_x)\n @origin_y = resolve(@origin_y)\n @delta_x = resolve(@end_x) - @origin_x\n @delta_y = resolve(@end_y) - @origin_y\n end", "def start(begin_offset = 0)\n super\n @on = resolve(@on)\n @origin_x = resolve(@origin_x)\n @origin_y = resolve(@origin_y)\n @delta_x = resolve(@end_x) - @origin_x\n @delta_y = resolve(@end_y) - @origin_y\n end", "def set_start_end_time\n @start_date = Time.zone.local(*params[:reservation].sort.map(&:last)\n .map(&:to_i))\n @end_date = @start_date + params[:hours].to_i.hours\n end", "def _start_offset= offset\n fail(\"who dares set offset as such? #{offset}\") unless\n offset.kind_of?(Fixnum)\n @start_offset = offset\n end", "def started_at\n # from TAI to Unix\n @started_at ||= @raw ? Time.at((@raw[0] << 32) + @raw[1] - 4611686018427387914) : nil\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def save_start_at\n self.start_time = Time.zone.parse(\"#{date_published} #{@start_time_input}\" ) if ( @start_time_input.present? && date_published.present? )\n end", "def starts_at=(date)\n super(date)\n set_ends_at\n end", "def start_date_time\n return @start_date_time\n end", "def start_date(starts)\n if starts.nil?\n t = Time.now\n t = Time.utc(t.year, t.month, t.day)\n t = t - 24 * 60 * 60 \n \"start\" + time_str(t)\n elsif starts.kind_of?(Time)\n \"start\" + time_str(starts)\n end\n end", "def start_date\n (Time.parse(@start_date).in_time_zone(@timezone).to_datetime if @start_date) || Date.today\n end", "def start=(new_start)\n @start = new_start ? new_start.to_i : nil\n end", "def start_date\n Time.parse(@start_date) if @start_date\n end", "def minimal_charge_start_at=(value)\n value = (value.respond_to?(:strftime) ? value.strftime('%F %H:%M:%S') : value)\n write_attribute(:minimal_charge_start_at, value)\n end", "def set_start\n if params[:start].present?\n @start = params[:start].to_date\n else\n @start = Date.today\n end\n end", "def started_at\n Convert.millis_to_time @gapi.statistics.start_time\n end", "def schedule_start_timestamp(timestamp)\n @schedule_start_timestamp = timestamp\n end", "def set_start_end_dates\n if new_record?\n self.start_time ||= '12:00 PM'\n self.end_time ||= '01:00 PM'\n parse_start_end\n elsif has_attribute?(:start_at) # this if is to allow custom selects on the Event module\n self.start_date = start_at.to_s(:slashes) unless start_at.blank?\n self.start_time = start_at.to_s(:time_only).strip unless start_at.blank?\n self.end_date = end_at.to_s(:slashes) unless end_at.blank?\n self.end_time = end_at.to_s(:time_only).strip unless end_at.blank?\n end\n end", "def started_at\n Time.parse(self.result_payload[\"started_at\"]) if self.result_payload && self.result_payload[\"started_at\"]\n end", "def start_time=(*_args)\n raise_invalid_argument(property_name: :start_time)\n end", "def start_t\n self.start_time.strftime(\"%I:%M\") if self.start_time\n end", "def review_history_period_start_date_time=(value)\n @review_history_period_start_date_time = value\n end", "def recording_start_datetime(full_path, utc_offset)\r\n if File.exists? full_path\r\n #access_time = File.atime full_path\r\n #change_time = File.ctime full_path\r\n modified_time = File.mtime full_path\r\n\r\n file_name = File.basename full_path\r\n\r\n datetime_from_file = modified_time\r\n\r\n # _yyyyMMdd_HHmmss.\r\n file_name.scan(/.*_(\\d{4})(\\d{2})(\\d{2})_(\\d{2})(\\d{2})(\\d{2})\\..+/) do |year, month, day, hour, min ,sec|\r\n datetime_from_file = DateTime.new(year.to_i, month.to_i, day.to_i, hour.to_i, min.to_i, sec.to_i, utc_offset)\r\n end\r\n datetime_from_file\r\n else\r\n nil\r\n end\r\n end", "def set_request_start_time\n @request_start_time = Time.now\n end", "def start_time\n @start_time\n end" ]
[ "0.6829363", "0.6743439", "0.66322327", "0.6604408", "0.64989954", "0.64989954", "0.6450398", "0.63964355", "0.6345349", "0.6309143", "0.6308488", "0.62425715", "0.62425715", "0.62114173", "0.61761725", "0.61761725", "0.6153852", "0.61144495", "0.60943204", "0.6085175", "0.6040041", "0.5965899", "0.5965899", "0.59076077", "0.5800849", "0.578693", "0.578693", "0.578693", "0.57626593", "0.5750724", "0.57282954", "0.5727159", "0.57156885", "0.5712553", "0.56782645", "0.5627679", "0.5617377", "0.5612239", "0.5604596", "0.5600473", "0.5579694", "0.5574743", "0.5570799", "0.5513818", "0.55112547", "0.54945856", "0.547916", "0.54780066", "0.5468915", "0.5446917", "0.5446512", "0.544511", "0.5444726", "0.54280275", "0.54221237", "0.54221237", "0.5404431", "0.5401798", "0.5401798", "0.5388903", "0.53740585", "0.536648", "0.533446", "0.533446", "0.533446", "0.533446", "0.533446", "0.533446", "0.533446", "0.533446", "0.533446", "0.533446", "0.5325065", "0.53156304", "0.5292733", "0.52811974", "0.52645576", "0.5260917", "0.5257887", "0.52571374", "0.5253574", "0.5251501", "0.5251355", "0.5213191", "0.52088493", "0.5201876", "0.519293", "0.5186004", "0.51856154", "0.5176261", "0.5165117" ]
0.6825709
10
Returns "AND" or "OR", how keyword_queries will be combined
def keyword_op @params["op"] || "AND" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query\n ([query_for_one_keyword] * split_query_string.size).join(' AND ')\n end", "def query_for_one_keyword\n return @query_for_one_keyword if @query_for_one_keyword\n\n query = fields.map { |field| \"lower(#{field}) LIKE ?\" }\n .join(' OR ')\n @query_for_one_keyword = \"(#{query})\"\n end", "def conditions_for_keywords\n sql = []\n params = []\n\n keywords.each do |kw|\n str = \"lower(tasks.name) like ?\"\n str += \" or lower(tasks.description) like ?\"\n sql << str\n 2.times { params << \"%#{ kw.word.downcase }%\" }\n end\n\n sql = sql.join(\" or \")\n res = TaskFilter.send(:sanitize_sql_array, [ sql ] + params)\n return \"(#{ res })\" if !res.blank?\n end", "def build_query(query, options={})\n queries = []\n QUERY_KEYWORDS.each do |kw|\n next unless options[kw]\n if options[kw].is_a? Array\n kw_query = options[kw].map {|s| \"#{kw}:#{s}\".strip }.join(\" OR \")\n queries << \" (#{kw_query})\"\n else\n queries << \" #{kw}:#{options[kw]}\"\n end\n end\n \"#{query} #{queries.join(' ')}\".strip\n end", "def search_process\n @search_text =params[:q].to_s\n all =params[:all].to_s\n exact =params[:exact].to_s\n any =params[:any].to_s\n none =params[:none].to_s\n advanced_query=\"\"\n\n if all != \"\"\n all =all.split(' ')\n all_like =all.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n all_like =all_like.join(' and ')\n advanced_query=all_like\n end\n\n if exact != \"\" && all != \"\"\n exact =\"'%\"+exact+\"%'\"\n advanced_query = advanced_query + \" and keyword like \" + exact\n end\n\n if exact != \"\" && all == \"\"\n exact =\"'%\"+exact+\"%'\"\n advanced_query = \"keyword like \" + exact\n end\n\n if any != \"\" and (all != \"\" or exact != \"\")\n any =any.split(' ')\n any_like =any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n any_like =any_like.join(' or ')\n advanced_query = advanced_query + \" and (\" + any_like + \")\"\n end\n\n if any != \"\" and all == \"\" and exact == \"\"\n any =any.split(' ')\n any_like =any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n any_like =any_like.join(' or ')\n advanced_query = \"(\" + any_like + \")\"\n end\n\n if none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\n none =none.split(' ')\n none_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\n\n none_not_like=none_not_like.join(' and ')\n\n advanced_query=advanced_query + \" and \" + none_not_like\n\n end\n\n if none != \"\" and all == \"\" and exact == \"\" and any == \"\"\n none =none.split(' ')\n none_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\n\n none_not_like=none_not_like.join(' and ')\n\n advanced_query= none_not_like\n end\n\n\n advanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\n\n parameter_search_text=@search_text.split.join(\" \")\n keyword_array =parameter_search_text.split(' ')\n keyword_count =keyword_array.size\n\n connection = ActiveRecord::Base.connection\n\n if all != \"\" or exact != \"\" or any != \"\" or none != \"\"\n @resultset = connection.execute(\"#{advanced_query}\");\n else\n @resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\n end\n\n ActiveRecord::Base.clear_active_connections!\n\n @resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '') }\n\n @model_ids =Array.new\n @model_names =Array.new\n @model_types =Array.new\n\n @resultset_strings.each do |result|\n\n substring=result[0..4]\n\n if substring == \"NMLCL\"\n cell=Cell.find_by_Cell_ID(result.to_s)\n name=cell.Cell_Name\n type=\"Cell\"\n end\n\n if substring == \"NMLCH\"\n channel=Channel.find_by_Channel_ID(result.to_s)\n name =channel.Channel_Name\n type =\"Channel\"\n end\n\n\n if substring == \"NMLNT\"\n network=Network.find_by_Network_ID(result.to_s)\n name =network.Network_Name\n type =\"Network\"\n end\n\n if substring == \"NMLSY\"\n synapse=Synapse.find_by_Synapse_ID(result.to_s)\n name =synapse.Synapse_Name\n type =\"Synapse\"\n end\n\n @model_ids.push(result)\n @model_names.push(name)\n @model_types.push(type)\n\n end\n\n if @model_ids.count != 0\n\n render :partial => 'keyword_results_list',\n :locals => {\n :model_ids => @model_ids,\n :model_names => @model_names,\n :model_types => @model_types\n }\n\n else\n\n render :partial => 'no_results'\n\n end\n\n end", "def operation_as_join\n @operation == :all && ' && ' || ' || '\n end", "def keyword_queries\n unless @keyword_queries\n @keyword_queries = {}\n\n return @keyword_queries unless @params[:search_field] == ::AdvancedController.blacklight_config.advanced_search[:url_key]\n\n config.search_fields.each do |key, _field_def|\n unless @params[key.to_sym].blank?\n @keyword_queries[key] = @params[key.to_sym]\n end\n end\n end\n @keyword_queries\n end", "def where_and(str)\n str.include?('WHERE') ? 'AND' : 'WHERE'\nend", "def create_queries(keyword)\n sql = \"\"\n self.column_names .each do |col|\n\n sql += col + \" LIKE \" + \"\\'\" + keyword + \"\\'\"\n sql += \" OR \"\n end\n sql[0..-5] #removes the last AND. A temporary dirty fix.\n end", "def keyword_queries\n unless(@keyword_queries)\n @keyword_queries = {}\n\n return @keyword_queries unless @params[:search_field] == ::AdvancedController.blacklight_config.advanced_search[:url_key]\n \n config.search_fields.each do | key, field_def |\n if ! @params[ key.to_sym ].blank?\n @keyword_queries[ key ] = @params[ key.to_sym ]\n end\n end\n end\n return @keyword_queries\n end", "def handle_AND(clause)\n \"#{clause.gsub!(' AND ', ' ').strip!}\"\n clause.gsub!('( ', '(')\n clause.gsub!(' )', ')')\n clause\n end", "def and(*exps)\n joined_exps = exps.join(' and ')\n @query[:filters] += \" and #{joined_exps}\"\n self\n end", "def all_and(*args)\n Term.get AndTerm, *args\n end", "def test_like_two_search_condition\n search_conditions = [[\"Wes\", :like],[\"Hays\", :like]]\n query_fields = {'some_table.first_name' => :string,'some_table.last_name' => :string} \n conditions = build_query(search_conditions, query_fields) \n \n fields = ['first_name','last_name']\n regExs = [build_regex_for_like(fields,'keyword_0'), \n build_regex_for_like(fields,'keyword_1')].join('[ ]AND[ ]')\n \n assert_match /^#{regExs}$/, conditions.first\n assert_equal '%Wes%', conditions.last[:keyword_0]\n assert_equal '%Hays%', conditions.last[:keyword_1]\n end", "def grouping_query(field, phrase, op = 'AND')\n raise 'op must be AND or OR' unless ['AND', 'OR'].include? op\n\n \"_query_:\\\"{!lucene q.op=#{op}}#{field}:(#{phrase})\\\"\"\n end", "def search_process\r\nsearch_text=params[:q].to_s\r\nall=params[:all].to_s\r\nexact=params[:exact].to_s\r\nany=params[:any].to_s\r\nnone=params[:none].to_s\r\nadvanced_query=\"\"\r\n\r\nif all != \"\"\r\nall=all.split(' ')\r\nall_like=all.map {|x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nall_like=all_like.join(' and ')\r\nadvanced_query=all_like\r\nend\r\n\r\nif exact != \"\" && all != \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = advanced_query + \" and keyword like \" + exact\r\nend\r\n\r\nif exact != \"\" && all == \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = \"keyword like \" + exact\r\nend\r\n\r\nif any != \"\" and ( all != \"\" or exact != \"\" )\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = advanced_query + \" and (\" + any_like + \")\"\r\nend\r\n\r\nif any != \"\" and all == \"\" and exact == \"\"\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = \"(\" + any_like + \")\"\r\nend\r\n\r\nif none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query=advanced_query + \" and \" + none_not_like\r\n\r\nend\r\n\r\nif none != \"\" and all == \"\" and exact == \"\" and any == \"\"\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query= none_not_like\r\nend\r\n\r\n\r\n\r\n\r\n\r\nadvanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\r\nputs \"\\n\\n***********************************\\n\\n\"+advanced_query+\"\\n\\n**********************\\n\\n\"\r\n\r\nparameter_search_text=search_text.split.join(\" \")\r\n keyword_array=parameter_search_text.split(' ')\r\n keyword_count=keyword_array.size\r\n\r\nconnection = ActiveRecord::Base.connection();\r\nif all != \"\" or exact != \"\" or any != \"\" or none != \"\"\r\n@resultset = connection.execute(\"#{advanced_query}\");\r\nelse\r\n@resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\r\nend\r\nActiveRecord::Base.clear_active_connections!()\r\n\r\n@resultset.each do |res|\r\nputs res\r\nend\r\n@resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '')}\r\n@model_ids=Array.new\r\n@model_names=Array.new\r\n@model_types=Array.new\r\n@resultset_strings.each do |result|\r\nsubstring=result[0..4]\r\nputs\"\\n\\n************\"+substring\r\nif substring == \"NMLCL\"\r\ncell=Cell.find_by_Cell_ID(result.to_s)\r\nname=cell.Cell_Name\r\ntype=\"Cell\"\r\nend\r\n\r\nif substring == \"NMLCH\"\r\nchannel=Channel.find_by_Channel_ID(result.to_s)\r\nname=channel.Channel_Name\r\ntype=\"Channel\"\r\nend\r\n\r\n\r\nif substring == \"NMLNT\"\r\nnetwork=Network.find_by_Network_ID(result.to_s)\r\nname=network.Network_Name\r\ntype=\"Network\"\r\nend\r\n\r\n#if substring == \"NMLSY\"\r\n#name=Synapse.find_by_Synapse_ID(result.to_s)\r\n#type=\"Syanpse\"\r\n#end\r\n\r\n@model_ids.push(result)\r\n@model_names.push(name)\r\n@model_types.push(type)\r\nputs \"result-\"+result+\"name-\"+name.to_s\r\nend\r\n\r\nif @model_ids.count != 0\r\nrender :partial => 'keyword_results_list',:locals => {:model_ids => @model_ids,:model_names => @model_names,:model_types => @model_types}\r\nelse\r\nrender :partial => 'no_results'\r\nend\r\n\r\n\r\n end", "def search_process\r\nsearch_text=params[:q].to_s\r\nall=params[:all].to_s\r\nexact=params[:exact].to_s\r\nany=params[:any].to_s\r\nnone=params[:none].to_s\r\nadvanced_query=\"\"\r\n\r\nif all != \"\"\r\nall=all.split(' ')\r\nall_like=all.map {|x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nall_like=all_like.join(' and ')\r\nadvanced_query=all_like\r\nend\r\n\r\nif exact != \"\" && all != \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = advanced_query + \" and keyword like \" + exact\r\nend\r\n\r\nif exact != \"\" && all == \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = \"keyword like \" + exact\r\nend\r\n\r\nif any != \"\" and ( all != \"\" or exact != \"\" )\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = advanced_query + \" and (\" + any_like + \")\"\r\nend\r\n\r\nif any != \"\" and all == \"\" and exact == \"\"\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = \"(\" + any_like + \")\"\r\nend\r\n\r\nif none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query=advanced_query + \" and \" + none_not_like\r\n\r\nend\r\n\r\nif none != \"\" and all == \"\" and exact == \"\" and any == \"\"\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query= none_not_like\r\nend\r\n\r\n\r\n\r\n\r\n\r\nadvanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\r\nputs \"\\n\\n***********************************\\n\\n\"+advanced_query+\"\\n\\n**********************\\n\\n\"\r\n\r\nparameter_search_text=search_text.split.join(\" \")\r\n keyword_array=parameter_search_text.split(' ')\r\n keyword_count=keyword_array.size\r\n\r\nconnection = ActiveRecord::Base.connection();\r\nif all != \"\" or exact != \"\" or any != \"\" or none != \"\"\r\n@resultset = connection.execute(\"#{advanced_query}\");\r\nelse\r\n@resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\r\nend\r\nActiveRecord::Base.clear_active_connections!()\r\n\r\n@resultset.each do |res|\r\nputs res\r\nend\r\n@resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '')}\r\n@model_ids=Array.new\r\n@model_names=Array.new\r\n@model_types=Array.new\r\n@resultset_strings.each do |result|\r\nsubstring=result[0..4]\r\nputs\"\\n\\n************\"+substring\r\nif substring == \"NMLCL\"\r\ncell=Cell.find_by_Cell_ID(result.to_s)\r\nname=cell.Cell_Name\r\ntype=\"Cell\"\r\nend\r\n\r\nif substring == \"NMLCH\"\r\nchannel=Channel.find_by_Channel_ID(result.to_s)\r\nname=channel.Channel_Name\r\ntype=\"Channel\"\r\nend\r\n\r\n\r\nif substring == \"NMLNT\"\r\nnetwork=Network.find_by_Network_ID(result.to_s)\r\nname=network.Network_Name\r\ntype=\"Network\"\r\nend\r\n\r\n#if substring == \"NMLSY\"\r\n#name=Synapse.find_by_Synapse_ID(result.to_s)\r\n#type=\"Syanpse\"\r\n#end\r\n\r\n@model_ids.push(result)\r\n@model_names.push(name)\r\n@model_types.push(type)\r\nputs \"result-\"+result+\"name-\"+name.to_s\r\nend\r\n\r\nif @model_ids.count != 0\r\nrender :partial => 'keyword_results_list',:locals => {:model_ids => @model_ids,:model_names => @model_names,:model_types => @model_types}\r\nelse\r\nrender :partial => 'no_results'\r\nend\r\n\r\n\r\n end", "def sql_where_w_optional_conditions(where_prefix, cond1, cond2=nil, cond3=nil)\n return '' unless cond1.present? || cond2.present? || cond3.present?\n\n if where_prefix\n sql_where = ' WHERE '\n else\n sql_where = ' AND '\n end\n\n sql_where += cond1 if cond1.present?\n\n if cond2.present?\n sql_where += ' AND ' if cond1.present?\n sql_where += cond2\n end\n\n if cond3.present?\n sql_where += ' AND ' if cond1.present? || cond2.present?\n sql_where += cond3\n end\n\n sql_where\n end", "def next_condition_as_sql\n case @next_condition\n when CONDITION::NONE\n return \"\"\n when CONDITION::AND\n return \"AND\"\n when CONDITION::OR\n return \"OR\"\n end\n end", "def search_conditions_as_options\n [\n [I18n.t(\"advanced_searches.text_search_field.all_words\"), \"all_words\"],\n [I18n.t(\"advanced_searches.text_search_field.one_word\"), \"one_word\"],\n [I18n.t(\"advanced_searches.text_search_field.exact\"), \"exact\"]\n ]\n end", "def search_field_conditions_as_hash\n [\n { :value => I18n.t(\"and\"), :key => \"and\"},\n { :value => I18n.t(\"or\"), :key => \"or\"},\n { :value => I18n.t(\"exclude\"), :key => \"exclude\"}\n ]\n end", "def conditions_for(fields=[])\n predicate = []\n values = []\n fields.each do |field|\n predicate << \"lower(#{field.to_s}) like ?\"\n values << \"'%' + @search_key.downcase + '%'\"\n end\n eval(\"[\\\"#{predicate.join(' OR ')}\\\", #{values.join(',')}]\")\n end", "def query_to_terms(query)\n query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end\n end", "def and(*others)\n self.class.and(self, *others)\n end", "def build_meta_search_query(meta_keys)\n keys = meta_keys.join(\"_or_\")\n keys << \"_contains\"\n return keys\n end", "def conditions\n [conditions_clauses.join(' AND '), *conditions_options]\nend", "def or(*exps)\n joined_exps = exps.join(' and ')\n @query[:filters] += \" or #{joined_exps}\"\n self\n end", "def search_conditions(query, fields=nil)\n return nil if query.blank?\n fields ||= @search_columns\n\n # split the query by commas as well as spaces, just in case\n words = query.split(\",\").map(&:split).flatten\n\n binds = {} # bind symbols\n or_frags = [] # OR fragments\n count = 1 # to keep count on the symbols and OR fragments\n\n words.each do |word|\n like_frags = [fields].flatten.map { |f| \"LOWER(#{f}) LIKE :word#{count}\" }\n or_frags << \"(#{like_frags.join(\" OR \")})\"\n binds[\"word#{count}\".to_sym] = \"%#{word.to_s.downcase}%\"\n count += 1\n end\n [or_frags.join(\" AND \"), binds]\n end", "def keyword_conditions\n unless keyword.blank?\n searchable_columns = %w(title description justification project_number) # add any freetext-searchable fields here\n keyword.strip!\n search_str = searchable_columns.map { |x| \"#{x} LIKE :keyword\"}.to_sentence(:words_connector => \" OR \", :last_word_connector => \" OR \")\n CapitalProject.where(search_str, :keyword => \"%#{keyword}%\")\n end\n end", "def apply(query)\n queries_sql = queries.map do |context_query|\n context_query.to_where_sql(enclose_with_parentheses: queries.size > 1)\n end.join(\" OR \")\n query.to_active_record_query.where(queries_sql).to_seek_query\n end", "def query_string\n _f = @params.fields.include?(:full_text) ? [:full_text] : fields\n # byebug\n a = query.gsub('/', '').scan( /\"[^\"]+\"|[^ ]+/ ).map do |word|\n if word[0] === '\"'\n m = word.match( /^\"(.*)\"$/ );\n word = m ? m[1] : word;\n end\n Unicode.downcase(word.gsub('\"', ''))\n end\n _q = '(' + a.join('* AND ') + '*)'\n # _q = '/(?=.*?'+a.join( ')(?=.*?' )+').*/';\n #byebug\n index.filter{ ~q(query_string: {fields: _f, query: \"#{_q}\", default_operator: 'or'}) } if _q.present? && _f.present?\n\n #index.query(multi_match: {query: \"#{_q}*\", fields: _f}) if _q.present? && _f.present\n end", "def get_and_or_not_exact_of(phrase)\n two_word_phrases = [] # exact phrases from two words and up\n and_phrases, or_phrases, not_phrases = [], [], []\n \n # Divide phrase by double brackets to split\n # exact phrase search and regular seach.\n phrase.split(BRACKET).each_with_index do |p, i|\n if i.odd? and p.index(\" \")\n # First priority.\n # Exact phrase search - search inside brackets.\n # It doen't matter if bracket closed.\n # Also it makes sense if there are at least\n # two words in a phrase.\n two_word_phrases.push(normalize p)\n else\n # Second priority is OR operator\n # to make sure that search query is commutating.\n # For example if it not commutating then \"A OR B C\" equals \"A & C\" OR \"B & C\"\n # but \"C A OR B\" equals \"C & A\" OR \"B\".\n # Actually it should be \"C & A\" OR \"C & B\" where OR and &\n # are symmetric.\n and_, or_, not_ = get_and_or_not_of p\n # append to found in previous iterations\n and_phrases |= and_; or_phrases |= or_; not_phrases |= not_\n end\n end\n return and_phrases, or_phrases, not_phrases, two_word_phrases\n end", "def query_terms_string\n raise 'You must supply at least one query term' if query_terms.empty?\n\n \"q=#{query_terms.map(&:to_s).join(\",#{boolean_operator};\")}\"\n end", "def parse_term\r\n parse_factor\r\n while(@cur_token.kind == :AND)\r\n accept_it\r\n if(@cur_token.kind == :NOT)\r\n accept_it\r\n end\r\n parse_factor\r\n end\r\n end", "def google_conditions(search, field)\n goods = search.goods\n bads = search.bads\n ands = []\n ands += goods.map do |good|\n or_clause(*good.map { |str| \"#{field} LIKE '%#{clean_pattern(str)}%'\" })\n end\n ands += bads.map { |bad| \"#{field} NOT LIKE '%#{clean_pattern(bad)}%'\" }\n [ands.join(\" AND \")]\n end", "def calc_where_clause(our_where = where)\n ands = our_where.uniq.map do |x|\n # Make half-assed attempt to cut down on proliferating parens...\n if x.match(/^\\(.*\\)$/) || !x.match(/ or /i)\n x\n else\n \"(#{x})\"\n end\n end\n ands.join(\" AND \")\n end", "def search_search_text\n query\n .where(\"decidim_opinions_opinions.title ILIKE ?\", \"%#{search_text}%\")\n .or(query.where(\"decidim_opinions_opinions.body ILIKE ?\", \"%#{search_text}%\"))\n end", "def search query\n @content = @reader.read if @content.nil?\n @content.select do |doc|\n rs = []\n query.terms.each do |term|\n if term.compare(doc.send(term.field))\n rs << true\n end\n end\n if query.relation == :and\n rs.count == query.terms.count\n else\n !rs.empty?\n end\n end\n end", "def alternate_operator\n logical_operator? ? SEMANTIC_AND : LOGICAL_AND\n end", "def rewrite_and(expression)\n first = expression[1]\n second = expression[2]\n\n VirtualKeywords.call_operator_replacement(:call_and, first, second)\n end", "def andand(*)\n self\n end", "def build_where(query)\n where = \"\"\n query.each_pair do |k, v| \n if (k!='include' and k!='exclude')\n where += \"(`#{escape_str_field(k)}` #{build_equal_condition(v)}) AND \"\n end\n end\n where.chomp(' AND ')\n end", "def conditions\n\t\t[conditions_clauses.join(' AND '), *conditions_options]\n\tend", "def conditions\n\t\t[conditions_clauses.join(' AND '), *conditions_options]\n\tend", "def query\n\t\t\t[@search_term,@filter].compact.join(\" \")\n\t\tend", "def compose_and(first_condition, second_condition)\n validate_condition(first_condition)\n validate_condition(second_condition)\n first_condition.and(second_condition)\n end", "def build_conditions_for_datatable\n criteria = search_for.inject([]) do |crit, atom|\n search = AjaxDatatablesRails::Datatable::SimpleSearch.new(value: atom, regex: datatable.search.regexp?)\n disjunction = searchable_columns.map do |simple_column|\n simple_column.search = search\n simple_column.search_query\n end.reduce(:or)\n bag_of_text_class = get_bag_of_text_class\n if bag_of_text_class\n bag_of_text_query = bag_of_text_class.arel_table[:bag_of_text].matches(\"%#{atom}%\")\n if disjunction\n disjunction = disjunction.or(bag_of_text_query)\n else\n disjunction = bag_of_text_query\n end\n end\n crit << disjunction\n end.compact.reduce(:and)\n criteria\n end", "def add_adv_search_clauses(solr_parameters)\n return if search_state.clause_params.blank?\n\n defaults = { must: [], must_not: [], should: [] }\n default_op = blacklight_params[:op]&.to_sym || :must\n solr_parameters[:mm] = 1 if default_op == :should && search_state.clause_params.values.any? { |clause| }\n\n search_state.clause_params.each_value do |clause|\n op, query = adv_search_clause(clause, default_op)\n next unless defaults.key?(op)\n\n solr_parameters.append_boolean_query(op, query)\n end\n end", "def keyword_query_string\n processed_terms = []\n self.search_terms.each do |search_val|\n # spaces or dashes (-) need to be quoted to be treated as single values\n term = search_val.match?(/[\\s-]/) ? \"\\\"#{search_val}\\\"\" : search_val\n processed_terms << term\n end\n processed_terms.join(' ')\n end", "def and_ a, b\n self.and a, b\n end", "def and_clause\n a = factor_list\n\n space\n if accept(/and +/i)\n b = and_clause\n AST.new(:and, [a, b])\n else\n a\n end\n end", "def and_c\n end", "def and(*array_matchers, **keyword_matchers)\n create_matcher('and', array_matchers, keyword_matchers)\n end", "def and(*array_matchers, **keyword_matchers)\n create_matcher('and', array_matchers, keyword_matchers)\n end", "def build_query(*args)\n opts = {}\n opts = args.pop if args.last.kind_of? Hash\n\n # Add the default query, if there is one\n if not @default_query.nil? then\n # make sure there is an AND if working with a cmdline supplied part\n args.push('AND') unless args.empty?\n case @default_query\n when Array\n args.push @default_query.join(' AND ')\n when Proc\n args.push @default_query.call()\n else\n args.push @default_query.to_s\n end\n end\n\n # Get prefix as a String.\n case @prefix_query\n when Array\n prefix = @prefix_query.join(' AND ') + ' AND'\n when Proc\n prefix = @prefix_query.call()\n else\n prefix = @prefix_query.to_s\n end\n args.unshift(prefix) unless opts.has_key? :noprefix\n\n # Get suffix as a String.\n case @suffix_query\n when Array\n suffix = 'AND ' + @suffix_query.join(' AND ')\n when Proc\n suffix = @suffix_query.call()\n else\n suffix = @suffix_query.to_s\n end\n args.push(suffix) unless opts.has_key? :nosuffix\n\n args.flatten.compact.join(' ')\n end", "def virtual_and(&block)\n virtualize_keyword(:and, @and_rewriter, block)\n end", "def default_where(klass)\n sql = ''\n arel_nodes = klass.scoped.with_default_scope.where_values.grep(Arel::Nodes::Equality)\n string_nodes = klass.scoped.with_default_scope.where_values.grep(String)\n\n unless arel_nodes.empty?\n sql += arel_nodes.inject(arel_nodes[0]) do |arel, equality|\n arel = arel.and(equality); arel\n end.to_sql\n end\n\n unless string_nodes.empty?\n sql += ' AND ' + string_nodes.map { |node| \"(#{node})\"}.join(' AND ')\n end\n\n sql\n end", "def and(query = nil, *args)\n merge_query(query, :and, *args) do |left, right|\n NSCompoundPredicate.andPredicateWithSubpredicates([left, right])\n end\n end", "def search_search_text\n query\n .where(localized_search_text_in(:title), text: \"%#{search_text}%\")\n .or(query.where(localized_search_text_in(:description), text: \"%#{search_text}%\"))\n end", "def ar_transform_query_terms terms\n if terms && !terms.empty? && terms !~ /^\\s*[*? ]*\\s*$/\n terms.split(\" \").inject([]) do |query, token| \n query << \"*#{token}*\" \n end.join(\" or \")\n else\n \"\"\n end\n end", "def and_expr\n expr = equality()\n\n while match(:and)\n operator = previous()\n right = equality()\n expr = Expr::Logical.new expr, operator, right\n end\n\n expr\n end", "def conditions(extra_conditions = nil)\n time_qualifiers = qualifiers.select { |q| q.qualifiable_type == \"TimeRange\" }\n status_qualifiers = qualifiers.select { |q| q.qualifiable_type == \"Status\" }\n property_qualifiers = qualifiers.select { |q| q.qualifiable_type == \"PropertyValue\" }\n customer_qualifiers = qualifiers.select { |q| q.qualifiable_type == \"Customer\" }\n standard_qualifiers = (qualifiers - property_qualifiers - status_qualifiers -\n customer_qualifiers - time_qualifiers)\n\n res = conditions_for_standard_qualifiers(standard_qualifiers)\n res += conditions_for_property_qualifiers(property_qualifiers)\n res << conditions_for_status_qualifiers(status_qualifiers)\n res << conditions_for_customer_qualifiers(customer_qualifiers)\n res << conditions_for_time_qualifiers(time_qualifiers)\n res << conditions_for_keywords\n res << extra_conditions if extra_conditions\n res << user.user_tasks_sql\n res << unread_conditions(user) if unread_only?\n\n res = res.select { |c| !c.blank? }\n res = res.join(\" AND \")\n\n return res\n end", "def both(left, right)\n \"#{quotify left} AND #{quotify right}\"\n end", "def and_b\n end", "def keyword_match?(input)\n keywords.any? do |keyword_exp|\n parsed = keyword_exp.match(/\\A(?<op>[=^~])?(?<keyword>.*)\\z/)\n\n method = case parsed[:op]\n when \"=\" then :==\n when \"^\" then :start_with?\n when \"~\" then :end_with?\n else :include?\n end\n\n input.downcase.strip.send(method, parsed[:keyword].downcase)\n end\n end", "def valid_find_operator\n\t\toperator = ' OR '\n\t\tif params[:operator] and !params[:operator].blank? and \n\t\t\t\t['AND','OR'].include?(params[:operator])\n\t\t\toperator = \" #{params[:operator]} \"\n\t\tend\n\t\toperator\n\tend", "def logical_and\n expr = equality\n\n while match?(:and)\n operator = previous\n right = equality\n expr = Ringo::Logical.new(expr, operator, right)\n end\n\n expr\n end", "def search_query(search_terms)\n resource_handler.searchable_attributes.map do |attribute|\n if relation = attribute[:relation]\n \"LOWER(#{relation[:model_association].klass.table_name}.#{relation[:attr_method]}) LIKE #{search_terms}\"\n else\n \"LOWER(#{resource_handler.model.table_name}.#{attribute[:name]}) LIKE #{search_terms}\"\n end\n end.join(\" OR \")\n end", "def complex_case_search\n user_input =params[:searchterm]\n terms = user_input.split(/(.+?)((?: and | or ))/i).reject(&:empty?)\n \n if terms.present? && (terms[0].include? \"~\")\n @cases = nor_case_list(terms[0].delete \"~\")\n else\n @cases = case_list(terms[0])\n end\n\n if !terms[1].nil? && terms[1].strip == \"OR\" && terms[2].present?\n @cases = @cases | case_list(terms[2])\n elsif !terms[1].nil? && terms[1].strip == \"AND\" && terms[2].present? && (terms[2].include? \"~\")\n @cases = @cases & nor_case_list(terms[2].delete \"~\")\n else\n @cases = @cases & case_list(terms[2])\n end\n \n if @cases.present?\n render json: { success: true,response: @cases.as_json('search') },:status=>200\n else\n render :json=> { success: false, message: \"Case is not present.\" },:status=> 203\n end\n\n end", "def and_relation(relation)\n q = all\n q = q.where(relation.where_clause.ast) if relation.where_clause.present?\n q = q.joins(relation.joins_values + q.joins_values) if relation.joins_values.present?\n q = q.order(relation.order_values) if relation.order_values.present?\n q\n end", "def query\n case query_type_str\n when 'empty'\n return\n when 'iso'\n return iso_query_builder\n when 'multi'\n return multi_query_builder\n end\n end", "def query_words\n @query_words ||= Query.query_words @text\n end", "def test_conjunction_and\n processor_ = ::Sawmill::EntryProcessor::build do\n If(And(FilterByBasicFields(:progname => 'rails'),\n FilterByBasicFields(:level => :WARN)), @entries)\n end\n @logger = ::Sawmill::Logger.new(:processor => processor_)\n @logger.warn('Hello 1')\n @logger.warn('rails') {'Hello 2'}\n @logger.info('rails') {'Hello 3'}\n @logger.info('Hello 4')\n assert_equal('Hello 2', @entries.dequeue.message)\n assert_equal(0, @entries.size)\n end", "def conditions(model, hash)\n validate_model(model)\n validate_hash(hash)\n\n definition = select_definition_from_model(model)\n cleaned_query_hash = Clearly::Query::Cleaner.new.do(hash)\n\n # default combiner is :and\n parse_conditions(definition, :and, cleaned_query_hash)\n end", "def and_exp(expression)\n @use_conjunction = true\n @conjunction = @builder.and(@conjunction,expression)\n\n self\n end", "def group_operators(term_pairs)\n # create \"x OR y\" string\n term = join_terms 'OR', *term_pairs[0]\n rest = term_pairs.from(1)\n if rest.present?\n # nest the remaining pairs recursively, appending them with \" AND \"\n rest_grouped = group_operators rest\n rest_grouped[0] = \"(#{rest_grouped[0]})\" unless rest.length == 1\n join_terms 'AND', term, rest_grouped\n else\n term\n end\n end", "def And(concat)\n @condition.and when_factory(concat)\n end", "def AppendClauseOr(clause,phrase)\n if 0<clause.length then\n clause << \" OR \"\n end\n clause << phrase\n return clause\n end", "def process_and(exp)\n lhs = process exp.shift\n rhs = process exp.shift\n\n return \"#{lhs} && #{rhs}\"\n end", "def and_l\n end", "def boolean_query(terms = {}, options = {})\n reduce = lambda { |hash|\n hash.reduce(\"\") do |memo, (key, value)|\n if %w(and or not).include?(key.to_s) && value.is_a?(Hash)\n sub_query = reduce.call(value)\n memo += \" (#{key}#{sub_query})\" unless sub_query.empty?\n else\n if value.is_a?(Range) || value.is_a?(Integer)\n memo += \" #{key}:#{value}\"\n elsif value.is_a?(String) && value =~ /\\A\\d*\\.\\.\\d*\\Z/\n memo += \" #{key}:#{value}\"\n elsif !value.to_s.empty?\n memo += \" #{key}:'#{value.to_s}'\"\n end\n end\n memo\n end\n }\n reduce.call(terms)\n end", "def build_condition_clauses(conditions, aggregations)\n {}.tap do |clauses|\n aggregations.each do |agg|\n clauses.merge!(agg.to_query) if agg.selections?\n end\n conditions.each_pair do |name, condition|\n next if condition.name == :keywords\n merge_clause(clauses, condition.to_query) unless condition.blank?\n end\n end\n end", "def makeConditions #:doc:\n @condition_string = \"\"\n @condition_values = Hash.new\n i = 0\n \n # if search is from spesific devices\n if @device_ids.size > 0\n @device_ids.uniq!\n firstdevid = true\n @device_ids.each do |id|\n if firstdevid\n @condition_string += \"(devices.id in (\"\n firstdevid = false\n else\n @condition_string += \", \"\n end\n @condition_string += \":cond#{i}\"\n @condition_values.merge!({\"cond#{i}\".intern => id})\n i += 1\n end\n @condition_string += \"))\"\n if not @conditions.empty? or @locationdata.size == 3\n @condition_string += \" AND \"\n end\n end\n \n # take each condition and combine them\n firstcond = true\n @conditions.each do |keyword, values|\n condition = \"(\"\n statement = @condition_rules[keyword]\n \n # combine values\n firstvalue = true\n values.each do |value|\n condition_part = statement.gsub(\"?\") do |s|\n new = \":cond#{i}\"\n # bind the value\n @condition_values.merge!({\"cond#{i}\".intern => value})\n \n # do some special processing if the keyword is type and there's 2 \"?\"'s in the statement\n if keyword == \"type\" and statement.count(\"?\") == 2\n value = value[0..-2].insert(1, \".\")\n end\n i += 1\n new\n end\n \n if not firstvalue\n condition += \" OR \"\n end\n condition += condition_part\n \n firstvalue = false\n end\n \n condition += \")\"\n \n # append condition_string with the condition\n if not firstcond\n @condition_string += \" AND \"\n end\n @condition_string += condition\n firstcond = false\n end\n \n # add distance-search to conditions\n if @locationdata.size == 3\n statement = \"(\" + @condition_rules[\"distance\"] + \")\"\n j = 0\n statement.gsub!(\"?\") do |s|\n j += 1\n new = \":cond#{i}\"\n # bind the value\n if j == 1\n @condition_values.merge!({\"cond#{i}\".intern => @locationdata[\"lat\"]})\n elsif j == 3\n @condition_values.merge!({\"cond#{i}\".intern => @locationdata[\"lon\"]})\n elsif j == 5\n @condition_values.merge!({\"cond#{i}\".intern => (@locationdata[\"distance\"].to_f / @@kms_per_degree) **2})\n else\n i += 1\n end\n new\n end\n \n if not @conditions.empty?\n @condition_string += \" AND \"\n end\n @condition_string += statement\n end\n end", "def and!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n\n type = AND\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 125:7: '&&'\n match( \"&&\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n end", "def keyword\n\t\t\tlegal = legal_record_type_id == 0 ? legal_record_type.name : custom_legal_record_type\n\t\t\talley = is_alley == 1 ? 'Hẻm' : 'Mặt tiền'\n\n\t\t\tkeyword = \n\t\t\t\t\"#{name}, #{purpose.name} #{real_estate_type.name} quận #{district.name}, #{real_estate_type.name} #{legal}, #{real_estate_type.name} #{alley}, #{alley} quận #{district.name}, #{street.name} quận #{district.name}, #{purpose.name}, #{province.name}, #{real_estate_type.name}, #{legal}\"\n\t\tend", "def and?\n AndPredicate.new self.to_parseable\n end", "def fn_and(*conditions)\n {\n \"Fn::And\" => conditions\n }\n end", "def and!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 59 )\n\n type = AND\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 387:7: '&&'\n match( \"&&\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 59 )\n\n end", "def query_name\n if filters.one?\n filters.keys.first.to_s\n else\n filters.keys.join('_and_')\n end\n end", "def extract_query_conditions(join_string = \"AND\")\n Rails.logger.debug { \"extract_query_conditions ...\" }\n \n return @extracted_query_conditions if @extracted_query_conditions\n conditions_string = \"\"\n condition_values = []\n query_conditions.each do |condition|\n Rails.logger.debug { \"condition = #{condition.inspect}\" }\n \n unless condition.nil? || condition.empty?\n Rails.logger.debug { \"loading from condition: #{condition.inspect}\" }\n conditions_string += \" #{join_string} \" unless conditions_string.blank?\n if condition.is_a?(Hash)\n condition = condition[:conditions]\n end\n conditions_string += (\"(\" + condition.shift + \")\")\n condition_values += condition\n end\n end\n @extracted_query_conditions = ([conditions_string] + condition_values)\n end", "def logical_and\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n return_value = LogicalAndReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal232 = nil\n bit_or231 = nil\n bit_or233 = nil\n\n tree_for_string_literal232 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 585:5: bit_or ( '&&' bit_or )*\n @state.following.push( TOKENS_FOLLOWING_bit_or_IN_logical_and_3869 )\n bit_or231 = bit_or\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bit_or231.tree )\n end\n # at line 585:13: ( '&&' bit_or )*\n while true # decision 53\n alt_53 = 2\n look_53_0 = @input.peek( 1 )\n\n if ( look_53_0 == AND )\n alt_53 = 1\n\n end\n case alt_53\n when 1\n # at line 585:15: '&&' bit_or\n string_literal232 = match( AND, TOKENS_FOLLOWING_AND_IN_logical_and_3874 )\n if @state.backtracking == 0\n\n tree_for_string_literal232 = @adaptor.create_with_payload( string_literal232 )\n root_0 = @adaptor.become_root( tree_for_string_literal232, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_bit_or_IN_logical_and_3878 )\n bit_or233 = bit_or\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bit_or233.tree )\n end\n\n else\n break # out of loop for decision 53\n end\n end # loop for decision 53\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 50 )\n\n end\n \n return return_value\n end", "def get_and_or_not_of str\n # @param str is a string (not normalized!)\n # ie. ['big','OR','middle','OR','large','sandwich','NOT','cheese']\n # @returns and_phrases -- list of normalized words\n # @returns or_phrases -- list of lists of normalized words\n # @returns not_phrases -- list of normalized words\n # actually and_phrases is the same to or_phrases but in and_phrases\n # single words have replaced or-sublists\n \n r = str.split\n \n # returns or-words and indexes of already analyzed words\n def getOr_ r\n or_= []; del_ = []; cur = []\n status = :start\n x = 0\n while x < r.length do\n if r[x] == OR_OPERATOR\n if status == :start\n cur = [r[x-1]]\n status = :cont\n del_.push x-1\n end\n cur.push r[x+1]\n del_ += [x, x+1]\n x += 2\n else\n if status == :cont\n status = :start\n or_.push cur\n cur = []\n end\n x += 1\n end\n end\n if not cur.empty?\n or_.push cur\n end\n return or_, del_\n end\n \n def getAndNot_ r, skip\n and_ = []; not_ = []\n r.length.times do |x|\n if not skip.include?(x)\n # if previous or last (if x = 0) in array is NOT\n if r[x-1] == NOT_OPERATOR\n not_ |= [r[x]]\n elsif r[x] != NOT_OPERATOR\n and_ |= [r[x]]\n end\n end\n end\n return and_, not_\n end\n \n or_phrases, skip = getOr_ r\n and_phrases, not_phrases = getAndNot_ r, skip\n \n return normalize_list(and_phrases), normalize_list(or_phrases), normalize_list(not_phrases)\n end", "def where_clause(where, and_or = \"and\", equals_like = \"=\")\n clause = where.keys.collect { |k| \"#{k} #{equals_like} #{Formatter.format(where[k])}\" }\n clause.empty? ? \"\" : \"where #{clause.join(\" #{and_or} \")}\"\n end", "def build_where_ns(query,ns)\n where = \"\"\n query.each_pair do |k, v| \n if (k!='include' and k!='exclude')\n where += \"(`#{ns}`.`#{escape_str_field(k)}` #{build_equal_condition(v)}) AND \"\n end\n end\n where.chomp(' AND ')\n end", "def and( c )\n\t\t@conditions = self.class.and( conditions, c )\n\t\tself\n\tend", "def get_conditions_for(base_scope, query)\n unless query.blank?\n base_scope = base_scope.like_any([:name, :description], query.split)\n end\n base_scope\n end", "def get_products_conditions_for(base_scope, query)\n\t\t\t## base_scope.rlike_any_or_in_taxons([:name], query.split)\n\t\t\tbase_scope.rlike_any_or_in_taxons([:name], (query.split << query).uniq)\n\t\tend", "def query_terms_xml\n bool_operator = boolean_operator\n lambda do |xml|\n xml.QueryTerms {\n xml.BoolOpeator bool_operator\n query_terms.each do |query_term|\n xml << query_term.to_xml\n end\n }\n end\n end", "def field_search(field_queries, query)\n return query unless field_check? field_queries\n\n field_queries.each do |exps|\n sub_queries = build_sub_queries_with exps\n query = query.try(:and, sub_queries) || sub_queries\n end\n query\n end" ]
[ "0.7517001", "0.69484407", "0.6889234", "0.6676508", "0.6606359", "0.65587467", "0.65093046", "0.6500294", "0.6476187", "0.64577395", "0.6438638", "0.6423618", "0.64190125", "0.6281548", "0.61976916", "0.6184967", "0.6184967", "0.6150798", "0.6108333", "0.6092285", "0.60858077", "0.6081298", "0.607744", "0.6056573", "0.60496277", "0.6049475", "0.6029338", "0.60192466", "0.59975004", "0.5986799", "0.598329", "0.59440553", "0.59383136", "0.59250814", "0.5914384", "0.5904791", "0.5897414", "0.58919466", "0.5889059", "0.58770853", "0.58751565", "0.5856451", "0.5843815", "0.5843815", "0.5809252", "0.5798337", "0.57952565", "0.5768855", "0.5740797", "0.5724446", "0.57230175", "0.5707638", "0.5703489", "0.5703489", "0.5693322", "0.56754184", "0.5658059", "0.5653741", "0.56451637", "0.56389666", "0.56379133", "0.5629453", "0.562107", "0.5608797", "0.5606401", "0.5605825", "0.56030124", "0.56020474", "0.55905", "0.5569258", "0.5557447", "0.55411756", "0.5538448", "0.55345875", "0.5525858", "0.5521711", "0.5513699", "0.5513193", "0.5501275", "0.5501156", "0.55003196", "0.54942006", "0.54932874", "0.54859626", "0.5478147", "0.54724115", "0.5462276", "0.54598206", "0.5451213", "0.54462963", "0.54437417", "0.5435377", "0.54332983", "0.5432203", "0.54294056", "0.5422894", "0.5422367", "0.5420977", "0.54066336" ]
0.7218076
2
returns advancedtype keyword queries, see also keyword_op
def keyword_queries unless(@keyword_queries) @keyword_queries = {} return @keyword_queries unless @params[:search_field] == ::AdvancedController.blacklight_config.advanced_search[:url_key] config.search_fields.each do | key, field_def | if ! @params[ key.to_sym ].blank? @keyword_queries[ key ] = @params[ key.to_sym ] end end end return @keyword_queries end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyword_queries\n unless @keyword_queries\n @keyword_queries = {}\n\n return @keyword_queries unless @params[:search_field] == ::AdvancedController.blacklight_config.advanced_search[:url_key]\n\n config.search_fields.each do |key, _field_def|\n unless @params[key.to_sym].blank?\n @keyword_queries[key] = @params[key.to_sym]\n end\n end\n end\n @keyword_queries\n end", "def keywords\n my_nodes_tagged(:querykeywordexpr)\n end", "def keywords\n my_nodes_tagged(:querykeywordexpr)\n end", "def create_queries(keyword)\n sql = \"\"\n self.column_names .each do |col|\n\n sql += col + \" LIKE \" + \"\\'\" + keyword + \"\\'\"\n sql += \" OR \"\n end\n sql[0..-5] #removes the last AND. A temporary dirty fix.\n end", "def search_by_keyword(query, o={})\n #debugger\n #debug \"[search_by_keyword] query = #{query}\"\n result = Sunspot.search(Item) do\n keywords query\n if o[:doc_only]\n without :itype_str, Item::ITYPE_CONCEPT#['query','concept','tag']\n end\n #debugger\n o.find_all{|k,v|k.to_s =~ /^facet\\_/}.each do |e|\n #debugger\n with (e[0].to_s.split('_')[1..-1].join('_')).to_sym, e[1] if [e[1]].flatten.first != '-1'\n end\n #debugger\n order_by(:basetime, :desc) if o[:order] == \"recency\" || query == TEXT_DUMMY\n paginate(:page => o[:page], :per_page => o[:per_page]) if o[:page]\n facet(o[:facet]) if o[:facet]\n without :hidden_flag, '1'\n end\n #debugger\n if o[:facet]\n result.facet(o[:facet]).rows\n elsif o[:raw]\n result\n else\n result_items = result.hits.map_with_index{|e,i|{:id=>e.instance.id, :rank=>(i+1), :score=>e.score}}\n @cv.add(:type=>'kwd', :query=>query, :created_at=>(o[:created_at] || Time.now), :history_id=>o[:history_id], :result=>result_items) if o[:add_context]\n result_items\n end\n end", "def conditions_for_keywords\n sql = []\n params = []\n\n keywords.each do |kw|\n str = \"lower(tasks.name) like ?\"\n str += \" or lower(tasks.description) like ?\"\n sql << str\n 2.times { params << \"%#{ kw.word.downcase }%\" }\n end\n\n sql = sql.join(\" or \")\n res = TaskFilter.send(:sanitize_sql_array, [ sql ] + params)\n return \"(#{ res })\" if !res.blank?\n end", "def query\n ([query_for_one_keyword] * split_query_string.size).join(' AND ')\n end", "def search_process\n @search_text =params[:q].to_s\n all =params[:all].to_s\n exact =params[:exact].to_s\n any =params[:any].to_s\n none =params[:none].to_s\n advanced_query=\"\"\n\n if all != \"\"\n all =all.split(' ')\n all_like =all.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n all_like =all_like.join(' and ')\n advanced_query=all_like\n end\n\n if exact != \"\" && all != \"\"\n exact =\"'%\"+exact+\"%'\"\n advanced_query = advanced_query + \" and keyword like \" + exact\n end\n\n if exact != \"\" && all == \"\"\n exact =\"'%\"+exact+\"%'\"\n advanced_query = \"keyword like \" + exact\n end\n\n if any != \"\" and (all != \"\" or exact != \"\")\n any =any.split(' ')\n any_like =any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n any_like =any_like.join(' or ')\n advanced_query = advanced_query + \" and (\" + any_like + \")\"\n end\n\n if any != \"\" and all == \"\" and exact == \"\"\n any =any.split(' ')\n any_like =any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\n any_like =any_like.join(' or ')\n advanced_query = \"(\" + any_like + \")\"\n end\n\n if none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\n none =none.split(' ')\n none_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\n\n none_not_like=none_not_like.join(' and ')\n\n advanced_query=advanced_query + \" and \" + none_not_like\n\n end\n\n if none != \"\" and all == \"\" and exact == \"\" and any == \"\"\n none =none.split(' ')\n none_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\n\n none_not_like=none_not_like.join(' and ')\n\n advanced_query= none_not_like\n end\n\n\n advanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\n\n parameter_search_text=@search_text.split.join(\" \")\n keyword_array =parameter_search_text.split(' ')\n keyword_count =keyword_array.size\n\n connection = ActiveRecord::Base.connection\n\n if all != \"\" or exact != \"\" or any != \"\" or none != \"\"\n @resultset = connection.execute(\"#{advanced_query}\");\n else\n @resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\n end\n\n ActiveRecord::Base.clear_active_connections!\n\n @resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '') }\n\n @model_ids =Array.new\n @model_names =Array.new\n @model_types =Array.new\n\n @resultset_strings.each do |result|\n\n substring=result[0..4]\n\n if substring == \"NMLCL\"\n cell=Cell.find_by_Cell_ID(result.to_s)\n name=cell.Cell_Name\n type=\"Cell\"\n end\n\n if substring == \"NMLCH\"\n channel=Channel.find_by_Channel_ID(result.to_s)\n name =channel.Channel_Name\n type =\"Channel\"\n end\n\n\n if substring == \"NMLNT\"\n network=Network.find_by_Network_ID(result.to_s)\n name =network.Network_Name\n type =\"Network\"\n end\n\n if substring == \"NMLSY\"\n synapse=Synapse.find_by_Synapse_ID(result.to_s)\n name =synapse.Synapse_Name\n type =\"Synapse\"\n end\n\n @model_ids.push(result)\n @model_names.push(name)\n @model_types.push(type)\n\n end\n\n if @model_ids.count != 0\n\n render :partial => 'keyword_results_list',\n :locals => {\n :model_ids => @model_ids,\n :model_names => @model_names,\n :model_types => @model_types\n }\n\n else\n\n render :partial => 'no_results'\n\n end\n\n end", "def build_meta_search_query(meta_keys)\n keys = meta_keys.join(\"_or_\")\n keys << \"_contains\"\n return keys\n end", "def query_words\n @query_words ||= Query.query_words @text\n end", "def optional_keywords; end", "def keyword_op\n @params[\"op\"] || \"AND\"\n end", "def keyword_op\n @params[\"op\"] || \"AND\"\n end", "def build_query(query, options={})\n queries = []\n QUERY_KEYWORDS.each do |kw|\n next unless options[kw]\n if options[kw].is_a? Array\n kw_query = options[kw].map {|s| \"#{kw}:#{s}\".strip }.join(\" OR \")\n queries << \" (#{kw_query})\"\n else\n queries << \" #{kw}:#{options[kw]}\"\n end\n end\n \"#{query} #{queries.join(' ')}\".strip\n end", "def build_queries(text, build_opts, norm_opts)\n\t\ttrier = TEXT_TO_TRIE.new( build_opts[:min_tokens],\n\t\t\t\t\t\t\t\t build_opts[:max_tokens],\n\t\t\t\t\t\t\t\t )\n\t\t\n\t\t# Queries are normalized.\n\t\tqueries = trier.to_trie( text, \n\t\t \t\t\t\t norm_opts[:lowercased], \n\t\t \t norm_opts[:hyphen_replaced], \n\t\t \t norm_opts[:stemmed], \n\t\t \t)\n\t\t# queries - A hash of key (the normalized query string) and value (the array of \n\t\t# offsets (range values)) pairs.\n\t\tqueries\n\tend", "def keywords\n [self.keyword]\n end", "def query_for_one_keyword\n return @query_for_one_keyword if @query_for_one_keyword\n\n query = fields.map { |field| \"lower(#{field}) LIKE ?\" }\n .join(' OR ')\n @query_for_one_keyword = \"(#{query})\"\n end", "def keywords_to_specify\n keywords = keywords_by_type\n return keywords.select { |key| ![\"USER\", \"FRIEND\", \"IMAGE\"].include?(key) }\n end", "def required_keywords; end", "def query_symbols(query); end", "def query_symbols(query); end", "def search_process\r\nsearch_text=params[:q].to_s\r\nall=params[:all].to_s\r\nexact=params[:exact].to_s\r\nany=params[:any].to_s\r\nnone=params[:none].to_s\r\nadvanced_query=\"\"\r\n\r\nif all != \"\"\r\nall=all.split(' ')\r\nall_like=all.map {|x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nall_like=all_like.join(' and ')\r\nadvanced_query=all_like\r\nend\r\n\r\nif exact != \"\" && all != \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = advanced_query + \" and keyword like \" + exact\r\nend\r\n\r\nif exact != \"\" && all == \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = \"keyword like \" + exact\r\nend\r\n\r\nif any != \"\" and ( all != \"\" or exact != \"\" )\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = advanced_query + \" and (\" + any_like + \")\"\r\nend\r\n\r\nif any != \"\" and all == \"\" and exact == \"\"\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = \"(\" + any_like + \")\"\r\nend\r\n\r\nif none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query=advanced_query + \" and \" + none_not_like\r\n\r\nend\r\n\r\nif none != \"\" and all == \"\" and exact == \"\" and any == \"\"\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query= none_not_like\r\nend\r\n\r\n\r\n\r\n\r\n\r\nadvanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\r\nputs \"\\n\\n***********************************\\n\\n\"+advanced_query+\"\\n\\n**********************\\n\\n\"\r\n\r\nparameter_search_text=search_text.split.join(\" \")\r\n keyword_array=parameter_search_text.split(' ')\r\n keyword_count=keyword_array.size\r\n\r\nconnection = ActiveRecord::Base.connection();\r\nif all != \"\" or exact != \"\" or any != \"\" or none != \"\"\r\n@resultset = connection.execute(\"#{advanced_query}\");\r\nelse\r\n@resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\r\nend\r\nActiveRecord::Base.clear_active_connections!()\r\n\r\n@resultset.each do |res|\r\nputs res\r\nend\r\n@resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '')}\r\n@model_ids=Array.new\r\n@model_names=Array.new\r\n@model_types=Array.new\r\n@resultset_strings.each do |result|\r\nsubstring=result[0..4]\r\nputs\"\\n\\n************\"+substring\r\nif substring == \"NMLCL\"\r\ncell=Cell.find_by_Cell_ID(result.to_s)\r\nname=cell.Cell_Name\r\ntype=\"Cell\"\r\nend\r\n\r\nif substring == \"NMLCH\"\r\nchannel=Channel.find_by_Channel_ID(result.to_s)\r\nname=channel.Channel_Name\r\ntype=\"Channel\"\r\nend\r\n\r\n\r\nif substring == \"NMLNT\"\r\nnetwork=Network.find_by_Network_ID(result.to_s)\r\nname=network.Network_Name\r\ntype=\"Network\"\r\nend\r\n\r\n#if substring == \"NMLSY\"\r\n#name=Synapse.find_by_Synapse_ID(result.to_s)\r\n#type=\"Syanpse\"\r\n#end\r\n\r\n@model_ids.push(result)\r\n@model_names.push(name)\r\n@model_types.push(type)\r\nputs \"result-\"+result+\"name-\"+name.to_s\r\nend\r\n\r\nif @model_ids.count != 0\r\nrender :partial => 'keyword_results_list',:locals => {:model_ids => @model_ids,:model_names => @model_names,:model_types => @model_types}\r\nelse\r\nrender :partial => 'no_results'\r\nend\r\n\r\n\r\n end", "def search_process\r\nsearch_text=params[:q].to_s\r\nall=params[:all].to_s\r\nexact=params[:exact].to_s\r\nany=params[:any].to_s\r\nnone=params[:none].to_s\r\nadvanced_query=\"\"\r\n\r\nif all != \"\"\r\nall=all.split(' ')\r\nall_like=all.map {|x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nall_like=all_like.join(' and ')\r\nadvanced_query=all_like\r\nend\r\n\r\nif exact != \"\" && all != \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = advanced_query + \" and keyword like \" + exact\r\nend\r\n\r\nif exact != \"\" && all == \"\"\r\nexact=\"'%\"+exact+\"%'\"\r\nadvanced_query = \"keyword like \" + exact\r\nend\r\n\r\nif any != \"\" and ( all != \"\" or exact != \"\" )\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = advanced_query + \" and (\" + any_like + \")\"\r\nend\r\n\r\nif any != \"\" and all == \"\" and exact == \"\"\r\nany=any.split(' ')\r\nany_like=any.map { |x| \"keyword like \" + \"'%\" + x + \"%'\" }\r\nany_like=any_like.join(' or ')\r\nadvanced_query = \"(\" + any_like + \")\"\r\nend\r\n\r\nif none != \"\" and (all != \"\" or exact != \"\" or any != \"\")\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query=advanced_query + \" and \" + none_not_like\r\n\r\nend\r\n\r\nif none != \"\" and all == \"\" and exact == \"\" and any == \"\"\r\nnone=none.split(' ')\r\nnone_not_like=none.map { |x| \"keyword not like \" + \"'%\" + x + \"%'\" }\r\n\r\nnone_not_like=none_not_like.join(' and ')\r\n\r\nadvanced_query= none_not_like\r\nend\r\n\r\n\r\n\r\n\r\n\r\nadvanced_query = \"SELECT Model_ID FROM keyword_symbol_tables WHERE \"+advanced_query\r\nputs \"\\n\\n***********************************\\n\\n\"+advanced_query+\"\\n\\n**********************\\n\\n\"\r\n\r\nparameter_search_text=search_text.split.join(\" \")\r\n keyword_array=parameter_search_text.split(' ')\r\n keyword_count=keyword_array.size\r\n\r\nconnection = ActiveRecord::Base.connection();\r\nif all != \"\" or exact != \"\" or any != \"\" or none != \"\"\r\n@resultset = connection.execute(\"#{advanced_query}\");\r\nelse\r\n@resultset = connection.execute(\"call keyword_search('#{parameter_search_text}',#{keyword_count})\");\r\nend\r\nActiveRecord::Base.clear_active_connections!()\r\n\r\n@resultset.each do |res|\r\nputs res\r\nend\r\n@resultset_strings = @resultset.map { |result| result.to_s.gsub(/[^0-9A-Za-z]/, '')}\r\n@model_ids=Array.new\r\n@model_names=Array.new\r\n@model_types=Array.new\r\n@resultset_strings.each do |result|\r\nsubstring=result[0..4]\r\nputs\"\\n\\n************\"+substring\r\nif substring == \"NMLCL\"\r\ncell=Cell.find_by_Cell_ID(result.to_s)\r\nname=cell.Cell_Name\r\ntype=\"Cell\"\r\nend\r\n\r\nif substring == \"NMLCH\"\r\nchannel=Channel.find_by_Channel_ID(result.to_s)\r\nname=channel.Channel_Name\r\ntype=\"Channel\"\r\nend\r\n\r\n\r\nif substring == \"NMLNT\"\r\nnetwork=Network.find_by_Network_ID(result.to_s)\r\nname=network.Network_Name\r\ntype=\"Network\"\r\nend\r\n\r\n#if substring == \"NMLSY\"\r\n#name=Synapse.find_by_Synapse_ID(result.to_s)\r\n#type=\"Syanpse\"\r\n#end\r\n\r\n@model_ids.push(result)\r\n@model_names.push(name)\r\n@model_types.push(type)\r\nputs \"result-\"+result+\"name-\"+name.to_s\r\nend\r\n\r\nif @model_ids.count != 0\r\nrender :partial => 'keyword_results_list',:locals => {:model_ids => @model_ids,:model_names => @model_names,:model_types => @model_types}\r\nelse\r\nrender :partial => 'no_results'\r\nend\r\n\r\n\r\n end", "def search query\n @content = @reader.read if @content.nil?\n @content.select do |doc|\n rs = []\n query.terms.each do |term|\n if term.compare(doc.send(term.field))\n rs << true\n end\n end\n if query.relation == :and\n rs.count == query.terms.count\n else\n !rs.empty?\n end\n end\n end", "def parse_simple_type_keyword\n case current\n # when :OP_OR then\n # expect(:OP_OR)\n # when :OP_AND then\n # expect(:OP_AND)\n when :KW_BOOL then\n TypeBool.new(expect(:KW_BOOL))\n when :KW_INT then\n TypeInt.new(expect(:KW_INT))\n when :KW_FLOAT then\n TypeFloat.new(expect(:KW_FLOAT))\n else\n TypeString.new(expect(:KW_STRING))\n end\n end", "def keyword_query_string\n processed_terms = []\n self.search_terms.each do |search_val|\n # spaces or dashes (-) need to be quoted to be treated as single values\n term = search_val.match?(/[\\s-]/) ? \"\\\"#{search_val}\\\"\" : search_val\n processed_terms << term\n end\n processed_terms.join(' ')\n end", "def search_with_index query\n docs = []\n return docs if query.terms.empty?\n load if @content.nil?\n return docs if @content.nil?\n index = {}\n query.terms.each do |term|\n if term.operator == :eq && term.value.class != Regexp\n set = @attribute_storage[term.field][term.value]\n else\n set = @content.select do |doc|\n term.compare(doc.send(term.field))\n end\n end\n\n if !set.nil? && !set.empty?\n if docs.empty?\n docs = set\n if query.relation == :and\n docs.each do |value|\n index[value] = nil\n end\n end\n else\n if query.relation == :or\n docs += set\n else\n set.each do |value|\n if !index.has_key? value\n docs << value\n index[value] = nil\n end\n end\n end\n end\n end\n end\n docs\n end", "def advanced_search_options(params, offset = 0, per_page = 5)\n boolean_opr = validate_boolean_opr(params)\n description = params[:description] || \"\"\n \n query = {}\n query[:for_all] = boolean_opr == \"all\" ? description : \"\"\n query[:for_one] = boolean_opr == \"any\" ? description : \"\"\n query[:for_exact] = boolean_opr == \"exact\" ? description : \"\"\n query[:for_none] = \"\"\n query[:for_jt] = \"\"\n query[:for_com] = \"\"\n query[:for_loc] = params[:location] || \"\"\n query[:radius] = validate_radius( params )\n query[:postedDate] = validate_fromage( params )\n query[:jtype] = validate_job_type( params )\n query[:startPage] = (offset / per_page) + 1 unless Integer(offset/per_page) == 0 # \"+ 1\" ?\n query[:limit] = per_page\n query[:sort] = validate_sort( params )\n \n return query\n end", "def ontology_restrictor_keywords(type)\n case type\n when :excluded\n return [] if self.ontology_exclusion_keyword.blank?\n self.keywords.tagged_with(self.ontology_exclusion_keyword)\n OntologyClass.tagged_with_keywords(:proj_id => self.id, :keywords => self.ontology_exclusion_keyword.tags.collect{|t| t.tagged_obj.class == Keyword ? t.tagged_obj : nil}.compact)\n when :included\n return [] if self.ontology_inclusion_keyword.blank? \n self.keywords.tagged_with(self.ontology_exclusion_keyword)\n else\n []\n end\n end", "def keyword\n\t\t\tlegal = legal_record_type_id == 0 ? legal_record_type.name : custom_legal_record_type\n\t\t\talley = is_alley == 1 ? 'Hẻm' : 'Mặt tiền'\n\n\t\t\tkeyword = \n\t\t\t\t\"#{name}, #{purpose.name} #{real_estate_type.name} quận #{district.name}, #{real_estate_type.name} #{legal}, #{real_estate_type.name} #{alley}, #{alley} quận #{district.name}, #{street.name} quận #{district.name}, #{purpose.name}, #{province.name}, #{real_estate_type.name}, #{legal}\"\n\t\tend", "def search_conditions_as_options\n [\n [I18n.t(\"advanced_searches.text_search_field.all_words\"), \"all_words\"],\n [I18n.t(\"advanced_searches.text_search_field.one_word\"), \"one_word\"],\n [I18n.t(\"advanced_searches.text_search_field.exact\"), \"exact\"]\n ]\n end", "def search(keywords, *fields)\n return all\n end", "def test_like_two_search_condition\n search_conditions = [[\"Wes\", :like],[\"Hays\", :like]]\n query_fields = {'some_table.first_name' => :string,'some_table.last_name' => :string} \n conditions = build_query(search_conditions, query_fields) \n \n fields = ['first_name','last_name']\n regExs = [build_regex_for_like(fields,'keyword_0'), \n build_regex_for_like(fields,'keyword_1')].join('[ ]AND[ ]')\n \n assert_match /^#{regExs}$/, conditions.first\n assert_equal '%Wes%', conditions.last[:keyword_0]\n assert_equal '%Hays%', conditions.last[:keyword_1]\n end", "def keywords\n attr = [status, name, title_search, subject_list]\n attr.join(' ')\n end", "def keyword_conditions\n unless keyword.blank?\n searchable_columns = %w(title description justification project_number) # add any freetext-searchable fields here\n keyword.strip!\n search_str = searchable_columns.map { |x| \"#{x} LIKE :keyword\"}.to_sentence(:words_connector => \" OR \", :last_word_connector => \" OR \")\n CapitalProject.where(search_str, :keyword => \"%#{keyword}%\")\n end\n end", "def query_to_terms(query)\n query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end\n end", "def search_relevant(namespace, query, options={})\n raise \"Namespace not found\" unless namespace\n return criteria.all if query.blank? && self.allow_empty_search[namespace]\n \n keywords = Util.keywords(query, stem_keywords[namespace], ignore_list[namespace])\n \n map = <<-EOS\n function() {\n var entries = 0\n for(i in keywords)\n for(j in this._keywords[namespace]) {\n if(this._keywords[namespace][j] == keywords[i])\n entries++\n }\n if(entries > 0)\n emit(this._id, entries)\n }\n EOS\n reduce = <<-EOS\n function(key, values) {\n return(values[0])\n }\n EOS\n\n #raise [self.class, self.inspect].inspect\n \n \n \n kw_conditions = keywords.map do |kw|\n {:_keywords => kw}\n end\n\n criteria = (criteria || self).any_of(*kw_conditions)\n\n query = criteria.selector\n\n options.delete(:limit)\n options.delete(:skip)\n options.merge! :scope => {:keywords => keywords, :namespace => namespace}, :query => query\n\n # res = collection.map_reduce(map, reduce, options)\n # res.find.sort(['value', -1]) # Cursor\n \n puts options.inspect\n \n collection.map_reduce(map, reduce, options)\n end", "def search_type\n case type\n when \"opinions\"\n query.only_amendables\n when \"amendments\"\n query.only_visible_emendations_for(@current_user, @component)\n else # Assume 'all'\n query.amendables_and_visible_emendations_for(@current_user, @component)\n end\n end", "def rest_keywords; end", "def get_keywords(query_obj=nil)\n uri = URI.parse(@uri + \"/Keywords\")\n results = get(uri,query_obj)\n end", "def grouping_query(field, phrase, op = 'AND')\n raise 'op must be AND or OR' unless ['AND', 'OR'].include? op\n\n \"_query_:\\\"{!lucene q.op=#{op}}#{field}:(#{phrase})\\\"\"\n end", "def isKeyword?\n self.category =~ /(keyword)/i\n end", "def query_clause(type, key, value)\n \"_query_:\\\"{!#{type} f=#{key}}#{value.gsub('\"', '\\\"')}\\\"\"\n end", "def results\n meth = [kind.to_s, self.search_suffix].join.to_sym\n return([]) unless respond_to?(meth) # Ensure no hijackers.\n return([]) if q.nil?\n \n send(meth)\n end", "def set_keywords\n self._keywords = self.search_fields.map do |field|\n if field.is_a?(Hash)\n field.keys.map do |key|\n attribute = self.send(key)\n method = field[key]\n if attribute.is_a?(Array)\n if method.is_a?(Array)\n method.map {|m| attribute.map { |a| KeywordsExtractor.extract a.send(m) } }\n else\n attribute.map(&method).map { |t| KeywordsExtractor.extract t }\n end\n else\n KeywordsExtractor.extract(attribute.send(method))\n end\n end\n else\n KeywordsExtractor.extract(self.send(field))\n end\n end.flatten.compact.sort\n end", "def query\n case query_type_str\n when 'empty'\n return\n when 'iso'\n return iso_query_builder\n when 'multi'\n return multi_query_builder\n end\n end", "def query_terms_xml\n bool_operator = boolean_operator\n lambda do |xml|\n xml.QueryTerms {\n xml.BoolOpeator bool_operator\n query_terms.each do |query_term|\n xml << query_term.to_xml\n end\n }\n end\n end", "def query_clause(type, key, value)\n \"_query_:\\\"{!#{type} f=#{key}}#{value.gsub('\"', '\\\"')}\\\"\"\n end", "def set_keywords\n self.search_fields.keys.each do |namespace| \n self._keywords[namespace] = self.search_fields[namespace].map do |field|\n if field.is_a?(Hash) \n field.keys.map do |key|\n attribute = self.send(key)\n method = field[key] \n attribute = [attribute] if !attribute.is_a?(Array) \n method = [method] if !method.is_a?(Array)\n method.map {|m| attribute.map { |a| Util.keywords a.send(m), stem_keywords[namespace], ignore_list[namespace] } }\n end\n else \n value = self[field]\n value = [value] if !value.is_a?(Array)\n value.map {|v| Util.keywords(v, stem_keywords[namespace], ignore_list[namespace]) if v}\n end\n end.flatten.map(&:to_s).select{|f| not f.empty? }.uniq.sort\n \n end\n end", "def keyword\n\n @search_text = params[\"search_text\"] ||= \"\"\n\n add_breadcrumb \"Keyword Search: '#{@search_text}'\"\n\n if @search_text.blank? or @search_text.length < 2\n @keyword_search_results = KeywordSearchIndex.where(\"1 = 2\")\n else\n\n # here we build the query one clause at a time based on the input params. The query\n # is of the form:\n #\n # where organization_id IN (?) AND (search_text LIKE ? OR search_text_like ? OR ... )\n\n where_clause = 'organization_id IN (?) AND ('\n values = []\n # The organization is scoped to search across all objects that are owned by\n # the user's list of organizations\n orgs = @organization_list.dup\n # add org = 0 to get objects that are not indexed by org and are by\n # contract available to users of all organizations\n orgs << 0\n values << orgs\n\n search_params = []\n @search_text.split(\",\").each_with_index do |search_string|\n search_params << 'search_text LIKE ?'\n values << \"%#{search_string.strip}%\"\n end\n\n where_clause << search_params.join(' OR ')\n where_clause << ')'\n\n @keyword_search_results = KeywordSearchIndex.where(where_clause, *values)\n\n end\n\n @num_rows = @keyword_search_results.count\n cache_list(@keyword_search_results, INDEX_KEY_LIST_VAR)\n\n respond_to do |format|\n format.html\n format.json {\n render :json => {\n :total => @num_rows,\n :rows => data\n }\n }\n end\n\n end", "def test_like_search_condition\n search_conditions = [[\"Wes\", :like]]\n query_fields = {'some_table.first_name' => :string} \n conditions = build_query(search_conditions, query_fields) \n \n assert_equal '(some_table.first_name LIKE :keyword_0)', conditions.first\n assert_equal '%Wes%', conditions.last[:keyword_0]\n end", "def search(query); end", "def keywords\n\t\t\t\treturn [\n\t\t\t\t\tsuper,\n\t\t\t\t\t@data['keywords_self'],\n\t\t\t\t\tPLAYER.current_room.keywords_neighbors(get_classname)\n\t\t\t\t].flatten.reject { |x| !x }\n\t\t\tend", "def keywords\n if @model\n return @keywords || @model.keywords || Keywords.empty_keywords\n end\n @keywords || Keywords.empty_keywords\n end", "def generate_keywords\n all_keywords = {\n minions: [],\n tokens: [],\n mechanics: []\n }\n\n pt = plain_text.downcase\n\n Mechanic.names.each do |mechanic|\n next unless pt.include?(\" #{mechanic.downcase}\") || pt.include?(\"#{mechanic.downcase} \")\n\n p mechanic.downcase\n all_keywords[:mechanics].push(mechanic)\n pt.slice!(mechanic.downcase)\n end\n\n Card.names.each do |name|\n next unless pt.include?(\" #{name.downcase}\") || pt.include?(\"#{name.downcase} \")\n\n p Card.find_by(name: name).name\n all_keywords[:minions].push(name)\n pt.slice!(name)\n end\n pt\n end", "def predicate_words\n _predicate_words\n end", "def query( query )\n query.downcase!\n case query\n when /^:r:/ then query_regexp query.gsub(/^:r:/, '')\n when /^:f:/ then query_fulltext_regexp query.gsub(/^:f:/, '')\n else query_simple query\n end\n end", "def query_clause(type, key, value)\n \"_query_:\\\"{!#{type} f=#{key}}#{value.gsub('\"', '\\\"')}\\\"\"\n end", "def keywords\n keywords = []\n metadata[dataset_uri][dcat.keyword.to_s].each do |k|\n keywords << k\n end\n rescue\n []\n end", "def build_titan_lucene_query(term, property)\n if property.is_a? Array\n queries = []\n property.each do |prop|\n prop = \"\\\"#{prop}\\\"\" if prop.to_s.include?(\"_\") # need to surround in double quotes if indexed property has an underscore\n queries.concat [ \"v.#{prop}:#{term}\" ] \n end\n queries.join \" OR \"\n else\n property = \"\\\"#{property}\\\"\" if property.to_s.include?(\"_\") \n \"v.#{property}:#{term}\"\n end\n end", "def google_typed_search(type, feeds = [], locale = nil)\n content = \"var #{type}Search = new google.search.#{type.capitalize}Search();\\n\"\n if !['video', 'blog'].include?(type)\n if !locale.blank?\n content << \"#{type}Search.setRestriction(google.search.Search.RESTRICT_EXTENDED_ARGS, {lr:'lang_#{locale}'});\\n\"\n end\n end\n if !['video', 'local', 'patent', 'book'].include?(type)\n feeds.each do |feed|\n if !feed.display_uri.blank?\n content << \"#{type}Search.setSiteRestriction('#{feed.display_uri}');\\n\"\n end\n end\n end\n content << \"searchControl.addSearcher(#{type}Search);\\n\".html_safe\n end", "def query_words\n @query_array ||= @query.split(' ')\n end", "def extract_keywords\n self.keywords = Alice::Parser::NgramFactory.filtered_grams_from(self.text).flatten.uniq\n end", "def explain!(*types); end", "def search_words(query)\n query = query.downcase\n\n if query.contains_japanese?\n words = search_words_by_literals(query, 50)\n\n else\n words = search_words_by_senses(query, 50)\n\n if words.size <= 10\n extra_words = []\n\n extra_words += search_words_by_literals(query.hiragana, 20)\n extra_words += search_words_by_literals(query.katakana, 20)\n extra_words.sort! { |w1, w2| w1.score <=> w2.score }\n\n words += extra_words\n end\n end\n\n words\n end", "def find_keyword(*args)\n body, list = _extract_token_search_args(args)\n list.map! {|x| x.to_s}\n lexed = lex(body)\n lexed.find.with_index do |tok, idx|\n is_keyword = tok[1] == :on_kw && list.include?(tok[2])\n is_not_symbol = idx == 0 || lexed[idx-1][1] != :on_symbeg\n is_keyword && is_not_symbol\n end\n end", "def search(params)\n filter_name, keywords, field_queries = extract params\n scope = filtered_by filter_name\n query = text_search keywords\n query = field_search field_queries, query\n scope.where query\n end", "def query_string\n _f = @params.fields.include?(:full_text) ? [:full_text] : fields\n # byebug\n a = query.gsub('/', '').scan( /\"[^\"]+\"|[^ ]+/ ).map do |word|\n if word[0] === '\"'\n m = word.match( /^\"(.*)\"$/ );\n word = m ? m[1] : word;\n end\n Unicode.downcase(word.gsub('\"', ''))\n end\n _q = '(' + a.join('* AND ') + '*)'\n # _q = '/(?=.*?'+a.join( ')(?=.*?' )+').*/';\n #byebug\n index.filter{ ~q(query_string: {fields: _f, query: \"#{_q}\", default_operator: 'or'}) } if _q.present? && _f.present?\n\n #index.query(multi_match: {query: \"#{_q}*\", fields: _f}) if _q.present? && _f.present\n end", "def keywords_for_index(_item)\n []\n end", "def build_query(params)\n query = UserInteraction.includes(:user, :interaction, :answer)\n fields = get_fields()\n params.each do |filter|\n field_id = filter['field'].to_sym\n operator = filter['operand']\n operand = filter['value']\n if operator == FILTER_OPERATOR_CONTAINS\n query = query.where( get_active_record_expression(fields[field_id]['column_name'], operator, fields[field_id]['model']), \"%\"+operand.to_s+\"%\" )\n else\n query = query.where( get_active_record_expression(fields[field_id]['column_name'], operator, fields[field_id]['model']), operand )\n end\n end\n return query \n end", "def keyword\n values = super\n values = MetadataHelper.ordered( ordered_values: self.keyword_ordered, values: values )\n return values\n end", "def keyword\n values = super\n values = MetadataHelper.ordered( ordered_values: self.keyword_ordered, values: values )\n return values\n end", "def keywords\n @descriptive_detail.keywords\n end", "def solr_filter_concepts(prefix = '', join = ' || ')\n result = Item::ITYPE_CONCEPT.map{|e|\"#{prefix}itype_text:#{e}\"}.join(\"#{join}\")\n \"(#{result})\"\n end", "def query(keyword)\n return unless keyword\n\n where(\"title ILIKE '%?%'\", keyword)\n end", "def all_search\n @results ||= []\n feat_keyword ||= {:name_contains => params[:q]}\n reward_keyword ||= {:partner_business_name_contains => params[:q]}\n\n Feat.search(feat_keyword).all.each do |r|\n @results << r\n end if !Feat.search(feat_keyword).all.nil? && feat_keyword.length > 0\n\n Reward.search(reward_keyword).all.each do |r|\n @results << r\n end if !Reward.search(reward_keyword).all.nil? && reward_keyword.length > 0\n end", "def keywords\n @keywords_accessed = true\n @keywords\n end", "def type_name\n [\n ['Contains','contain'],\n ['Equals','equals'],\n ['Starts with','start_with'],\n ['Ends with','end_with']\n ]\n\n end", "def search_search_text\n query\n .where(\"decidim_opinions_opinions.title ILIKE ?\", \"%#{search_text}%\")\n .or(query.where(\"decidim_opinions_opinions.body ILIKE ?\", \"%#{search_text}%\"))\n end", "def keywords\n ks = Keyword.where(meta_key_id: id)\n if keywords_alphabetical_order\n ks.order('keywords.term ASC')\n else\n ks.order('keywords.position ASC')\n end\n end", "def keywords\n get_keywords.flatten.uniq\n end", "def advanced_search_options_via_search_form(params, offset, per_page)\n query = {}\n query[:q] = params[:description] || \"\"\n query[:l] = params[:location] || \"\"\n query[:radius] = validate_radius( params )\n query[:postedDate] = validate_fromage( params )\n query[:jtype] = validate_job_type( params )\n query[:startPage] = (offset / per_page)\n query[:limit] = per_page\n query[:sort] = validate_sort( params )\n \n return query\n end", "def keyword_match?(input)\n keywords.any? do |keyword_exp|\n parsed = keyword_exp.match(/\\A(?<op>[=^~])?(?<keyword>.*)\\z/)\n\n method = case parsed[:op]\n when \"=\" then :==\n when \"^\" then :start_with?\n when \"~\" then :end_with?\n else :include?\n end\n\n input.downcase.strip.send(method, parsed[:keyword].downcase)\n end\n end", "def key_words\n # because dollar signs don't work we can't display a $ sign in the keyword\n # list so its not explicitly clear what the keyword\n variables = scope.to_hash.keys\n # prepend a :: to topscope variables\n scoped_vars = variables.map { |k, _v| scope.compiler.topscope.exist?(k) ? \"$::#{k}\" : \"$#{k}\" }\n PuppetDebugger::InputResponders::Functions.instance.debugger = self\n funcs = PuppetDebugger::InputResponders::Functions.instance.func_list\n PuppetDebugger::InputResponders::Datatypes.instance.debugger = self\n (scoped_vars + funcs + static_responder_list + PuppetDebugger::InputResponders::Datatypes.instance.all_data_types).uniq.sort\n end", "def query_def; query.name; end", "def keyword\n values = super\n values = Deepblue::MetadataHelper.ordered( ordered_values: keyword_ordered, values: values )\n return values\n end", "def search(query)\n\t\t query = \"%#{query}%\"\n\t\t name = arel_table[:name].matches(query)\n\t\t aliases = arel_table[:aliases].matches(query)\n\t\t where(name.or(aliases))\n\t\tend", "def index_keywords!\n all.each { |d| d.index_keywords! }\n end", "def index_keywords!\n all.each { |d| d.index_keywords! ? MongoidSearch::Log.green(\".\") : MongoidSearch::Log.red(\"F\") }\n end", "def search_query_for(group)\n { q: \"uid:(#{group.map { |e| \"\\\"#{e.uid}\\\"\" }.join(' OR ')})\",\n def_type: 'lucene',\n facet: false,\n fl: @options[:fl] ? @options[:fl] :\n (@options[:fulltext] ?\n RLetters::Solr::Connection::DEFAULT_FIELDS_FULLTEXT :\n RLetters::Solr::Connection::DEFAULT_FIELDS),\n tv: @options[:term_vectors] || false,\n rows: group.size }\n end", "def keyword_tweets\n\t\ttweets.select{|t| !t.contextual}\n\tend", "def its_keywords\n spec_keywords(\"its\")\n end", "def search_definition(options={})\n options = options.reverse_merge(decay: true).with_indifferent_access\n query = options[:query]\n\n # Prefill and set the filters (top-level `filter` and `facet_filter` elements)\n #\n __set_filters = lambda do |key, f|\n @search_definition[:filter][:and] ||= []\n @search_definition[:filter][:and] |= [f]\n\n if @search_definition[:facets][key.to_sym]\n @search_definition[:facets][key.to_sym][:facet_filter][:and] ||= []\n @search_definition[:facets][key.to_sym][:facet_filter][:and] |= [f]\n end\n end\n\n @search_definition = {\n query: {bool: {must: [], should: []}},\n highlight: {\n pre_tags: ['<mark>'],\n post_tags: ['</mark>'],\n fields: {\n 'name'=>{number_of_fragments: 0},\n 'note'=>{fragment_size: 50},\n 'page.title'=>{number_of_fragments: 0},\n 'page.content'=>{fragment_size: 50}\n }\n },\n filter: {},\n facets: {\n keywords: {\n terms: {\n field: 'keywords',\n all_terms: true,\n size: 10\n },\n facet_filter: {}\n },\n folder_id: {\n terms: {\n field: 'folder_id'\n },\n facet_filter: {}\n },\n source: {\n terms: {\n field: 'source'\n },\n facet_filter: {}\n },\n site_name: {\n terms: {\n field: 'page.site_name'\n },\n facet_filter: {}\n },\n saved_by: {\n terms: {\n field: 'saved_by'\n },\n facet_filter: {}\n }\n }\n }\n\n if query\n @search_definition[:query][:bool][:must] << {\n multi_match: {\n query: query,\n fields: ['name^10', 'note^2', 'keywords^5', 'page.title^10', 'page.content'],\n operator: 'and'\n }\n }\n @search_definition[:suggest] = {\n text: query,\n suggest_title: {\n term: {\n field: 'page.title.tokenized',\n suggest_mode: 'always'\n }\n },\n suggest_body: {\n term: {\n field: 'page.content.tokenized',\n suggest_mode: 'always'\n }\n }\n }\n else\n @search_definition[:sort] = {saved_at: 'desc'}\n end\n\n if options[:user_id].present?\n @search_definition[:query][:bool][:should] << {\n term: {user_id: options[:user_id]}\n }\n @search_definition[:query][:bool][:minimum_should_match] = 1\n end\n\n if options[:folder_ids]\n @search_definition[:query][:bool][:should] << {\n terms: {\n folder_id: options[:folder_ids],\n minimum_should_match: 1\n }\n }\n @search_definition[:query][:bool][:minimum_should_match] = 1\n end\n\n if options[:folder_id].present?\n f = {term: {folder_id: options[:folder_id]}}\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:source].present?\n f = {term: {source: options[:source]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:site_name].present?\n f = {term: {'page.site_name' => options[:site_name]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:since].present?\n f = {range: {saved_at: {gte: Time.zone.parse(options[:since].to_s)}}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:saved_by].present?\n f = {term: {saved_by: options[:saved_by]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n end\n\n if options[:keywords].present?\n f = {term: {keywords: options[:keywords]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:sort].present?\n @search_definition[:sort] = {options[:sort] => 'desc'}\n @search_definition[:track_scores] = true\n end\n\n if options[:decay] and query.present?\n @search_definition[:query] = {\n function_score: {\n functions: [{\n gauss: {\n creation_epoch: {\n origin: Time.zone.now.to_i,\n scale: CONFIG[:link][:decay]\n }\n }\n }],\n query: @search_definition[:query],\n score_mode: 'multiply'\n }\n }\n end\n\n @search_definition\n end", "def query_mode\n node_text(node_tagged(:querymode, :exclude => :subquery))\n end", "def query_mode\n node_text(node_tagged(:querymode, :exclude => :subquery))\n end", "def keyword_based_service?; end", "def add_general_query\n fields = [\n \"creators.name^5\",\n \"title^7\",\n \"endnotes\",\n \"notes\",\n \"summary\",\n \"tags.name\",\n \"series.title\"\n ]\n query_string = options[:q]\n return if query_string.blank?\n body.must(\n :query_string,\n fields: fields,\n query: query_string\n )\n end", "def match_query(query); end", "def operator_list searchable_attr = {}, criteria_symbols ={}\n\n operators = {}\n searchable_attr.each{|attr|\n operator_key = attr_2_operator_sym(attr)\n if criteria_symbols.include?(attr) then\n \n if params[operator_key] then\n if not params[operator_key].blank?\n operators[attr]=params[operator_key]\n else\n # should raise an exception \n #operators[attr]='matches'\n #cannot be matches as this does not work for all data types in db\n operators[attr]='eq'\n end # not params\n else\n # should raise an exception\n #operators[attr]='matches'\n #cannot be matches as this does not work for all data types in db\n operators[attr]='eq' \n end # not params\n else\n \n # These criteria are missed in the run through the criteria, so we here add the operator and attr even though there is only an operator\n if operators_that_dont_need_criterion.include?(params[operator_key]) then\n operators[attr] = params[operator_key]\n criterion_key = attr_2_criterion_sym(attr)\n criteria_symbols[attr] = criterion_key\n end # operator does not need criterion\n end # include? \n }\n return operators\n end", "def complete_keyword\n keywords = []\n definition.fields.each do|f|\n next unless f[1].complete_enabled\n if (f[1].key_field)\n keywords += complete_key(f[0], f[1], tokens.last)\n else\n keywords << f[0].to_s + ' '\n end\n end\n keywords.sort\n end" ]
[ "0.6775193", "0.6425376", "0.6425376", "0.6223311", "0.62141836", "0.6197322", "0.61601746", "0.61321044", "0.60698414", "0.60523957", "0.60429716", "0.5958189", "0.5958189", "0.59499913", "0.5911102", "0.5908567", "0.59078825", "0.5899219", "0.5885147", "0.5837124", "0.5837124", "0.5836533", "0.5836533", "0.5808866", "0.58056295", "0.5804974", "0.58021724", "0.5796745", "0.5770664", "0.5767131", "0.5753414", "0.5675665", "0.56513715", "0.56485957", "0.56470245", "0.56297547", "0.5576524", "0.55639714", "0.55588526", "0.5534285", "0.55199456", "0.551803", "0.5505618", "0.55023766", "0.5494578", "0.549224", "0.5488638", "0.5486392", "0.5480451", "0.54636085", "0.5450719", "0.5449869", "0.5444225", "0.5435059", "0.54251343", "0.5423232", "0.54232025", "0.54207903", "0.5414685", "0.54146165", "0.5409692", "0.5407332", "0.54044384", "0.5398175", "0.53973854", "0.53811526", "0.5380947", "0.5380659", "0.5372548", "0.53696805", "0.536156", "0.536156", "0.53564864", "0.5339777", "0.5331593", "0.53220785", "0.53198737", "0.5318428", "0.5313319", "0.53121936", "0.5312124", "0.53113383", "0.52972317", "0.5294908", "0.5269185", "0.52688503", "0.5268252", "0.52662694", "0.5264259", "0.5259425", "0.5257786", "0.52497935", "0.5249263", "0.52462965", "0.52462965", "0.5240887", "0.52375144", "0.52350444", "0.5234626", "0.52294004" ]
0.67507017
1
returns just advancedtype filters
def filters unless (@filters) @filters = {} return @filters unless @params[:f_inclusive] @params[:f_inclusive].each_pair do |field, value_hash| value_hash.each_pair do |value, type| @filters[field] ||= [] @filters[field] << value end end end return @filters end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filters; end", "def filters; end", "def filters\n end", "def typus_filters\n\n fields_with_type = ActiveSupport::OrderedHash.new\n\n if self.respond_to?('admin_filters')\n fields = self.admin_filters\n else\n return [] unless Typus::Configuration.config[self.name]['filters']\n fields = Typus::Configuration.config[self.name]['filters'].split(', ').collect { |i| i.to_sym }\n end\n\n fields.each do |field|\n attribute_type = self.model_fields[field.to_sym]\n if self.reflect_on_association(field.to_sym)\n attribute_type = self.reflect_on_association(field.to_sym).macro\n end\n fields_with_type[field.to_s] = attribute_type\n end\n\n return fields_with_type\n\n end", "def filters\n mentos(:get_all_filters)\n end", "def types_filter\n types_filter = self[:types_filter] || []\n return types_filter if types_filter.any?\n options.fetch 'types_filter', []\n end", "def filters(type=nil)\n unless(type)\n @filters.dup\n else\n const = Splib.find_const(type)\n type = const unless const.nil?\n @filters[type] ? @filters[type].dup : nil\n end\n end", "def advanced_filters_provided?\n true\n end", "def filters\n if metaclass.method_defined? :_filters\n self._filters\n else\n []\n end\n end", "def applicable_filters\n fs = []\n fs << Spree::ProductFilters.taxons_below(self)\n ## unless it's a root taxon? left open for demo purposes\n\n fs << Spree::ProductFilters.price_filter if Spree::ProductFilters.respond_to?(:price_filter)\n fs << Spree::ProductFilters.brand_filter if Spree::ProductFilters.respond_to?(:brand_filter)\n #fs << Spree::ProductFilters.occasion_filter if Spree::ProductFilters.respond_to?(:occasion_filter)\n #fs << Spree::ProductFilters.holiday_filter if Spree::ProductFilters.respond_to?(:holiday_filter)\n fs << Spree::ProductFilters.selective_occasion_filter(self) if Spree::ProductFilters.respond_to?(:selective_occasion_filter)\n fs << Spree::ProductFilters.selective_holiday_filter(self) if Spree::ProductFilters.respond_to?(:selective_holiday_filter)\n fs\n end", "def applicable_filters\n fs = []\n fs << Spree::ProductFilters.taxons_below(self)\n ## unless it's a root taxon? left open for demo purposes\n\n fs << Spree::ProductFilters.price_filter if Spree::ProductFilters.respond_to?(:price_filter)\n fs << Spree::ProductFilters.brand_filter if Spree::ProductFilters.respond_to?(:brand_filter)\n #fs << Spree::ProductFilters.occasion_filter if Spree::ProductFilters.respond_to?(:occasion_filter)\n #fs << Spree::ProductFilters.holiday_filter if Spree::ProductFilters.respond_to?(:holiday_filter)\n fs << Spree::ProductFilters.selective_occasion_filter(self) if Spree::ProductFilters.respond_to?(:selective_occasion_filter)\n fs << Spree::ProductFilters.selective_holiday_filter(self) if Spree::ProductFilters.respond_to?(:selective_holiday_filter)\n fs\n end", "def filters\n self.class.filters\n end", "def allowed_filters\n []\n end", "def filters(type)\n case type\n when :before\n namespaces = self.ancestors + [self]\n all_filters = namespaces.map(&:befores).flatten\n when :after\n namespaces = [self] + self.ancestors.reverse\n all_filters = namespaces.map(&:afters).flatten\n else\n raise 'Invalid filter type. Use :before or :after'\n end\n all_filters.select{|f| f[:opts][:all] || self.send(\"#{type}s\").include?(f) }\n end", "def applicable_filters\n fs = []\n # fs << ProductFilters.taxons_below(self)\n ## unless it's a root taxon? left open for demo purposes\n\n fs << Spree::Core::ProductFilters.price_filter if Spree::Core::ProductFilters.respond_to?(:price_filter)\n fs << Spree::Core::ProductFilters.brand_filter if Spree::Core::ProductFilters.respond_to?(:brand_filter)\n fs\n end", "def typus_fields_for(filter); end", "def filters\n @filters ||= {}\n end", "def filters\n @filters ||= {}\n end", "def filters\n @filters ||= {}\n end", "def non_applied_facets_of_filter_type(filter_type)\n return {} unless has_facets_of_filter_type?(filter_type)\n values = applied_filter_values_of_type(filter_type).map {|v| v.to_s}\n facets_of_filter_type(filter_type).reject {|k,v| values.include?(k.to_s)}\n end", "def filter_complex\n @filtergraph ||= FilterGraph\n end", "def filters\n\t\t@filters_array = Array(@profile[:filters]) unless(@filters_array)\n\t\t@filters_array.each do |filter|\n\n\t\t\tif respond_to?( \"filter_#{filter}\" )\n\t\t\t\t@form.keys.each do |field|\n\t\t\t\t\t# If a key has multiple elements, apply filter to each element\n\t\t\t\t\t@field_array = Array( @form[field] )\n\n\t\t\t\t\tif @field_array.length > 1\n\t\t\t\t\t\t@field_array.each_index do |i|\n\t\t\t\t\t\t\telem = @field_array[i]\n\t\t\t\t\t\t\t@field_array[i] = self.send(\"filter_#{filter}\", elem)\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tif not @form[field].to_s.empty?\n\t\t\t\t\t\t\t@form[field] = self.send(\"filter_#{filter}\", @form[field].to_s)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@form\n\tend", "def applicable_filters\n fs = []\n products_searched = []\n\n if params[:search] \n if @products\n @products.each do |p|\n products_searched << p.id\n end\n end\n else\n products_searched = @taxon.products.all.pluck(:id)\n end\n\n fs << Spree::Core::ProductFilters.selective_filter('Quantity', :selective_quantity_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Manufacturer', :selective_manufacturer_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Use Type', :selective_use_type_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Bullet Type', :selective_bullet_type_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Bullet Weight', :selective_bullet_weight_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Ammo Casing', :selective_ammo_casing_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Ammo Caliber', :selective_ammo_caliber_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Primer Type', :selective_primer_type_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.selective_filter('Condition', :selective_condition_any, products_searched) if Spree::Core::ProductFilters.respond_to?(:selective_filter)\n fs << Spree::Core::ProductFilters.price_filter(products_searched) if Spree::Core::ProductFilters.respond_to?(:price_filter)\n fs\n \n end", "def get_form_filter_types\n [\n [\"From..To\", \"from_to\"],\n [\"Equals\", \"equals\"],\n [\"Not Equal To\", \"not_equals\"],\n [\"Is Greater Than\", \"greater_than\"],\n [\"Is Greater Than Or Equal To\", \"greater_than_or_equal\"],\n [\"Is Less Than\", \"less_than\"],\n [\"Is Less Than Or Equal To\", \"less_than_or_equal\"]\n\n ]\n end", "def filters=(_arg0); end", "def filters=(_arg0); end", "def filter; end", "def filter; end", "def filter; end", "def get_filters(object)\n if @options[:using].is_a?(Array)\n gen_array_attribute_filters(object, @options[:using])\n else\n gen_map_attribute_filters(object, @options[:using])\n end\n end", "def strict_filters; end", "def available_filters\n unless @available_filters\n initialize_available_filters\n @available_filters.each do |field, options|\n options[:name] ||= l(options[:label] || \"field_#{field}\".gsub(/_id$/, ''))\n end\n end\n @available_filters\n end", "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 or_filters\n read_attribute('or_filters') || {}\n end", "def filter\n end", "def result_filters\n\t\t[\"undefined\",\"nan\",\"null\",\"infinity\",DEFAULT_RESULT,\".\",\"!\"]\n\tend", "def filtered_abuses\n [AbuseType::OTHER]\n end", "def liquid_filters\n [\n DesignResourceFilter,\n AttributeFilter\n ]\n end", "def all\n @filters\n end", "def direct_filter_data\n data = {}\n direct_filters.group_by { |tag| tag.type.underscore.pluralize }.\n each_pair { |type, values| data[type] = tag_list(values) }\n data\n end", "def simple_fields\n fields.select(&:filterable?)\n end", "def filter(*args); Typelib.filter_function_args(args, self) end", "def get_team_filters\n filters = []\n self.feed_teams.each do |ft|\n if ft.sharing_enabled?\n filters << ft.filters.to_h.reject{ |k, _v| PROHIBITED_FILTERS.include?(k.to_s) }.merge({ 'team_id' => ft.team_id })\n end\n end\n filters\n end", "def index_filters\n {}\n end", "def filters= options = {}\n prominent = [ :eid, :url ]\n narrowing = options.keys & Ydl::Videos.columns - prominent\n @filters = { prominent: prominent, narrowing: narrowing }\n end", "def filter\n @filter\n end", "def filter_group query_params, *types\n types = [:select, :scope, :date_range, :search] if types.empty?\n query_params.filters.each do |field, config|\n type = config[:type]\n concat render_filter(query_params, field, type) if types.include?(type || :search)\n end\n end", "def supportedTextFilters()\n TextFilter.find(:all).collect do |filter|\n MovableTypeStructs::TextFilter.new(:key => filter.name, :label => filter.description)\n end\n end", "def filters\n @filters ||= FiltersProvider.new\n end", "def resource_type_filter\n return filter_for(:resource_type_id,\n objects_to_names_and_ids(current_user.company.resource_types),\n session[:resource_filters], ResourceType.model_name.human)\n end", "def filter\n\t\treturn @filter\n\tend", "def filter_methods; end", "def all_filters(**args)\n params = parameters(args) do\n optional_params :type\n end\n request(:get, 'filters', params)\n end", "def filters\n [\n GoHiring::SlackMarkdown::Filters::MergeMethodFilter,\n GoHiring::SlackMarkdown::Filters::HeaderFilter,\n GoHiring::SlackMarkdown::Filters::EmptyBlockFilter,\n GoHiring::SlackMarkdown::Filters::BlockBreakerFilter\n ]\n end", "def global_filter; end", "def filter(type, &b)\n @app.filters[type] << b\n end", "def resource_type_filter\n return filter_for(:resource_type_id, \n objects_to_names_and_ids(current_user.company.resource_types),\n session[:resource_filters], _(\"Resource Type\"))\n end", "def meantime_filters #:nodoc:\n @meantime_filters ||= read_inheritable_attribute('meantime_filters') || []\n end", "def filtered_abuses\n AbuseType.values - [AbuseType::OTHER]\n end", "def filter_pipeline\n @filter_pipeline ||= HTML::Pipeline.new([TypogrubyFilter])\n end", "def filterable?; @filterable; end", "def add_filters(filters); end", "def available_filters_as_json\n json = {}\n available_filters.each do |field, options|\n json[field] = options.slice(:type, :name, :values).stringify_keys\n end\n json\n end", "def available_filters_as_json\n json = {}\n available_filters.each do |field, options|\n json[field] = options.slice(:type, :name, :values).stringify_keys\n end\n json\n end", "def filter\n\tfilter_disabled\n\tfilter_repeated\n\tfilter_silenced\n\tfilter_dependencies\n end", "def config_filters\n []\n end", "def get_filter_backends\n return self.class.filter_backends || []\n end", "def ts_apply_filters\n # TODO: Make filters for Thinking Sphinx\n end", "def get_ifilters\n retval = Ifilter.order(:name) #retval = Ifilter.all\n get_internal_ifilters.each do |f|\n retval.prepend(f)\n end\n\n return retval\n end", "def get_feed_filters\n filters = self.filters.to_h.reject{ |k, _v| PROHIBITED_FILTERS.include?(k.to_s) }\n filters.merge!({ 'report_status' => ['published'] }) if self.published\n filters\n end", "def instance_filters\n @instance_filters ||= []\n end", "def filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters\n end", "def apply_filter\n end", "def filtertype_op\n\t\t\tFILTERTYPE_OP[ self.filtertype.to_sym ]\n\t\tend", "def facets_of_filter_type(filter_type)\n return unless filter_class = available_filter_of_type(filter_type)\n proper_field = has_applied_filter_of_type?(filter_type) ? applied_filter_of_type(filter_type).field : filter_class.field\n self.facets.options.delete(:page)\n self.facets.options.delete(:per_page)\n self.facets[proper_field]\n end", "def filter_parameters; end", "def filter_parameters; end", "def add_term_filters\n body.filter(:term, posted: true)\n body.filter(:term, hidden_by_admin: false)\n body.filter(:term, restricted: false) unless include_restricted?\n body.filter(:term, unrevealed: false) unless include_unrevealed?\n body.filter(:term, anonymous: false) unless include_anon?\n body.filter(:term, chapter_count: 1) if options[:single_chapter]\n\n %i(complete language crossover).map do |field|\n value = options[field]\n body.filter(:term, field => value) unless value.nil?\n end\n add_tag_filters\n end", "def strict_filters=(_arg0); end", "def filter(query_type, options = {})\n bool.filter(query_type, options)\n self\n end", "def filters\n # Call model column on self (metadata since element in array is a string, not a variable hence we use send) <=> self.send(profile) == true\n %w[sight_seeing_adventurer art_lover serial_shopper nature_lover food_addict sport_lover history_passionate tech_fan relaxed city_wanderer].select! {|profile| send(profile) == true }\n end", "def filters\n unless @filters\n @filters = {}\n return @filters unless @params[:f_inclusive] && @params[:f_inclusive].respond_to?(:each_pair)\n @params[:f_inclusive].each_pair do |field, value_array|\n @filters[field] ||= value_array.dup\n end\n end\n @filters\n end", "def autofilter\n true\n end", "def filter\n super\n end", "def default_filters\n return [SearchFilter.new(operator:\"-\", filter_type:\"RESTRICT\", field:Field.new(code:\"*\"), values:[\"*\"])]\n end", "def default_filters\n return [SearchFilter.new(operator:\"-\", filter_type:\"RESTRICT\", field:Field.new(code:\"*\"), values:[\"*\"])]\n end", "def usage_filters\n get('/1/reporting/filters').to_a\n end", "def filter!; end", "def or_filters_provided?\n true\n end", "def acceptable_filter_scopes\n []\n end", "def index\n @filter_methods = FilterMethod.all\n end", "def filter_scopes\n @filter_scopes ||= scopes.inject({}) do |result, element|\n result[element.first] = element.last if element.last[:type] != :boolean\n result\n end\n end", "def filter(&block)\n filters = self.filters << yield\n metaclass.send(:define_method, :_filters) do\n filters\n end\n end", "def applicable_category_filters\n return {} if current_category_level > 3\n facet_name = ProductSearcher::CATEGORY_LEVEL_FACET_MAP[current_category_level + 1]\n facet = self.facets[facet_name.to_sym]\n facet_id_and_count_to_model_and_count(facet, Category).sort{|a,b| b[1] <=> a[1]}[0..19]\n end", "def filter_types(input)\n input.reject { |k,v|\n ( skipped_types + [:notype, :other] ).include?(v[:type])\n }\n end", "def filter_available?\r\n # -1 = unused, 2 = Filter used\r\n self.query.ole_object.ortype == -1 ||\r\n self.query.ole_object.ortype == 2\r\n end", "def filter(options={})\n raise NotImplementedError\n end", "def filtered_index(type)\n return unless (term = params.dig(:filter, :term).strip)\n\n case type\n when :clade\n clade_filter(term)\n when :region\n region_filter(term)\n # when :user\n # user_filter(term)\n end\n end", "def add_filters\n add_term_filters\n add_terms_filters\n add_range_filters\n end", "def cost_filters\n get('/1/reporting/cost/filters').to_a\n end" ]
[ "0.7341577", "0.7341577", "0.71478045", "0.70831174", "0.70450586", "0.7012888", "0.6963002", "0.6932608", "0.6915274", "0.6892258", "0.6892258", "0.6834419", "0.6751952", "0.67210317", "0.66579914", "0.65859604", "0.65724003", "0.65724003", "0.6566239", "0.65251976", "0.64905965", "0.6476727", "0.645843", "0.6454443", "0.64238137", "0.64238137", "0.640522", "0.640522", "0.640522", "0.6370688", "0.6359757", "0.63543415", "0.6344509", "0.63430345", "0.6322942", "0.6278035", "0.627496", "0.62693286", "0.625786", "0.62499434", "0.6246287", "0.6244058", "0.6201676", "0.6201342", "0.61842525", "0.6174504", "0.61716634", "0.61519", "0.61441445", "0.6141654", "0.61212945", "0.6110218", "0.610936", "0.6108233", "0.6104924", "0.60975176", "0.6097131", "0.6093298", "0.60912246", "0.607745", "0.60614383", "0.6054582", "0.6048142", "0.6048142", "0.60445946", "0.6043592", "0.6030351", "0.60293907", "0.6028142", "0.6024513", "0.60108525", "0.6008058", "0.60058343", "0.5997511", "0.5996704", "0.59873664", "0.59873664", "0.59556013", "0.59470147", "0.59455913", "0.5940227", "0.5934597", "0.59317833", "0.59240323", "0.58957976", "0.58957976", "0.58686775", "0.5854974", "0.5846682", "0.5836274", "0.5832797", "0.5824262", "0.5816385", "0.58151925", "0.5807033", "0.58068085", "0.5803646", "0.57985604", "0.5783563", "0.577838" ]
0.6548252
19
this method is necessary to access the cell contents directly it's not meant to be used outside of the collaborator classes FIXME feels a bit like a kludge
def at(x, y) @codeGrid[y][x] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cells\n @cells\n end", "def cells\n @cells\n end", "def contents_of(cell)\n \" \"\n end", "def actual_cells\n @cells.compact\n end", "def cells\n attributes.fetch(:cells)\n end", "def get_elem cell\n\t\treturn @elements[cell]\n\tend", "def contents_of cell:\n\t\tif distances && distances[cell]\n\t\t\tdistances[cell].to_s(36)[-1]\n\t\telse\n\t\t\t\" \"\n\t\tend\n\tend", "def build_cell(cell)\n # implement in row class\n nil\n end", "def read_cell_content(row, idx)\n cell = row.at(idx)\n if cell.class == ::Spreadsheet::Formula\n # Formulas oftentimes lose type information\n cell = cell.value.to_f rescue cell.value\n cell = cell.to_i if (cell.to_f % 1).zero? rescue cell\n end\n\n cell\n end", "def get_contents(col)\n @entire.map {|hash| hash[col]}\n end", "def cells\n @cells ||= []\n end", "def getCell(row,col)\n the_row = @rows[row]\n the_cell = the_row.cells[col]\n return the_cell\n end", "def content\n @row.html\n end", "def render_cell(*)\n Capybara.string super\n end", "def get_row_contents(row)\n @board.slice(row*9,9)\n end", "def update_content(data)\n data.values.each do |change|\n row = change[0].to_i\n col = change[1].to_i\n cell = self[row][col]\n cell.content = change.last\n cell.save\n end\n end", "def elements_from_cell_or_self(cell)\n case cell.class.name\n when 'Alchemy::Cell'\n cell.elements\n when 'String'\n cell_elements_by_name(cell)\n else\n elements.not_in_cell\n end\n end", "def source\n notebook.notebook.code_cells_source[cell_number]\n end", "def getCell(row, column)\n\n\t\treturn @grid.getElement(row, column)\n\tend", "def get_cell(cell)\n query_cell_info '/cell/get', cell\n end", "def content\n\t\treturn GridCreator.fromArray(self.contents, :horizontal => true)\n\tend", "def get_cell(row, column)\n @fields[row][column]\n end", "def contents\n self.content\n end", "def cell_key\n \"#{self.name} Cells\"\n end", "def get_other_col_cells cell\n\t\treturn get_col_cells(get_col cell) - [cell]\n\tend", "def initialize(cell)\n super(cell)\n end", "def row; end", "def cells\n rows.flatten\n end", "def cellAt(row, col)\n\t\treturn @rows[row][col]\n\tend", "def content\n number_to_skip = 0 # Keeps track of the # of columns to skip\n \n html = ''\n table.header.column_names.each do |column|\n number_to_skip -= 1 and next if number_to_skip > 0\n \n if cell = @cells[column]\n number_to_skip = (cell[:colspan] || 1) - 1\n else\n cell = Cell.new(column, nil)\n end\n \n html << cell.html\n end\n \n html\n end", "def get_row_elements(row)\n @cells[row]\n end", "def to_s\n\t\t\t\"Cell at (#{@row}, #{@col})[visible:#{@visible} content:#{@content} bombs:#{@bombs_count}]\"\n\t\tend", "def cell_slicing\n\t\t\talias_method :cells_slice_assign, :[]=\n\t\t\talias_method :cells_slice, :[]\n\t\t\tprivate :cells_slice_assign, :cells_slice\n\t\n\t\t\tdefine_method(:[]=) do |*args|\n\t\t\t\tindex = args[0..-2]\n\t\t\t\told_value = cells_slice(*index)\n\t\t\t\tcells_slice_assign(*args)\n\t\t\t\tnew_value = cells_slice(*index)\n\t\n\t\t\t\t# avoid notifying observers of non-updates\n\t\t\t\tif old_value == new_value\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\n\t\t\t\tbegin\n\t\t\t\t\t@cells_observers[:[]].select!{|pattern, block| block.weakref_alive?}\n\t\t\t\t\t@cells_observers[:[]].each do |pattern, block|\n\t\t\t\t\t\tif pattern === new_value\n\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\tblock.call(new_value, old_value, self, index)\n\t\t\t\t\t\t\trescue WeakRef::RefError\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue NoMethodError, TypeError\n\t\t\t\tend\n\t\n\t\t\t\tbegin\n\t\t\t\t\t@cells_internal_observers[:[]].select!{ |argsblock, target| target.weakref_alive? }\n\t\t\t\t\t@cells_internal_observers[:[]].each do |argsblock, target|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\ttarget.calculate(*argsblock[0], &argsblock[1])\n\t\t\t\t\t\trescue WeakRef::RefError\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue NoMethodError, TypeError\n\t\t\t\tend\n\t\t\tend\n\t\n\t\t\t#define getter\n\t\t\tdefine_method(:[]) do |*args|\n\t\t\t\t# needed by Object#calculate to figure out which cells a formula\n\t\t\t\t# depends on\n\t\t\t\tif $cells_read_protocoll\n\t\t\t\t\t$cells_read_protocoll.push([self, :[]])\n\t\t\t\tend\n\t\t\t\tcells_slice(*args)\n\t\t\tend\n\t\tend", "def cell(row, column)\n row = row(row)\n cell_value( row.get_or_create_cell( column ) )\n end", "def cell(row_index, column_index)\n row(row_index).cell(column_index)\n end", "def get_cell(id, column_family_name, column_name)\n if cell = connection.get(name, id, \"#{column_family_name.to_s}:#{column_name.to_s}\", {}).first\n MassiveRecord::Wrapper::Cell.populate_from_tcell(cell)\n end\n end", "def cells\n rows.map { |r| r[key] }\n end", "def extract_text(cell)\n return nil if cell.nil?\n cell.text\nend", "def cell(cell)\n @board[cell]\n end", "def read_cells(sheet = default_sheet)\n validate_sheet!(sheet)\n return if @cells_read[sheet]\n\n sheet_found = false\n doc.xpath(\"//*[local-name()='table']\").each do |ws|\n next unless sheet == attribute(ws, 'name')\n\n sheet_found = true\n col = 1\n row = 1\n ws.children.each do |table_element|\n case table_element.name\n when 'table-column'\n @style_defaults[sheet] << table_element.attributes['default-cell-style-name']\n when 'table-row'\n if table_element.attributes['number-rows-repeated']\n skip_row = attribute(table_element, 'number-rows-repeated').to_s.to_i\n row = row + skip_row - 1\n end\n table_element.children.each do |cell|\n skip_col = attribute(cell, 'number-columns-repeated')\n formula = attribute(cell, 'formula')\n value_type = attribute(cell, 'value-type')\n v = attribute(cell, 'value')\n style_name = attribute(cell, 'style-name')\n case value_type\n when 'string'\n str_v = ''\n # insert \\n if there is more than one paragraph\n para_count = 0\n cell.children.each do |str|\n # begin comments\n #=begin\n #- <table:table-cell office:value-type=\"string\">\n # - <office:annotation office:display=\"true\" draw:style-name=\"gr1\" draw:text-style-name=\"P1\" svg:width=\"1.1413in\" svg:height=\"0.3902in\" svg:x=\"2.0142in\" svg:y=\"0in\" draw:caption-point-x=\"-0.2402in\" draw:caption-point-y=\"0.5661in\">\n # <dc:date>2011-09-20T00:00:00</dc:date>\n # <text:p text:style-name=\"P1\">Kommentar fuer B4</text:p>\n # </office:annotation>\n # <text:p>B4 (mit Kommentar)</text:p>\n # </table:table-cell>\n #=end\n if str.name == 'annotation'\n str.children.each do |annotation|\n next unless annotation.name == 'p'\n # @comment ist ein Hash mit Sheet als Key (wie bei @cell)\n # innerhalb eines Elements besteht ein Eintrag aus einem\n # weiteren Hash mit Key [row,col] und dem eigentlichen\n # Kommentartext als Inhalt\n @comment[sheet] = Hash.new unless @comment[sheet]\n key = [row, col]\n @comment[sheet][key] = annotation.text\n end\n end\n # end comments\n if str.name == 'p'\n v = str.content\n str_v += \"\\n\" if para_count > 0\n para_count += 1\n if str.children.size > 1\n str_v += children_to_string(str.children)\n else\n str.children.each do |child|\n str_v += child.content #.text\n end\n end\n str_v = str_v.gsub(/&apos;/, \"'\") # special case not supported by unescapeHTML\n str_v = CGI.unescapeHTML(str_v)\n end # == 'p'\n end\n when 'time'\n cell.children.each do |str|\n v = str.content if str.name == 'p'\n end\n when '', nil, 'date', 'percentage', 'float'\n #\n when 'boolean'\n v = attribute(cell, 'boolean-value').to_s\n end\n if skip_col\n if !v.nil? || cell.attributes['date-value']\n 0.upto(skip_col.to_i - 1) do |i|\n set_cell_values(sheet, col, row, i, v, value_type, formula, cell, str_v, style_name)\n end\n end\n col += (skip_col.to_i - 1)\n end # if skip\n set_cell_values(sheet, col, row, 0, v, value_type, formula, cell, str_v, style_name)\n col += 1\n end\n row += 1\n col = 1\n end\n end\n end\n doc.xpath(\"//*[local-name()='automatic-styles']\").each do |style|\n read_styles(style)\n end\n\n fail RangeError unless sheet_found\n\n @cells_read[sheet] = true\n @comments_read[sheet] = true\n end", "def current_cell_items\n @cell_items[@current_room_id]\n end", "def render_cell(column_name,cell_value,record)\n \"\"\n end", "def col; end", "def o_in_cell?\n\n end", "def cell(row, col, sheet = nil)\n sheet ||= @default_sheet\n read_cells(sheet)\n\n @cell[sheet].fetch(normalize(row, col).to_a, nil)\n end", "def [](column_nr)\n @content[column_nr]\n end", "def inner_text; end", "def inner_text; end", "def check_cell_status(x_coord, y_coord)\n\t\treturn @state[x_coord][y_coord].content\n\tend", "def build_cell(cell)\n cell.selectionStyle = self.row.selection_style || UITableViewCellSelectionStyleBlue\n cell.swizzle(:layoutSubviews) do\n def layoutSubviews\n old_layoutSubviews\n\n center = lambda {|frame, dimen|\n ((self.frame.size.send(dimen) - frame.size.send(dimen)) / 2.0)\n }\n\n self.textLabel.center = CGPointMake(self.frame.size.width / 2, self.textLabel.center.y)\n self.detailTextLabel.center = CGPointMake(self.frame.size.width / 2, self.detailTextLabel.center.y)\n end\n end\n nil\n end", "def cell_with_id(cell_id)\n cell(:id, cell_id).text\n end", "def build_cell(cell)\n update_cell_value(cell)\n observe(self.row, \"value\") do |old_value, new_value|\n update_cell_value(cell)\n end\n nil\n end", "def cells\n if @cells.blank?\n\n @cells = []\n self.loopoff_file_names.each do |f|\n @cells << Lt::FileCell.new(:name => f,\n :size => File.size(f),\n :sha => self.file_ids_hash[File.basename(f)],\n :is_identical => self.db.repo.distinct_blobs.map(&:id).include?(self.file_ids_hash[File.basename(f)]) \n )\n end\n end\n @cells \n end", "def evaluate\n super\n content\n end", "def get_other_row_cells cell\n\t\treturn get_row_cells(get_row cell) - [cell]\n\tend", "def give_cell_status\n cell = get_cell\n cell_status(cell)\n end", "def read_cells(sheet=nil)\n sheet = @default_sheet unless sheet\n sheet_found = false\n raise ArgumentError, \"Error: sheet '#{sheet||'nil'}' not valid\" if @default_sheet == nil and sheet==nil\n raise RangeError unless self.sheets.include? sheet\n n = self.sheets.index(sheet)\n #TODO: @sheet_doc[n].find(\"//*[local-name()='c']\").each do |c|\n @sheet_doc[n].xpath(\"//*[local-name()='c']\").each do |c|\n #TODO: s_attribute = c.attributes.to_h['s'].to_i # should be here\n s_attribute = c['s'].to_i # should be here\n #TODO: if (c.attributes.to_h['t'] == 's')\n # c: <c r=\"A5\" s=\"2\">\n # <v>22606</v>\n # </c>, format: , tmp_type: float\n\n if c['t'] == 's'\n tmp_type = :shared\n #TODO: elsif (c.attributes.to_h['t'] == 'b')\n elsif c['t'] == 'b'\n tmp_type = :boolean\n else\n #s_attribute = c.attributes.to_h['s'].to_i # was here\n s_attribute = c['s'].to_i # was here\n format = attribute2format(s_attribute)\n tmp_type = format2type(format)\n end\n formula = nil\n #TODO: c.each_element do |cell|\n c.children.each do |cell|\n #TODO: if cell.name == 'f'\n if cell.name == 'f'\n formula = cell.content\n end\n #TODO: if cell.name == 'v'\n if cell.name == 'v'\n if tmp_type == :time or tmp_type == :datetime\n if cell.content.to_f >= 1.0 \n if (cell.content.to_f - cell.content.to_f.floor).abs > 0.000001 \n tmp_type = :datetime \n else\n tmp_type = :date\n end\n else\n end \n end\n excelx_type = [:numeric_or_formula,format.to_s]\n excelx_value = cell.content\n if tmp_type == :shared\n vt = :string\n str_v = @shared_table[cell.content.to_i]\n excelx_type = :string\n elsif tmp_type == :boolean\n vt = :boolean\n cell.content.to_i == 1 ? v = 'TRUE' : v = 'FALSE'\n elsif tmp_type == :date\n vt = :date\n v = cell.content\n elsif tmp_type == :time\n vt = :time\n v = cell.content\n elsif tmp_type == :datetime\n vt = :datetime\n v = cell.content\n elsif tmp_type == :formula\n vt = :formula\n v = cell.content.to_f #TODO: !!!!\n else\n vt = :float\n v = cell.content\n end\n #puts \"vt: #{vt}\" if cell.text.include? \"22606.5120\"\n #TODO: x,y = split_coordinate(c.attributes.to_h['r'])\n x,y = split_coordinate(c['r'])\n tr=nil #TODO: ???s\n set_cell_values(sheet,x,y,0,v,vt,formula,tr,str_v,excelx_type,excelx_value,s_attribute)\n end\n end\n end\n sheet_found = true #TODO:\n if !sheet_found\n raise RangeError\n end\n @cells_read[sheet] = true\n end", "def cells\r\n assert_exists \r\n arr_cells = get_cells\r\n row_cells = Array.new(arr_cells.length)\r\n for i in 0..arr_cells.length - 1 do\r\n row_cells[i] = TableCell.new(@container, :jssh_name, arr_cells[i])\r\n end\r\n return row_cells\r\n end", "def [](row, column)\n cell(row, column)\n end", "def cell(row, column)\n Cell.new(@data, row, column)\n end", "def text\n self.entry\n end", "def cell_name\n self.name.underscore.sub(/_cell\\Z/, '')\n end", "def cell\n {\n # Use the model's properties to populate data in the hash\n title: name,\n # subtitle: {}\n }\n end", "def make_cell\n # Some::ArrayCell.new\n end", "def get_col_contents(col)\n column_string = \"\"\n\n (0..8).each do |row|\n column_string << @board.slice(row * 9 + col,1)\n end\n\n column_string\n end", "def rowcell_value(object, item, item_count)\n this_value = object.this_value(item[:code], item[:lookup], item[:format],\n item[:placeholder])\n if item_count == 1 || item[:label] == false\n this_value\n else\n \"#{object.this_label(item[:code], item[:action_name], item[:label])} : #{this_value}\"\n end\n end", "def cell(reference)\n if inline_ast.call(current_sheet_name.last,reference.upcase.gsub('$',''),references)\n @replacements_made_in_the_last_pass += 1\n ast = references[current_sheet_name.last][reference.upcase.gsub('$','')]\n if ast\n map(ast)\n else\n [:blank]\n end\n else\n if current_sheet_name.size > 1\n [:sheet_reference,current_sheet_name.last,[:cell,reference]]\n else\n [:cell,reference]\n end\n end\n end", "def note_contents\n self.notes.each.map{|note| note.content}\n end", "def persist_cell\n cell = Row::Cell.new cur_family, cur_qaul, cur_ts, cur_val, cur_labels\n row.cells[cur_family] << cell\n\n # Clear cached cell values\n self.cur_val = nil\n self.cur_ts = nil\n self.cur_labels = nil\n end", "def cells\n Enumerator.new do |yielder|\n buffer.each do |row|\n row.each do |cell|\n yielder << cell\n end\n end\n end\n end", "def build_cell(cell)\n cell.selectionStyle = self.row.selection_style || UITableViewCellSelectionStyleBlue\n field = UITextField.alloc.initWithFrame(CGRectZero)\n field.tag = TEXT_FIELD_TAG\n\n observe(self.row, \"value\") do |old_value, new_value|\n break_with_semaphore do\n update_text_field(new_value)\n end\n end\n\n field.clearButtonMode = UITextFieldViewModeWhileEditing\n field.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter\n field.textAlignment = row.text_alignment || NSTextAlignmentRight\n\n field.keyboardType = keyboardType\n\n field.secureTextEntry = true if row.secure?\n field.returnKeyType = row.return_key || UIReturnKeyNext\n field.autocapitalizationType = row.auto_capitalization if row.auto_capitalization\n field.autocorrectionType = row.auto_correction if row.auto_correction\n field.clearButtonMode = row.clear_button || UITextFieldViewModeWhileEditing\n field.enabled = row.editable?\n field.inputAccessoryView = input_accessory_view(row.input_accessory) if row.input_accessory\n\n add_callbacks(field)\n\n cell.swizzle(:layoutSubviews) do\n def layoutSubviews\n old_layoutSubviews\n\n # viewWithTag is terrible, but I think it's ok to use here...\n formotion_field = self.viewWithTag(TEXT_FIELD_TAG)\n formotion_field.sizeToFit\n\n field_frame = formotion_field.frame\n field_frame.origin.x = self.textLabel.frame.origin.x + self.textLabel.frame.size.width + Formotion::RowType::Base.field_buffer\n field_frame.origin.y = ((self.frame.size.height - field_frame.size.height) / 2.0).round\n field_frame.size.width = self.frame.size.width - field_frame.origin.x - Formotion::RowType::Base.field_buffer\n formotion_field.frame = field_frame\n end\n end\n\n if UIDevice.currentDevice.systemVersion >= \"6.0\"\n field.swizzle(:setText) do\n def setText(text)\n r = old_setText(text)\n self.sendActionsForControlEvents(UIControlEventEditingChanged)\n r\n end\n end\n end\n\n field.font = BW::Font.new(row.font) if row.font\n field.placeholder = row.placeholder\n field.text = row_value\n cell.addSubview(field)\n field\n\n end", "def read_cell(row, idx)\n return read_cell_date_or_time(row, idx) if date_or_time?(row, idx)\n\n cell = read_cell_content(row, idx)\n case cell\n when Integer, Fixnum, Bignum\n value_type = :float\n value = cell.to_i\n when Float\n value_type = :float\n value = cell.to_f\n when String, TrueClass, FalseClass\n value_type = :string\n value = normalize_string(cell.to_s)\n when ::Spreadsheet::Link\n value_type = :link\n value = cell\n else\n value_type = cell.class.to_s.downcase.to_sym\n value = nil\n end # case\n\n [value_type, value]\n end", "def show_cell(i)\n return @genes[i]\n end", "def build_cell(cell)\n cell.selectionStyle = self.row.selection_style || UITableViewCellSelectionStyleBlue\n update_cell_value(cell)\n observe(self.row, \"value\") do |old_value, new_value|\n update_cell_value(cell)\n end\n nil\n end", "def cellsList(helpLevel)\n list = super(helpLevel)\n if(helpLevel == 3)\n list.push(@cell2)\n end\n return list\n end", "def table_content\n # This makes a call to gift_rows and gets back an array of data that will \n # populate the columns and rows of a table I then included some styling to \n # include a header and make its text bold. I made the row background colors \n # alternate between grey and white Then I set the table column widths\n table gift_rows do\n row(0).font_style = :bold\n self.header = true\n self.row_colors = ['DDDDDD', 'FFFFFF']\n self.column_widths = [180, 180, 180]\n end\n end", "def cell_reader j, cell, attrs\n attrs[@headers[j]] = cell.cell_to_string if @headers[j] =~ /name/\n attrs[@headers[j]] = cell.cell_to_date if @headers[j] =~ /published_date/\n attrs[@headers[j]] = cell.cell_to_array if ['platforms', 'genres', 'tags'].include? @headers[j]\n end", "def rendered_cell_content(route, parameters)\n render_cell(route.klass.underscore.to_sym, route.action.to_sym, parameters)\n end", "def read_cell(x, y)\n offset = (y * @height) + x\n\n @cells[offset] if x >= 0 && y >= 0 && x < @width && y < @height\n end", "def after_build(cell)\n end", "def cell(data)\n rw, col, ixfe = data.unpack('v3')\n\n {\n rw: rw, # rw (2 bytes): An Rw that specifies the row.\n col: col, # col (2 bytes): A Col that specifies the column.\n ixfe: ixfe # ixfe (2 bytes): An IXFCell that specifies the XF record.\n }\n end", "def parse_local_cell(workbook_cell)\n return Workbook::NilValue.new(:covered) if @cell.name == \"covered-table-cell\"\n configure_cell_attributes(workbook_cell)\n valuetype = @cell.xpath(\"@office:value-type\").to_s\n parse_local_value(valuetype)\n end", "def getContent() \n return @obj.getContent().toString()\n end", "def cell_name\n # XXX Why is this needed? Can there be cells which have a different\n # @cell_name from their class's name?\n @cell_name || self.class.cell_name\n end", "def cell_name\n # XXX Why is this needed? Can there be cells which have a different\n # @cell_name from their class's name?\n @cell_name || self.class.cell_name\n end", "def convert_cell(column,xlsx,nrow,ncol)\n d = xlsx.cell(nrow,ncol)\n type = column['type'] || 'string'\n case type\n when 'long'\n d.to_i\n when 'double'\n d.to_f\n when 'string'\n d.to_s\n when 'timestamp'\n convert_time(d)\n else # TODO\n d.to_s\n end\n end", "def cell_value(cell)\n return '' unless(cell)\n\n case cell.getCellType\n when HSSFCell::CELL_TYPE_FORMULA then return cell.getCellFormula\n when HSSFCell::CELL_TYPE_NUMERIC then return cell.getNumericCellValue\n when HSSFCell::CELL_TYPE_STRING then return cell.getStringCellValue\n when HSSFCell::CELL_TYPE_BOOLEAN then return cell.getBooleanCellValue\n when HSSFCell::CELL_TYPE_ERROR then return cell.getErrorCellValue\n\n when HSSFCell::CELL_TYPE_BLANK then return ''\n end\n end", "def getCell(x, y)\n return @grid.getCell(x,y)\n end", "def read_cells(sheet=nil)\n sheet = @default_sheet unless sheet\n raise RangeError, \"illegal sheet <#{sheet}>\" unless sheets.index(sheet)\n sheet_no = sheets.index(sheet)+1\n xml = @gs.fulldoc(sheet_no).to_s\n doc = XML::Parser.string(xml).parse\n doc.find(\"//*[local-name()='cell']\").each do |item|\n row = item['row']\n col = item['col']\n key = \"#{row},#{col}\"\n string_value = item['inputvalue'] || item['inputValue'] \n numeric_value = item['numericvalue'] || item['numericValue'] \n (value, value_type) = determine_datatype(string_value, numeric_value)\n @cell[sheet][key] = value unless value == \"\" or value == nil\n @cell_type[sheet][key] = value_type \n @formula[sheet] = {} unless @formula[sheet]\n @formula[sheet][key] = string_value if value_type == :formula\n end\n @cells_read[sheet] = true\n end", "def cellsList(helpLevel)\n list = super(helpLevel);\n if(helpLevel == 3)\n list.push(cell)\n end\n return list\n end", "def note_contents\n self.notes.map(&:content)\n end", "def note_contents\n self.notes.map(&:content)\n end", "def inspect\n @grid.each {|row| p row.join(\" \")}\n nil\n end", "def hc(row,col)\n build :cell, row: row, col: col\n end", "def get\n (0...@column_size).each {|observation| process_line(observation) }\n @body\n end", "def print_cell(c)\n result = \"-------|\\n\"\n if c.solved?\n rows = <<EOT\n ` ` ` |\n ` #{c.val} ` |\n ` ` ` |\nEOT\n result += rows # don't += on the same line as above, it screws up my syntax highlighting\n return result\n else\n result += print_unsolved_cell(c)\n end\n return result\n end", "def row_cell(table_row,cell_num)\r\n\t\treturn search_results_table_element[table_row][cell_num].text if search_results_table_element.count >= table_row.to_i\r\n\tend", "def cell(row, col, sheet=nil)\n sheet = @default_sheet unless sheet\n read_cells(sheet) unless @cells_read[sheet]\n row,col = normalize(row,col)\n if celltype(row,col,sheet) == :date\n yyyy,mm,dd = @cell[sheet][[row,col]].split('-')\n return Date.new(yyyy.to_i,mm.to_i,dd.to_i)\n elsif celltype(row,col,sheet) == :datetime\n date_part,time_part = @cell[sheet][[row,col]].split(' ')\n yyyy,mm,dd = date_part.split('-')\n hh,mi,ss = time_part.split(':')\n return DateTime.civil(yyyy.to_i,mm.to_i,dd.to_i,hh.to_i,mi.to_i,ss.to_i)\n end\n @cell[sheet][[row,col]]\n end", "def cell_element(identifier)\n platform.cell_for(identifier.clone)\n end", "def cells\n labels = @_cells.keys.map(&:to_sym)\n contents = labels.map { |label| eval(\"@#{label}.excel\") }\n Hash[labels.zip(contents)]\n end", "def glyph i, j\n unless (1..@rows).cover?(i) && (1..@cols).cover?(j)\n raise Exception \"Row #{i} is out of range (max #{@rows})\"\n end\n @contents[i - 1][j - 1]\n end" ]
[ "0.6524635", "0.6524635", "0.652332", "0.63858575", "0.63336927", "0.6305337", "0.62197185", "0.6204106", "0.6173848", "0.60755056", "0.6062459", "0.59461564", "0.58938855", "0.5838327", "0.5832231", "0.582465", "0.5811749", "0.5738986", "0.57300335", "0.5724039", "0.56993717", "0.56923944", "0.56923795", "0.5687243", "0.56571656", "0.565386", "0.56391406", "0.56195754", "0.56162626", "0.56093574", "0.560024", "0.55954", "0.5592751", "0.55726016", "0.5563877", "0.555851", "0.55580974", "0.5554386", "0.5541567", "0.5533641", "0.55198896", "0.55177593", "0.551384", "0.55117583", "0.54991066", "0.5488949", "0.5485796", "0.5485796", "0.5484371", "0.5466946", "0.5461698", "0.54369724", "0.54341775", "0.5427828", "0.5424737", "0.5397576", "0.5390817", "0.5390706", "0.53903794", "0.53650236", "0.53597635", "0.5356807", "0.5355563", "0.53518707", "0.5351225", "0.5346227", "0.53383833", "0.531682", "0.5308853", "0.5302276", "0.52967227", "0.5284325", "0.5283643", "0.5280565", "0.5280227", "0.5278087", "0.52679604", "0.5265261", "0.52649814", "0.52608544", "0.5254969", "0.5235499", "0.5231805", "0.52217424", "0.52217424", "0.5219749", "0.5216152", "0.5206658", "0.52019316", "0.5199184", "0.51978254", "0.51978254", "0.5195217", "0.5193067", "0.5190717", "0.51867527", "0.51859283", "0.51812154", "0.51789266", "0.51710963", "0.5168545" ]
0.0
-1
assignment goes through to the underlying row, so we get the actual part if a CodeGridPosition was passed instead
def []=(column_index, value) @row[column_index] = value.part $dirty << [column_index, @row_index] $blocks_to_redraw << [column_index, @row_index] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cell(args)\n arr = @rows.flatten\n arr[arr.find_index(args[:position])] = args[:piece]\n @rows = arr.enum_for(:each_slice, 3).to_a\n end", "def row(position)\n position[0]\n end", "def row_at(row_idx)\n @grid[row_idx]\n end", "def build_cell(cell)\n # implement in row class\n nil\n end", "def get_row(row_num)\n @grid[row_num]\n end", "def set_pieces\n @pieces.each do |piece|\n y , x = piece.location\n @rows[y][x] = piece\n end\n end", "def at(x, y)\n @codeGrid[y][x]\n end", "def current_row\n @row_offset\n end", "def translate_index_to_grid_position(index)\n @grid_positions[index]\nend", "def get_row_contents(row)\n @board.slice(row*9,9)\n end", "def piece_at(position)\n row = position[0]\n col = position[1]\n @grid[row][col]\n end", "def get_row(row)\n row = $boggle_board[row]\nend", "def grid_row_items\n # noinspection RubyMismatchedReturnType\n row_items\n end", "def grid_row_items\n # noinspection RubyMismatchedReturnType\n row_items\n end", "def position(cell)\n index = cell.to_i - 1\n (index >= 0 && index <= 8) ? self.cells[index] : nil\n end", "def cur_row=(cur_row)\n raise('overrides detected; must use cur_raw_row= instead') if compute_cur_row(cur_row) != cur_row\n\n @cur_raw_row = cur_row\n @cur_row = cur_row\n end", "def set_current_cell\n @current_cell = @map.cells_at[@x][@y]\n end", "def set_code_cell\n @code_cell = CodeCell.find_by!(notebook: @notebook, cell_number: (params[:id].to_i - 1).to_s)\n end", "def row; end", "def prep_for_exploration\n self.grid.map! { |row| row.map! { |spot| spot == \"*\" ? -1 : 0 } }\n end", "def [](row, col)\n #convert row values by * by 9\n @grid[row * 9 + col]\n end", "def position\n [row.position, column.position]\n end", "def ensure_visible row = @current_index\n unless is_visible? row\n @prow = row\n end\n end", "def set_position(row, col)\n if row.between?(0, 7) && col.between?(0, 7)\n @position[:row] = row\n\t @position[:col] = col\n\tend\n end", "def colrow=(val) @records.set(GRT_COLROW, val); end", "def set_current_row_col(array)\r\n current_s_index = array.locate2d(' ')\r\n @current_row = current_s_index.flatten.first\r\n @current_col = current_s_index.flatten.last\r\n end", "def pos=(val)\n #setter method for position \n row, col = val\n @pos = val\n\n end", "def get_row(board, row)\n\tboard[row]\nend", "def get_piece(pos)\n @grid[pos[0]][pos[1]]\n end", "def []=(pos, figure)\n x, y = pos\n @rows[x][y] = figure\n end", "def next_cell(grid)\n raise \"This method should be overridden\"\n end", "def process_row(row)\n row\n end", "def row(grid_size, row_num)\n row_values = ' ' * grid_size\n row_values[row_num - 1] = '*'\n row_values[grid_size / 2] = '*'\n row_values[grid_size - row_num] = '*'\n row_values\nend", "def get_row(board, row)\n board[row]\nend", "def get_row(board, row)\n board[row]\nend", "def rowcol\n return self.row+@row_offset, self.col+@col_offset\n end", "def [](pos)\n row = pos.first\n col = pos.last\n @grid[row][col]\n end", "def get_cell(row, column)\n @fields[row][column]\n end", "def ensure_visible row = @current_index\n unless is_visible? row\n @prow = @current_index\n end\n end", "def cell(row_num, col_num)\n return @puzzle[row_num][col_num]\n end", "def [](pos)\n row, col = pos\n @grid[row][col]\n end", "def current_line_pos\n pos - col\n end", "def get_row(row)\n @boggle_board[row]\n end", "def [](position)\n\n pRow, pColumn = position\n @grid[pRow][pColumn]\n\n end", "def column_for_position(position); end", "def column_for_position(position); end", "def column_for_position(position); end", "def get_row(board, row)\n\treturn board[row]\nend", "def get_row(board, row)\n return board[row]\nend", "def row_position=(position)\n @row_position = position \n end", "def [](row, column)\n\t\treturn nil unless row.between?(0, @rows-1)\n\t\treturn nil unless column.between?(0, @columns-1)\n\t\t@grid[row][column]\n\tend", "def position(pos)\n @cells[to_index(pos)]\n end", "def uncover(row,col)\n @mine_field[:cover][col][row] = true\n end", "def [](pos)\n row, col = pos\n @grid[row][col]\n end", "def get_row(row)\n\t$boggle_board[row]\nend", "def [](pos)\n row, col = pos \n @grid[row][col]\n end", "def update!(row = @row, col = @col)\n @cells[row][col] = yield at(row, col)\n end", "def get_row(board,row)\n\treturn board[row]\nend", "def [](row,col)\n case col\n when 0...81\n @row_column[row][col]\n when 81...162\n @row_number[row][col - 81]\n when 162...243\n @column_number[row][col - 162]\n when 243...324\n @box_number[row][col - 243]\n else\n nil\n end\n end", "def get_value(row, col)\n @rectangle[row][col]\n end", "def row(row)\n Cell.new(@data, row, @column)\n end", "def [](pos)\n row, col = pos\n grid[row][col]\n end", "def [](pos)\n row, col = pos\n grid[row][col]\n end", "def set_form_row\n r,c = rowcol\n @rows_panned ||= 0\n \n #win_row=@form.window.top\n win_row=@win_top # 2010-02-11 15:12 RFED16\n win_row = 0 # 2010-02-07 21:44 now ext offset added by widget\n #win_row = 0 # new approach, we have it \n #win_col=@form.window.left\n # added 1 ?? in copywin too 2010-02-11 18:51 RFED16 this results in extra in normal situations.\n row = win_row + r + (@current_index-@toprow) + @rows_panned \n $log.debug \" #{@name} LIST set_form_row #{row} = ci #{@current_index} + r #{r} + winrow: #{win_row} - tr:#{@toprow} #{@toprow} + rowsp #{@rows_panned} \"\n $log.debug \" - LIST set_form_row row_offset: #{@row_offset} + r #{r} + ci - topr + rowsp: #{@rows_panned}. c= #{c} \"\n\n ## 2009-12-28 23:05 TRYING OUT but i really can't do this everywhere. BUFFERED\n ## this needs to percolate up a heirarchy.\n ## 2010-01-05 21:09 changed c to nil, since c is not cursor col pos but where printing starts, i think\n #@form.setrowcol row, nil\n #setformrowcol row, nil\n setrowcol row, nil\n show_caret_func\n end", "def[]=(pos, value)\n row = pos.first\n col = pos.last\n @grid[row][col] = value\n end", "def grid_modified!\n end", "def line_and_column(pos); end", "def getCell(row,col)\n the_row = @rows[row]\n the_cell = the_row.cells[col]\n return the_cell\n end", "def compute_row(row)\n row\n end", "def row_to_find\n create_coded_row\n end", "def column=(_); end", "def col\r\n @lines[@line_num].cursor\r\n end", "def set_cell(row, column, owner)\n cell = @fields[row][column]\n current_owner = cell.owner\n return if current_owner == owner\n\n cell.owner = owner\n notify_observers(cell, owner)\n end", "def rowAt(row)\n self.tiles[row.to_i * N_COLS, N_COLS]\n end", "def line_for_position(position); end", "def line_for_position(position); end", "def line_for_position(position); end", "def row=(row)\n @row = Utility.clamp(row, 0, GRID_ROWS - 1)\n end", "def row(y)\n i = y - 1\n self.cells.where(y: i)\n end", "def [](pos)\n self.grid[pos[1]][pos[0]]\n end", "def get_cell(x, y)\n grid[x][y]\n end", "def get_row(row)\n board = $boggle_board\n return board[row]\nend", "def cellAt(row, col)\n\t\treturn @rows[row][col]\n\tend", "def next_cell(grid)\n grid.each_with_index do |row, x|\n row.each_with_index do |cell, y|\n return x, y if cell.length > 1\n end\n end\n end", "def [](pos)\n row, col = pos\n @rows[row][col]\n end", "def to_internal_row(row, lines)\n # row = (1..23)\n max_row = @gsi.mnr.to_i\n row = row.to_i\n row = 1 if row < 1\n row = 23 if row > 23\n row = max_row if row > max_row\n # drop lines\n lines_to_drop = lines.length-max_row+row-1\n lines.pop(lines_to_drop) if lines_to_drop > 0\n return row\n end", "def []=(pos, value)\n row, col = pos\n grid[row][col] = value\n end", "def [](pos)\n @grid[pos[0]][pos[1]]\n # row,col = pos\n # @grid[row][col]\n end", "def [](row, col)\n @grid[row][col]\n end", "def row(index)\n end", "def glyph i, j\n unless (1..@rows).cover?(i) && (1..@cols).cover?(j)\n raise Exception \"Row #{i} is out of range (max #{@rows})\"\n end\n @contents[i - 1][j - 1]\n end", "def set_cursor_position(row, col)\n\t\tinvalid_rows = [@cursor_row, row]\n\t\t@cursor_row, @cursor_col = row, col\n\t\tif @cursor_row < first_line_in_view\n\t\t\tset_contents_pos(0, line_num_to_coord(@cursor_row))\n\t\t\temit_changed(nil)\n\t\telsif @cursor_row > last_line_in_view\n\t\t\tset_contents_pos(0, line_num_to_coord(@cursor_row - num_lines_in_view))\n\t\t\temit_changed(nil)\n\t\tend\n\tend", "def position(row, column)\n\t\tcolmn = get_column(column)\n\t\treturn colmn[row] unless colmn.nil?\n\tend", "def get_row(row)\n $boggle_board[row]\nend", "def left_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col-1, cell.row)}\n end", "def top_row=(row)\n if row < 0\n row = 0\n end\n if row > row_max - 1\n row = row_max - 1\n end\n self.oy = row * 116 #116\n end", "def get_row(row,board)\n return board[row] \nend", "def [](pos)\n x, y = pos\n @rows[x][y]\n end", "def get_row(row,board) # row(x,*y)\n\tboard[row]\nend", "def cell_flagger(row_num, col_num)\n\t\t@grid[row_num][col_num].flagger\n\tend", "def colrow() @records.get_data(GRT_COLROW); end" ]
[ "0.6162706", "0.59831804", "0.5907341", "0.5801971", "0.57807225", "0.57263637", "0.5697083", "0.5664467", "0.55998814", "0.5582373", "0.5562", "0.55215603", "0.55120116", "0.55120116", "0.5501046", "0.5482159", "0.54778266", "0.5473612", "0.5461401", "0.5456282", "0.5452968", "0.5451031", "0.5434444", "0.5432563", "0.5426227", "0.54218084", "0.5412652", "0.5411639", "0.5406514", "0.53941447", "0.53782326", "0.53690875", "0.53683937", "0.5354884", "0.5354884", "0.53340536", "0.5330212", "0.5318416", "0.53169596", "0.53068316", "0.53025025", "0.5296762", "0.5285494", "0.52835536", "0.52778184", "0.52778184", "0.52778184", "0.52777904", "0.5261701", "0.52577525", "0.5256039", "0.5242166", "0.5235759", "0.5228686", "0.5220497", "0.52147377", "0.5209073", "0.5208104", "0.52071565", "0.5206676", "0.51949215", "0.5192734", "0.5192734", "0.5192166", "0.5190373", "0.5186615", "0.5183146", "0.51758224", "0.5173297", "0.51720226", "0.51713717", "0.5162193", "0.515997", "0.5156736", "0.5155093", "0.5155093", "0.5155093", "0.515236", "0.5144354", "0.514324", "0.5133865", "0.5133174", "0.5126801", "0.5119805", "0.5112865", "0.51123065", "0.5111342", "0.5110587", "0.5109722", "0.5104038", "0.5100817", "0.50988954", "0.5096966", "0.5096112", "0.50949633", "0.50923115", "0.5088643", "0.50869375", "0.50865436", "0.50765485", "0.50761086" ]
0.0
-1
interacting with the pointed at cell
def ==(part) $theGrid.at(@x, @y) == part end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selection(cell)\n\t\t@last = cell\n\t\t@currentSelection.update(cellsFromFirstToEnd())\n\t\t@currentSelection.show()\n\tend", "def _cell_click\n render :js => handle_cell_click(param(:id).to_i, param(:table), param(:cell_column).to_i, param(:table_view))\n end", "def touch_cell\n self.cell.touch\n end", "def cell(cell)\n @board[cell]\n end", "def set_current_cell\n @current_cell = @map.cells_at[@x][@y]\n end", "def show\n set_cell\n end", "def jumpToCell(row, col)\n new_row = row\n new_col = col\n\n # Only create the row scale if needed.\n if (row == -1) || (row > @rows)\n # Create the row scale widget.\n scale = CDK::SCALE.new(@screen, CDK::CENTER, CDK::CENTER,\n '<C>Jump to which row.', '</5/B>Row: ', Ncurses::A_NORMAL,\n 5, 1, 1, @rows, 1, 1, true, false)\n\n # Activate the scale and get the row.\n new_row = scale.activate([])\n scale.destroy\n end\n\n # Only create the column scale if needed.\n if (col == -1) || (col > @cols)\n # Create the column scale widget.\n scale = CDK::SCALE.new(@screen, CDK::CENTER, CDK::CENTER,\n '<C>Jump to which column', '</5/B>Col: ', Ncurses::A_NORMAL,\n 5, 1, 1, @cols, 1, 1, true, false)\n\n # Activate the scale and get the column.\n new_col = scale.activate([])\n scale.destroy\n end\n\n # Hyper-warp....\n if new_row != @row || @new_col != @col\n return self.moveToCell(new_row, new_col)\n else\n return 1\n end\n end", "def cursor_at(row, col)\n \"\\e[#{row};#{col}H\"\nend", "def notify_revealed(cell); end", "def goto_row(row)\n \n set RGhost::Cursor.goto_row(row) \n end", "def give_cell_status\n cell = get_cell\n cell_status(cell)\n end", "def o_in_cell?\n\n end", "def click(button, x, y)\n # Left Click: Bring a dead cell to life. \n if button == 1 \n x = x / @cell_width\n y = y / @cell_height\n @life.set_cell_alive! x, y\n self.draw\n # Right Click: Re-seed the grid.\n else\n randomize_cells!\n end\n end", "def next_cell(grid)\n raise \"This method should be overridden\"\n end", "def interact\n end", "def cell(row_index, column_index)\n row(row_index).cell(column_index)\n end", "def show_cell(i)\n return @genes[i]\n end", "def cell(pos_x, pos_y)\n @board[pos_y][pos_x]\n end", "def position(user_input)\n\t\tindex = (user_input.to_i-1)\n\t\tself.cells[index]\n\tend", "def position(input)\n self.cells[self.input_to_index(input)]\n end", "def changeCell(cell, symbol)\n\t\t@field[cell].value = symbol\n\tend", "def mouse_up locator\r\n command 'mouseUp', locator\r\n end", "def position(input)\n cells[self.idx(input)]\n end", "def within_gridcell(*arguments, **options, &block)\n within(:gridcell, *arguments, **options, &block)\n end", "def cursor_to( row, col, do_display = DONT_DISPLAY, stopped_typing = STOPPED_TYPING, adjust_row = ADJUST_ROW )\n old_last_row = @last_row\n old_last_col = @last_col\n\n row = row.fit( 0, @lines.length - 1 )\n\n if col < 0\n if adjust_row\n if row > 0\n row = row - 1\n col = @lines[ row ].length\n else\n col = 0\n end\n else\n col = 0\n end\n elsif col > @lines[ row ].length\n if adjust_row\n if row < @lines.length - 1\n row = row + 1\n col = 0\n else\n col = @lines[ row ].length\n end\n else\n col = @lines[ row ].length\n end\n end\n\n if adjust_row\n @desired_column = col\n else\n goto_col = [ @desired_column, @lines[ row ].length ].min\n if col < goto_col\n col = goto_col\n end\n end\n\n new_col = tab_expanded_column( col, row )\n view_changed = show_character( row, new_col )\n @last_screen_y = row - @top_line\n @last_screen_x = new_col - @left_column\n\n @typing = false if stopped_typing\n @last_row = row\n @last_col = col\n @last_screen_col = new_col\n changed = ( @last_row != old_last_row or @last_col != old_last_col )\n if changed\n record_mark_start_and_end\n\n removed = false\n if not @changing_selection and selecting?\n remove_selection( DONT_DISPLAY )\n removed = true\n end\n if removed or ( do_display and ( selecting? or view_changed ) )\n display\n else\n @diakonos.display_mutex.synchronize do\n @win_main.setpos( @last_screen_y, @last_screen_x )\n end\n end\n @diakonos.update_status_line\n @diakonos.update_context_line\n\n @diakonos.remember_buffer self\n end\n\n changed\n end", "def getCell(row,col)\n the_row = @rows[row]\n the_cell = the_row.cells[col]\n return the_cell\n end", "def locate\n x = mouse_x + @viewport.ox\n approx = x * value.length / @sprite.bitmap.width\n match = approach(approx, x)\n @text.cursor_jump(match)\n @viewport.ox -= 10 if mouse_x < 0\n @viewport.ox += 10 if (self.width - mouse_x) < 0\n end", "def get_elem cell\n\t\treturn @elements[cell]\n\tend", "def mouse_clicked\n\t\t# Send the mouse click to the Interaction Controller. It'll do the dirty work.\n\t\t@interaction_controller.mouse_clicked\n\t\tputs \"Editor#mouse_clicked\"\n\tend", "def getCell(row, column)\n\n\t\treturn @grid.getElement(row, column)\n\tend", "def code_cell\r\n # Code the cell (logic in code_cell here)\r\n codings = Mx.code_cell(params)\r\n\r\n # Navigate between cells if you are in on click\r\n if @coding_mode == :one_click \r\n @position += 1\r\n if @mode == 'row'\r\n unless @chrs.length > @position\r\n notice \"You've finished one-click coding for that OTU.\"\r\n redirect_to :action => :show_otus, :id => @mx.id and return\r\n end\r\n @chr = @chrs[@position] # update the @chr, the @otu stays the same\r\n elsif @mode == 'col'\r\n unless @otus.length > @position\r\n notice \"You've finished one-click coding for that character.\"\r\n redirect_to :action => 'show_characters', :id => @mx.id and return\r\n end\r\n @otu = @otus[@position] # update the @otu, the @chr stays the same\r\n else\r\n raise\r\n end\r\n end\r\n\r\n # TODO: This really is not optimal, because we have to laod all the variables again\r\n # Ideally (in the AJAX call here) we'd just render the template 'mxes/code/code' without the redirect\r\n # If we get here in a standard POST we'd get a :code_cell action in the URL/browser using a render :template, which we don't want\r\n redirect_to code_mx_path(@proj, @mx, @mode, @position, @chr, @otu) \r\n end", "def set_cell(row, column, owner)\n cell = @fields[row][column]\n current_owner = cell.owner\n return if current_owner == owner\n\n cell.owner = owner\n notify_observers(cell, owner)\n end", "def at(cell_x, cell_y)\n assert_ok_coords(cell_x, cell_y)\n @grid[cell_x - 1][cell_y - 1]\n end", "def show_focus_on_row row0, _prow, tf=true\n # color = tf ? $reversecolor : $datacolor\n # if cursor on row, reverse else normal\n attr = tf ? Ncurses::A_REVERSE : Ncurses::A_NORMAL\n color = @color_pair\n r = row0+1 \n #check if row is selected or not\n row_att = @list_attribs[_prow] unless @list_attribs.nil?\n if !row_att.nil?\n status = row_att.fetch(:status, \" \")\n attr1 = row_att[:bgcolor] \n color = attr1 unless attr1.nil?\n end\n @datawidth ||= @width-2\n return if r > get_content().length\n @form.window.mvchgat(y=r+@row, x=1+@col, max=@datawidth, attr, color, nil)\n end", "def display\n puts \" #{self.cells[0]} | #{self.cells[1]} | #{self.cells[2]} \"\n puts \"-----------\"\n puts \" #{self.cells[3]} | #{self.cells[4]} | #{self.cells[5]} \"\n puts \"-----------\"\n puts \" #{self.cells[6]} | #{self.cells[7]} | #{self.cells[8]} \"\n end", "def click; end", "def click; end", "def click; end", "def get_cell(cell)\n query_cell_info '/cell/get', cell\n end", "def handle_cell_click(parmid, table, cell_column, table_view)\n puts \"handle_cell_click: #{parmid}, #{table}, #{cell_column}, #{table_view}\"\n # only do this if the table is there\n js_emit = \"if(jQuery('##{table}')){\"\n # js_emit += select_record_js(parmid)\n @record = scoped_model.find_by_id(parmid) || scoped_model.new\n id = @record.id.to_i\n if id > 0\n panel_type = nil\n # Priority goes to actions defined by columns\n # I am preparing to remove column actions, and require that all panels just load _panel.\n # Maybe someday later I can bring back the complexity of column panels if they are really useful for something.\n case @columns[cell_column][:action]\n when 'title_panel', 'panel'\n panel_type = @columns[cell_column][:action]\n panel_object = @columns[cell_column][:object]\n when 'choice'\n js_emit += js_choose_id(@record.id) + parent.update_choice_js(self.name, @record)\n else\n case @jqgrid_options[:row_action]\n when 'title_panel', 'panel'\n panel_type = @jqgrid_options[:row_action]\n panel_object = @jqgrid_options[:row_object]\n when 'choice'\n js_emit += js_choose_id(@record.id) + parent.update_choice_js(self.name, @record)\n end\n end\n else\n # Add\n panel_type = 'title_panel'\n panel_object = @jqgrid_options.has_key?(:add_object) ? @jqgrid_options[:add_object] : @jqgrid_options[:row_object]\n end\n if panel_type\n # specs = jqgrid_make_js({:id => param(:id), :table => param(:table),\n # :cell_column => param(:cell_column), :table_view => param(:table_view)})\n specs = jqgrid_make_js({:id => parmid, :table => table, :panel => panel_object,\n :cell_column => cell_column, :table_view => table_view})\n end\n # If the panel has any jqgrid widgets in it we need to remove them first before bringing in the new\n # edit panel. So look for any child widgets for which form_widget is true.\n self.children.each do |c|\n if defined?(c.jqgrid_id) && defined?(c.is_form_widget) # only do this for jqgrid widgets\n js_emit += \"if(jQuery('##{c.jqgrid_id}')){jQuery('##{c.name}').remove();}\" if c.is_form_widget\n end\n end\n case panel_type\n when 'title_panel'\n js_emit += \"openTitlePanel(#{specs}, jQuery('##{@jqgrid_id}').data('draw_panel_url'), true);\"\n when 'panel'\n js_emit += \"openRowPanel(#{specs}, jQuery('##{@jqgrid_id}').data('draw_panel_url'), true);\"\n end\n js_emit += \"}\"\n # I would like the form to open prior to the retrieval of the child data, but I can't seem to get it\n # to work. It always wants to render the children first. This will require thought.\n js_emit += select_record_js(parmid)\n puts \"handle_cell_click returning: #{js_emit}\"\n js_emit\n end", "def highlight locator\r\n command 'highlight', locator\r\n end", "def box_row_index\n\t\t\tcell / 27 \n\t\tend", "def edit_table_cell(table, coords)\n append_to_script \"edit_table_cell \\\"#{table}\\\" , \\\"#{coords}\\\"\"\n end", "def cellAt(row, col)\n\t\treturn @rows[row][col]\n\tend", "def set_cell(cell, state)\n @board[cell] = state\n end", "def x_in_cell?\n\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def mouse_down locator\r\n command 'mouseDown', locator\r\n end", "def set_cell\n @cell = Cell.find(params[:id])\n end", "def set_cell\n @cell = Cell.find(params[:id])\n end", "def set_cell\n @cell = Cell.find(params[:id])\n end", "def set_cell\n @cell = Cell.find(params[:id])\n end", "def wire_jqgrid_cellselect(options)\n <<-JS\n onCellSelect: function(rowid,cellindex,html,event) {\n \tvar specs = clickSpecsData(rowid,cellindex,event.target),\n \turl = jQuery('##{@jqgrid_id}').data('cell_click_url');\n\t\t\tjQuery.get(url, specs, null, 'script');\n },\n JS\n end", "def jump\n @manipulators.inject(@history) { |h, man| man.manipulate!(h) }\n end", "def press(point)\n\t\t\t\t\n\t\t\tend", "def input\n # The program has to remember that the user is dragging an object\n # even when the mouse is no longer over that object\n # So detecting input and processing input is separate\n # detect_input\n # process_input\n if inputs.mouse.up\n state.current_input = :none\n elsif star_clicked?\n state.current_input = :star\n end\n\n if mouse_inside_grid?\n unless grid.target == cell_closest_to_mouse\n grid.target = cell_closest_to_mouse\n end\n if state.current_input == :star\n unless grid.star == cell_closest_to_mouse\n grid.star = cell_closest_to_mouse\n end\n end\n end\n end", "def on_button(b, evnt, coords)\n #puts \"B#{b} #{evnt}, #{coords}\"\n end", "def clicked(mouse_event)\n end", "def display\n\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n\n end", "def clicked;end", "def input_target\n old_target = grid.target.clone\n grid.target = cell_closest_to_mouse\n unless old_target == grid.target\n reset_search\n end\n end", "def mouseover_cell(loc)\n mouse_cell_x = loc[:x].to_i / @box_side_length.to_i\n mouse_cell_y = loc[:y].to_i / @box_side_length.to_i\n {x: mouse_cell_x, y: mouse_cell_y, z: 0}\n end", "def display\r\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\r\n puts \"-----------\"\r\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\r\n puts \"-----------\"\r\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\r\n end", "def show_caret_func\n return unless @show_caret\n # trying highlighting cursor 2010-01-23 19:07 TABBEDPANE TRYING\n # TODO take into account rows_panned etc ? I don't think so.\n @rows_panned ||= 0\n r,c = rowcol\n yy = r + @current_index - @toprow - @win_top\n #xx = @form.col # how do we know what value has been set earlier ?\n yy = r + @current_index - @toprow #- @win_top\n yy = @row_offset + @current_index - @toprow #- @win_top\n xx = @col_offset + @curpos || 0\n #yy = @row_offset if yy < @row_offset # sometimes r is 0, we are missing something in tabbedpane+scroll\n #xx = @col_offset if xx < @col_offset\n #xx = 0 if xx < 0\n\n $log.debug \" #{@name} printing CARET at #{yy},#{xx}: fwt:- #{@win_top} r:#{@row} tr:-#{@toprow}+ci:#{@current_index},+r #{r} \"\n if !@oldcursorrow.nil?\n @graphic.mvchgat(y=@oldcursorrow, x=@oldcursorcol, 1, Ncurses::A_NORMAL, $datacolor, NIL)\n end\n @oldcursorrow = yy\n @oldcursorcol = xx\n @graphic.mvchgat(y=yy, x=xx, 1, Ncurses::A_NORMAL, $reversecolor, nil)\n @buffer_modified = true\n end", "def cell(row_num, col_num)\n return @puzzle[row_num][col_num]\n end", "def putch char\n @current_index ||= 0\n if @editable \n raise \"how is it editable here in combo\"\n super\n return 0\n else\n match = next_match(char)\n text match unless match.nil?\n fire_handler :ENTER_ROW, self\n end\n @modified = true\n fire_handler :CHANGE, self # 2008-12-09 14:51 ???\n 0\n end", "def connect_cells(cell)\n @connected_cells << cell\n cell.connected_cells << self\n end", "def position(input)\n self.cells[input.to_i - 1]\n end", "def click locator\r\n command 'click', locator\r\n end", "def click locator\r\n command 'click', locator\r\n end", "def set_focus_on arow\n @oldrow = @current_index\n @current_index = arow\n bounds_check if @oldrow != @current_index\n end", "def cell_pressed (source)\n @delegate.shopPremiumCell(self, buttonPressed: source) if @delegate.respond_to? 'shopPremiumCell:buttonPressed:'\n end", "def row_tell\n @index\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def display\n puts \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n puts \"-----------\"\n puts \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n puts \"-----------\"\n puts \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n end", "def click\n @clicked_x = @x\n @clicked_y = @y\n fire(:click, @clicked_x, @clicked_y)\n end", "def display\n puts \" #{@cells[0]} | #{@cells[1]} | #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} | #{@cells[4]} | #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} | #{@cells[7]} | #{@cells[8]} \"\n end", "def display\n puts \" #{@cells[0]} | #{@cells[1]} | #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} | #{@cells[4]} | #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} | #{@cells[7]} | #{@cells[8]} \"\n end", "def do_action(event)\n case event.class.to_s\n when 'CellClickEvent'\n place_counter(event.col)\n when 'ForfeitClickEvent'\n forfeit\n when 'CounterSelectedEvent'\n @counter_select = event.index\n false\n else\n false\n end\n end", "def position(user_input)\n cells[user_input.to_i - 1]\n end", "def clicked(e)\n \n end", "def select_next!\n pane.next_row!\n end", "def position(user_input)\n return self.cells[user_input.to_i - 1]\n end", "def display\n puts \"#{@cell[0..2].join(\" | \")}\"\n puts \"---------\"\n puts \"#{@cell[3..5].join(\" | \")}\"\n puts \"---------\"\n puts \"#{@cell[6..8].join(\" | \")}\"\n \n end", "def position(pos)\n @cells[to_index(pos)]\n end", "def do_goto\n return if @updating\n\n new_value = $document.at_css('#tryruby-index').value.to_i\n if new_value >= 0\n update_screen(get_step_content(new_value, @editor.value, @output.value))\n end\n end", "def make_move!\n return false if get_cell_value(row, column).present?\n\n self.send cell_column(row, column, false), icon\n win? || drawn?\n\n self.save\n end", "def click\r\n start_point = screen.find ident\r\n click_x = start_point.x + offset_x\r\n click_y = start_point.y + offset_y\r\n\r\n screen.click click_x, click_y\r\n end", "def cell(row, column)\n row = row(row)\n cell_value( row.get_or_create_cell( column ) )\n end", "def position(input)\n\t\tcells[input.to_i - 1]\n\tend", "def tableView(table_view, didSelectRowAtIndexPath: path)\n i = path.indexAtPosition(1)\n # puts \"row selected: #{i}\"\n end", "def get_cell(x, y)\n grid[x][y]\n end", "def display\n puts \" #{@cells[0]} | #{@cells[1]} | #{@cells[2]} \"\n puts \"-----------\"\n puts \" #{@cells[3]} | #{@cells[4]} | #{@cells[5]} \"\n puts \"-----------\"\n puts \" #{@cells[6]} | #{@cells[7]} | #{@cells[8]} \"\nend", "def active_cells; @cells.select(&:active?) end", "def opponent_in_cell(index, board)\n board.cells[index.to_i] == self.opponent_token\n end", "def getCell(x, y)\n return @grid.getCell(x,y)\n end", "def set_selection_for_char char=nil\n char = _ask_a_char unless char\n return :UNHANDLED if char == :UNHANDLED\n #alert \"got #{char}\"\n @oldrow = @current_index\n @last_regex = /^#{char}/i\n ix = next_regex @last_regex\n return unless ix\n @current_index = ix[0] \n #alert \"curr ind #{@current_index} \"\n @search_found_ix = @current_index\n @curpos = ix[1]\n ensure_visible\n return @current_index\n end", "def position(cell)\n index = cell.to_i - 1\n (index >= 0 && index <= 8) ? self.cells[index] : nil\n end", "def bubble_down(index)\n #YOUR WORK HERE\n end" ]
[ "0.6595937", "0.6444704", "0.63723683", "0.6344221", "0.6335378", "0.6194271", "0.61497897", "0.60813284", "0.6063878", "0.60170776", "0.59164035", "0.5910524", "0.5800149", "0.57907146", "0.5703414", "0.56727654", "0.56603825", "0.5655755", "0.5655123", "0.560214", "0.55950665", "0.55740625", "0.55729383", "0.55571765", "0.55376613", "0.55325305", "0.5530613", "0.55244267", "0.55040026", "0.55023515", "0.5495886", "0.54714555", "0.5471334", "0.54696757", "0.5467571", "0.54490113", "0.54490113", "0.54490113", "0.5433911", "0.5427608", "0.5422665", "0.5420878", "0.54147774", "0.54096633", "0.5408495", "0.5400988", "0.5388205", "0.5388205", "0.53785", "0.53785", "0.53785", "0.53785", "0.5366454", "0.5363067", "0.53618515", "0.5361363", "0.53605074", "0.5359398", "0.5354434", "0.53453743", "0.5345357", "0.53411794", "0.5335193", "0.53201985", "0.53201264", "0.5305996", "0.5304218", "0.5303479", "0.52971894", "0.52971894", "0.52860874", "0.52816767", "0.5279276", "0.52791506", "0.52791506", "0.52791506", "0.52791506", "0.52730197", "0.5272822", "0.5272822", "0.5272597", "0.5272545", "0.5268891", "0.526664", "0.5264683", "0.52625716", "0.5256462", "0.5252555", "0.5251178", "0.5249958", "0.52488554", "0.52455723", "0.52336293", "0.52326757", "0.52258635", "0.52249056", "0.5217854", "0.52085215", "0.52047825", "0.5198901", "0.519575" ]
0.0
-1
wrapping this method so it returns a position, so other methods can be &. chained to it
def crate? $theGrid.at(@x, @y).crate? ? self : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos()\n #This is a stub, used for indexing\n end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def pos()\n #This is a stub, used for indexing\n end", "def pos()\n #This is a stub, used for indexing\n end", "def position=(_arg0); end", "def pos() end", "def pos() end", "def pos() end", "def pos() end", "def pos=(_arg0); end", "def to_position\n self\n end", "def position\n end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos\n end", "def pos\n end", "def pos\n end", "def pos=(pos); end", "def pos() @current end", "def pos\n @pos\n end", "def position\n current.position\n end", "def starting_position=(_arg0); end", "def position\n @position\n end", "def position\n return @position\n end", "def position\n return @position\n end", "def pos=\n end", "def pos=\n end", "def position\n first.position\n end", "def position _args\n \"position _args;\" \n end", "def pos= integer\n #This is a stub, used for indexing\n end", "def lookAtPos _obj, _args\n \"_obj lookAtPos _args;\" \n end", "def starting_position; end", "def pos\n @position[:current]\n end", "def pos &blk\r\n build_piece Positive, blk\r\n end", "def offset(*) end", "def begin_pos=(_); end", "def at(position)\n self[position]\n end", "def offset\n\t\t\t@position + @offset\n\t\tend", "def update_position\n xsub = find{ |n| n.respond_to?(:position) }\n position = xsub.position if xsub\n end", "def to position\n self[0..position]\n end", "def pos\n @pos || uninitialized!\n end", "def begin_pos; end", "def position=(point); end", "def getPos _args\n \"getPos _args;\" \n end", "def position(arg_)\n vector_ = _vector(arg_)\n vector_ ? Position.new(self, vector_) : nil\n end", "def offset; end", "def offset; end", "def offset; end", "def map_with_pos(&block)\n dup.map_with_pos!(&block)\n end", "def retreat\n @position = @position - 1 rescue -1\n self[@position + 1]\n end", "def position \n\t\treturn @y,@x\n\tend", "def set_position!\n return if position.present?\n\n self.position = self.class.count\n end", "def location(line, pos)\n raise NotImplementedError\n end", "def to(position)\n first position + 1\n end", "def to(position)\n first position + 1\n end", "def end_pos=(_); end", "def tell\n @pos\n end", "def current_offset; end", "def update_position\n end", "def update_position\n end", "def update_position\n end", "def cur_pos\n @cursor.pos\n end", "def get_position_list\n\n end", "def pos\n return Rubygame::Ftor.new(@x,@y)\n end", "def position!\n raise TZDetect::Error::Geocoder, \"not implemented method position!\"\n end", "def offset(arg0)\n end", "def position()\n @view__.position.toVector\n end", "def pos=(p0) end", "def pos=(p0) end", "def pos=(p0) end", "def pos=(p0) end", "def arguments\n [position.to_s]\n end", "def freeze\n @position.freeze\n super\n end", "def pos=(arg0)\n end", "def position\n return [@x, @y, @heading]\n end", "def increment_position\n return unless in_list?\n # self_class_all_or_in_collection.where(:pos => my_position).\n adjust_position!(1)\n end", "def save_pos; end", "def position_result\n hurdle_match.rank.index(self) + 1\n end", "def get_item_at(position)\n # TODO Stubbed - Required definition and implementation\n end", "def explore(pos)\n end", "def position\n [@x, @y]\n end", "def position_inserted(position)\n end", "def positions(passes) = passes.map { find_position(_1) }", "def path_pos()\n raise NotImplementedError.new\n end", "def position\n\t\t[ @x, @y ]\n\tend", "def pos\n\t\tif not moved_to.nil? and moved?\n\t\t\tsquare.neighbor( moved_to )\n\t\telse\n\t\t\tsquare\n\t\tend\n\tend", "def get_item_at(position)\n # TODO Stubbed - Required definition and implementation\n end", "def from(position)\n self[position..-1]\n end", "def position\n @entry.position\n end", "def position\n [x, y]\n end" ]
[ "0.7715312", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.7582428", "0.75589454", "0.75589454", "0.74888235", "0.74669373", "0.74669373", "0.74669373", "0.74669373", "0.73013514", "0.7284325", "0.7267006", "0.7242483", "0.7242483", "0.7242483", "0.7242483", "0.7242483", "0.7242483", "0.71348053", "0.71348053", "0.71348053", "0.699595", "0.69324595", "0.68740034", "0.68687624", "0.6823943", "0.67793876", "0.6739799", "0.6739799", "0.67147166", "0.67147166", "0.6579065", "0.6538059", "0.6522917", "0.6495681", "0.6487552", "0.6406145", "0.6352171", "0.6335281", "0.62826985", "0.6280302", "0.6277903", "0.6277", "0.62721723", "0.6262071", "0.6234587", "0.6234406", "0.6225183", "0.62139916", "0.62030363", "0.62030363", "0.62030363", "0.6193428", "0.6157579", "0.6146204", "0.6143779", "0.6138553", "0.60600823", "0.60600823", "0.6058678", "0.60491806", "0.6048561", "0.60334766", "0.60334766", "0.60334766", "0.60029227", "0.5991976", "0.5968392", "0.59639174", "0.59605134", "0.5942093", "0.59257156", "0.59257156", "0.59257156", "0.59257156", "0.59240866", "0.588761", "0.5871069", "0.58707225", "0.58655685", "0.58649737", "0.58482367", "0.58470416", "0.5826314", "0.5823322", "0.5814401", "0.58130103", "0.58118355", "0.58048046", "0.5803949", "0.5794873", "0.5789407", "0.5777124", "0.57576334" ]
0.0
-1
moving through the grid
def up @y.positive? ? $theGrid[@y-1][@x] : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn\n\t\tnew_grid = Array.new(@size + 1) { Array.new(@size + 1)}\n\t\t0.upto(@size) do |row|\n\t\t\t0.upto(@size) do |column|\n\t\t\t\tnew_grid[column][@size - row] = @grid[row][column]\n\t\t\tend\n\t\tend\n\t\t@grid = new_grid\n\tend", "def next_move\n return false if @n.zero? && @grid.empty?\n show_path\n end", "def iterate\r\n\t\tif @gameover\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\tk = @args.inputs.keyboard\r\n\r\n\t\tif k.key_down.up\r\n\t\t\trotate\r\n\t\tend\r\n\r\n\t\t#nie wychodzenie poza ramki\r\n\t\tif k.key_down.left && @current_piece_x>0\r\n\t\t\t@current_piece_x -= 1\r\n\t\tend\r\n\t\tif k.key_down.right && ((@current_piece_x+@current_piece.length) < @grid_w)\r\n\t\t\t@current_piece_x += 1\r\n\t\tend\r\n\t\tif (k.key_down.down || k.key_held.down) && !colliding\r\n\t\t\t@next_move -= 3 #ile razy szybciej\r\n\t\tend\r\n\r\n\t\t@next_move -= 1\r\n\t\tif @next_move <= 0\r\n\t\t\t#jeżeli koliduje to umieszczamy na stałe klocek w tym miejscu (zapisując na planszy jego kratki jako 1)\r\n\t\t\tif colliding\r\n\t\t\t\tplant_current_piece\r\n\t\t\telse\r\n\t\t\t\t@next_move =10\r\n\t\t\t\t@current_piece_y += 1\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def run\n hash_num = grid.get_hash_pos(@data).length\n for k in 0...hash_num-1\n move_down(k)\n move_right(k)\n move_left(k)\n end\n end", "def turn()\n\n\t\tnewGrid = Grid.new(grid.rows, grid.columns)\n\t\t\n\t\t@grid.iterate do | cell |\n\t\t\tnextState = deadOrAlive(cell)\n\t\t\tnewGrid.matrix[cell.row][cell.column] = Cell.new(cell.row, cell.column, nextState)\n\t\tend\n\n\t\t@grid = newGrid\n\tend", "def go_to_next_row()\n turn_left()\n move()\n turn_left()\n end", "def grid_move(new_grid_pos)\n @grid_pos = new_grid_pos\n @ori_x = original_x\n @ori_y = original_y\n self.battle_phase = :move\n end", "def change_gridview(dx, dy)\n rec = @grid_viewport.rect\n @grid_viewport.rect.set(rec.x+dx,rec.y+dy,rec.width,rec.height)\n for row in @tiles\n for box in row\n box.moveby(dx, dy)\n end\n end\n end", "def scroll_forward\n #@oldindex = @current_index\n @current_index += @scrollatrows\n @prow = @current_index - @scrollatrows\n end", "def assignGrid grid\n @grid = grid\n\n #if starting point of rover is at an obstacle, move rover over till hit free spot\n if @grid.obstacles.include?(@currentPos)\n print \"Grid has obstacle at rover starting position. Landed rover at (\"\n\n loop do\n moveForward\n break if !@grid.obstacles.include?(@currentPos)\n end\n\n print \"#{@currentPos.x}, #{@currentPos.y}) instead\\n\"\n end\n end", "def each_move\n SQ.select { |i| @colors[i] == @mx }.each do |f|\n if @pieces[f] == PAWN\n t = f + UP[@mx]\n yield(f, t + 1) if @colors[t + 1] == @mn && SQ120[SQ64[t] + 1] != NULL\n yield(f, t - 1) if @colors[t - 1] == @mn && SQ120[SQ64[t] - 1] != NULL\n next unless @colors[t] == EMPTY\n yield(f, t)\n yield(f, t + UP[@mx]) if @colors[t + UP[@mx]] == EMPTY && (f >> 3) == (SIDE[@mx] - 1).abs\n next\n end\n STEPS[@pieces[f]].each do |s|\n t = SQ120[SQ64[f] + s]\n while t != NULL\n yield(f, t) if @colors[t] != @mx\n break if @pieces[f] == KING || @pieces[f] == KNIGHT || @colors[t] != EMPTY\n t = SQ120[SQ64[t] + s]\n end\n end\n end\n end", "def connect_cells\n @grid.each_with_index do |columns, col_i|\n columns.each_with_index do |cell, cell_i|\n cell.left = @grid[col_i-1][cell_i] if col_i != 0 \n cell.up = @grid[col_i][cell_i+1] if cell_i + 1 < columns.length\n cell.right = @grid[col_i+1][cell_i] if col_i + 1 < @grid.length\n cell.down = @grid[col_i][cell_i-1] if cell_i != 0\n cell.lu = @grid[col_i-1][cell_i+1] if col_i != 0 && cell_i + 1 < columns.length\n cell.ld = @grid[col_i-1][cell_i-1] if col_i != 0 && cell_i != 0\n cell.ru = @grid[col_i+1][cell_i+1] if col_i + 1 < @grid.length && cell_i + 1 < columns.length\n cell.rd = @grid[col_i+1][cell_i-1] if col_i + 1 < @grid.length && cell_i != 0\n end\n end\n end", "def scroll_forward\n @oldindex = @current_index\n @current_index += @scrollatrows\n @prow = @current_index - @scrollatrows\n end", "def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend", "def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend", "def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend", "def nextMove(n,r,c,grid)\n # place m on grid at r,c\n actions = generate_path(grid, 'm','p')\n puts actions[0]\n grid[r][c] = '-'\n if actions[0] == 'LEFT'\n grid[r][c-1]='m'\n elsif actions[0] == 'RIGHT'\n grid[r][c+1]='m'\n elsif actions[0] == 'UP'\n grid[r-1][c]='m'\n elsif actions[0] == 'DOWN'\n grid[r+1][c]='m'\n end\n actions[0]\n end", "def moves\n # All pieces can stay in place\n [[0,0]]\n end", "def move\n\t\tunless @y >= 0 then\n\t\t\t@y += 1\n\t\tend\n\t\tif @x_total <= 150 and @y_total <= 150 then\n\t\t\t@x += 1\n\t\t\t@y += 1\n\t\t\t@x_total +=1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 150 and @y_total > 150 and @x_total < 300 and @y_total < 300 then\n\t\t\t@y -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 298 and @y_total > 298 and @x_total < 450 and @y_total < 450 then\n\t\t\t@y +=1\n\t\t\t@x -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total > 448 and @y_total > 448 and @x_total < 600 and @y_total < 600 then\n\t\t\t@y -= 1\n\t\t\t@x_total += 1\n\t\t\t@y_total += 1\n\t\tend\n\t\tif @x_total == 599 and @y_total == 599 then\n\t\t\t@x_total = @y_total = 0\n\t\tend\n\tend", "def change_grid(grid, list, starting_pos, i, hash)\n\tpos = starting_pos.dup\n\ttotal_steps = 0\n\tlist.each do |command|\n\t\tdir = command[0]\n\t\tmag = command[1..-1].to_i\n\t\tdraw_path(grid, pos, dir, mag, i, total_steps, hash)\n\t\ttotal_steps += mag\n\tend\nend", "def move_to_next_generation\n @x.times{ |r|\n @y.times{|c| \n @mat[r][c].step_generation\n }\n } \n end", "def update\n update_grid = Array.new(@grid_height) { Array.new(@grid_width, 0) }\n update_grid.each_index do |row|\n update_grid[row].each_index do |col|\n num_neighbours = get_num_neighbours col, row\n if (@grid[row][col] == 1 && num_neighbours.between?(2, 3)) ||\n (@grid[row][col] == 0 && num_neighbours == 3)\n update_grid[row][col] = 1\n end\n end\n end\n @grid = update_grid\n end", "def walk(grid, x, y)\n [N, S, E, W].shuffle.each do |dir|\n nx, ny = x + DX[dir], y + DY[dir]\n if nx >= 0 && ny >= 0 && ny < grid.length && nx < grid[ny].length && grid[ny][nx] == 0\n grid[y][x] |= dir\n grid[ny][nx] |= OPPOSITE[dir]\n \n return [nx, ny]\n end\n end\n \n nil\nend", "def step\n new_board = Array.new(@size) { Array.new(@size, false) }\n\n (0...@size).each do |x|\n (0...@size).each do |y|\n new_board[x][y] = compute_cell_fate(x, y)\n end\n end\n\n @board = new_board\n end", "def game_over \n # all the grid's cells are full and different numbers \n end", "def build_next_moves current_node\n cur_pos = current_node.value \n\n (0...8).each do |col|\n (0...8).each do |row|\n next_pos = [col, row] \n if valid_move?(cur_pos,next_pos)\n current_node.add_child(PolyTreeNode.new(next_pos))\n @all_positions[next_pos] = true \n end\n end\n end\n end", "def moves(board, start_pos)\n end", "def next_states\n states = []\n for direction in [\"up\", \"down\", \"left\", \"right\"] do\n new_rows = slide(direction)\n states << Grid.new(@x, @y, new_rows) unless new_rows.nil?\n end\n states\n end", "def position_for_next_harvest()\n turn_right()\n move()\n turn_right()\n end", "def turn_loop\n # @tet = TET_2ROW#.sample\n @tet = TETS.sample\n @logger.info(\"turn #{@turn}\")\n STDIN.iflush\n @turn_state = @grid.mcopy # save state at start of turn(each block is turn)\n @pos = @start_pos.mcopy\n @subturn = 0\n subturn_loop\n # check for full row\n increase_score(process_completed_lines)\n end", "def play_piece(index,player,grid)\n row = 7\n col = index\n\n while grid[row][col] != \".\"\n row -= 1\n end\n\n # creates \"dropping\" animation for the piece played\n drop_row = 0\n until drop_row == row\n grid[drop_row][col] = player\n print_board(grid)\n sleep(0.05)\n grid[drop_row][col] = \".\"\n drop_row += 1\n end\n\n grid[row][col] = player\n\n coordinates = [row,col]\n return coordinates\nend", "def grid\n \t\t\tfinal, y = Array.new, 0\n \t\t\t@@axis.fetch(:y).times do\n \t\t\t\tfinal[y], x = Array.new, 0\n \t\t\t\t@@axis.fetch(:x).times do\n \t\t\t\t\tfinal[y][x] = init_coord(x, y)\n \t\t\t\t\tx += 1\n \t\t\t\tend\n \t\t\t\ty += 1\n\t\t\tend\n\t\t\tfinal.reverse\n\t\tend", "def grow_unblocked_moves_in_dir(dx,dy)\n start_x, start_y = self.pos\n #start for rook white === [7,0]\n # [6,0]\n # [5,0]\n # [4,0]\n # [3,0]\n # [2,0]\n\n dx = -1 #first iteration UP\n dy = 0\n\n\n 1.step do |i|\n start_x += dx\n start_y += dy\n if self.board.rows[start_x][start_y].empty? #[6,0]\n\n end\n # create an array to collect moves\n\n # get the piece's current row and current column\n\n\n # in a loop:\n # continually increment the piece's current row and current column to \n # generate a new position\n # stop looping if the new position is invalid (not on the board); the piece \n # can't move in this direction\n # if the new position is empty, the piece can move here, so add the new \n # position to the moves array\n # if the new position is occupied with a piece of the opposite color, the \n # piece can move here (to capture the opposing piece), so add the new \n # position to the moves array\n # but, the piece cannot continue to move past this piece, so stop looping\n # if the new position is occupied with a piece of the same color, stop looping\n\n # return the final moves array\n end\n \nend", "def step\n @seed.text = @row.cells\n \n @canvas.append do\n image width, CELL_HEIGHT do\n @row.draw(self)\n end\n end\n @canvas.scroll_top = @canvas.scroll_max\n \n @row = @row.next\n end", "def moves\n # overridden in slideable/stepable modules\n end", "def move(cx, cy)\n # append and insert new columns on each row\n @cells.each do |row|\n row.unshift(new_cell(row.first.x - CELL_DISTANCE_X, row.first.y))\n row << new_cell(row.last.x + CELL_DISTANCE_X, row.last.y)\n end\n\n # append and insert new rows\n 2.times do\n new_row = @cells.first.map { |c| new_cell(c.x + (@cells.size % 2 == 0 ? -1 : 1) * CELL_OFFSET_X_EVEN_ROW, c.y - CELL_DISTANCE_Y) }\n @cells.unshift(new_row)\n\n new_row = @cells.last.map { |c| new_cell(c.x + (@cells.size % 2 == 0 ? -1 : 1) * CELL_OFFSET_X_EVEN_ROW, c.y + CELL_DISTANCE_Y) }\n @cells << new_row\n end\n\n @cells.each do |row|\n row.delete_if do |c|\n (cx - c.x).abs > SCREEN_WIDTH ||\n (cy - c.y).abs > SCREEN_HEIGHT\n end\n end\n @cells.delete_if { |r| r.empty? }\n\n puts \"rows: #{@cells.size}, cols: #{@cells.first.size}\"\n end", "def next_generation\n new_grid = generate_grid\n\n @x.times do |x|\n @y.times do |y|\n # If there are more than one nodes on a square, rotate them.\n if @grid[x][y].length > 1\n new_nodes = []\n @grid[x][y].each do |node|\n # Don't want to introduce nil elements into the grid\n new_direction = rotate_direction(node)\n new_nodes << new_direction unless new_direction.nil?\n end\n\n @grid[x][y] = new_nodes\n end\n\n # If we are at an edge, reverse direction\n @grid[x][y].each do |node|\n if (x == 0 and node == :left) or\n (x == @x - 1 and node == :right) or\n (y == 0 and node == :up) or\n (y == @y - 1 and node == :down)\n\n @grid[x][y].delete node\n\n # Don't want to introduce nil elements into the grid.\n new_direction = reverse_direction(node)\n @grid[x][y] << new_direction unless new_direction.nil?\n end\n end\n\n # Finally, perform the relevant moves\n @grid[x][y].each do |node|\n case node\n when :up\n new_grid[x][y-1] << :up\n when :down\n new_grid[x][y+1] << :down\n when :left\n new_grid[x-1][y] << :left\n when :right\n new_grid[x+1][y] << :right\n end\n end\n end\n end\n\n return new_grid\n end", "def next_cell(grid)\n raise \"This method should be overridden\"\n end", "def next_generation!\n @grid = next_generation\n end", "def move_east\n @x += 1\n end", "def populate_board\n #the six rows get updated\n players.each do |player|\n rows = player == players[0] ? [ 0,1,2 ] : [ 5,6,7 ]\n piece_count = 0\n col = 0\n\n player.pieces.each do |piece|\n\n rows.shift if piece_count % 4 == 0 and piece_count != 0\n\n col_start = rows[0] % 2 == 1 ? 0 : 1\n col = 0 if (col_start == 0 || col_start == 1) && piece_count % 4 == 0\n\n piece.position = [col + col_start, rows[0]]\n squares[[col + col_start, rows[0]]] = piece\n\n col += 2\n piece_count += 1\n\n end\n\n end\n\n end", "def fill_grid(grid)\r\n\tmax = grid.length - 1\r\n\t(1..max).each do |row|\r\n\t\t(1..max).each do |col|\r\n\t\t\tgrid[row][col] = (grid[row][col - 1]) + (grid[row -1][col])\r\n\t\tend\r\n\tend\r\nend", "def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end", "def notify(start_row, start_col)\n @has_moved = true\n end", "def move\n # Choose a random cell\n # JAVI: Extend this part of the method to choose cell with lower number of surveys (on average)\n cell = cells_around(@loc).rand\n \n # possibly a good location\n # first look ahead \n if !touches_path? cell, @path, @loc \n \n # do 1 more look ahead for each further possible step to avoid this:\n #\n # . . . . .\n # v < < . .\n # v . ^ . .\n # v . ^ < .\n # v . x o .\n # v x ? x .\n # > > ^ . .\n # . . . . . \n #\n # ^v<> = path\n # o = start\n # ? = possible good looking next move\n # x = shows that this is a dead end. All further steps are not allowed.\n #\n # Therefore, if any further step from cell is possible, then we're good to go\n \n # Configure future\n future_path = @path.dup\n future_path << cell\n second_steps = cells_around(cell)\n \n # If at least one of the future steps is valid, go for it\n second_steps.each do |ss|\n if !touches_path? ss, future_path, cell\n @path << cell\n @loc = cell\n @distance -= 1 \n return true\n end\n end \n end \n \n Rails.logger.debug \"*****************\"\n Rails.logger.debug \"Location: #{@loc.to_s}, New move: #{cell.to_s}.\"\n Rails.logger.debug \"Path: #{@path.to_s}\" \n \n false \n #cells = Cell.all :conditions => \"(x = #{@x-1} AND y = #{@y}) OR (x = #{@x+1} AND y = #{@y}) OR (x = #{@x} AND y = #{@y-1}) OR (x = #{@x} AND y = #{@y+1})\",\n # :order => \"positive_count + negative_count ASC\"\n \n # if all the cells have already been surveyed, weight index to those with few surveys \n #if cells.size == 4\n # i = rand(3)\n # i = (i - (i * 0.1)).floor \n # @x = cells[i].x\n # @y = cells[i].y\n # return\n #end\n \n # if there are empty cells, make a new cell where there's a gap and use that \n #[@x, @y-1] *<-- ALWAYS GOING DOWN\n #existing_cells = cells.map {|c| [c.x, c.y]}\n #survey_cell = (possible_cells - existing_cells).rand\n end", "def frame_loop\n row = @pos[0]; col = @pos[1]\n @subturn_frames.times do |frame| # subsubturn\n test_pos = get_move(@pos)\n break if @quit_flag == true\n\n if test_pos\n @logger.info(\"@pos: #{@pos}, test_pos: #{test_pos}\")\n test_grid = @turn_state.mcopy.collide(@tet, test_pos.mcopy)\n # @logger.info(test_grid.to_s)\n unless test_grid.nil?\n @pos = test_pos.mcopy\n @grid = test_grid.mcopy\n end\n @logger.info(\"TWO @pos: #{@pos}, test_pos: #{test_pos}\")\n draw(\"T: #{@turn}, ST: #{@subturn}, F: #{frame}, m: #{@move}, p: #{@pos}, score: #{@score}\") # call only if moved\n @move = nil\n # if reaches bottom, next turn\n #\n end\n STDIN.raw!\n sleep @frame_time\n end\n end", "def set_cell_coordinates\n x = 0\n while x < 6\n y = 0\n while y < 7\n grid[x][y].co_ord = [x + 1, y + 1]\n y += 1\n end\n x += 1\n end\n end", "def render\n @pressed.map do |idx, state|\n next unless state\n if on_grid?\n xx, yy = coords_for(idx: idx)\n change_grid(x: xx, y: yy, color: @colors.down)\n else\n change_command(position: @position, color: @colors.down)\n end\n end\n end", "def traverse_grid(rows, cols, dead_zones, paths)\n paths ||= Array.new(rows) {Array.new(cols)}\n\n #recursive step\n return traverse_grid(rows-1, cols) || traverse_grid(rows, cols-1)\nend", "def make_move(board, display)\n new_pos = nil\n until new_pos\n display.render\n new_pos = display.cursor.get_input\n end\n new_pos\n end", "def incrementX\n @currentPos.x += 1\n if @currentPos.x > @grid.maxX\n @currentPos.x = @grid.minX\n end\n end", "def nextMove(n,r,c,grid)\n return false if n == 0 && grid.empty?\n\n bot_position = getBotPosition(n, grid)\n princess_position = findPrincessPosition(n, grid)\n\n bot = bot_position.flatten!\n princess = princess_position.flatten!\n\n return false unless bot[0] == r\n if bot[0] < princess[0]\n puts 'DOWN'\n elsif bot[0] > princess[0]\n puts 'UP'\n elsif bot[1] > princess[1]\n puts 'LEFT'\n elsif bot[1] < princess[1]\n puts 'RIGHT'\n end\nend", "def move_one begTile\n @maze.get_adjacent_tiles(begTile).each do |tile|\n if (tile.is_floor) && (!@tiles.include? tile)\n @tiles.push tile\n self.move_one tile\n end\n end\n end", "def grid(path, rows=10, cols=10)\n push\n rows.times do |row|\n tx = (row+1) * (self.height / rows) - (self.height / rows) / 2\n cols.times do |col|\n ty = (col+1) * (self.width / cols) - (self.width / cols) / 2\n push\n translate(tx, ty)\n draw(path)\n pop\n end\n end\n pop\n end", "def initial_piece_placements\n self.grid.each_with_index do |row, row_idx|\n row.each_with_index do |cell, cell_idx|\n pos = [row_idx, cell_idx]\n if pos.all? {|coord| coord.even?} || pos.all? {|coord| coord.odd?}\n if row_idx < 3\n self[pos] = Piece.new(self, pos, :white)\n elsif row_idx >= 5\n self[pos] = Piece.new(self, pos, :black)\n end\n end\n end\n end\n end", "def step_through_iterative_division_maze_generator(grid, state)\n unless state[:finished_init]\n draw_canvas_border(grid)\n state[:finished_init] = true\n end\n new_chamber = divide(grid, state[:current_chamber])\n if new_chamber\n state[:current_chamber] = new_chamber[0]\n state[:todo_chamber].push(new_chamber[1])\n elsif !state[:todo_chamber].empty?\n state[:current_chamber] = state[:todo_chamber].pop\n elsif !state[:generation_complete]\n state[:generation_complete] = true\n end\nend", "def open_up(row,col)\n return if @grid[row][col] == nil\n return if @known_empty.include? (row.to_s + col.to_s)\n numera = [1,2,3,4,5,6,7,8,9]\n if numera.include? @grid[row][col]\n @known_empty << (row.to_s + col.to_s)\n return \n end\n \n @known_empty << (row.to_s + col.to_s)\n # North\n open_up(row-1,col) if row-1 > -1\n # NE\n open_up(row - 1,col + 1) if (row > -1) && (col + 1 < 9) \n # East\n open_up(row,col+1) if (col+1 < 9)\n # SE\n open_up(row+1,col+1) if (row+1 < 9) && (col + 1 < 9) \n # South\n open_up(row + 1,col) if row + 1 < 9 \n # SW\n open_up(row + 1,col - 1) if (row + 1 < 9) && (col - 1 > -1)\n # West\n open_up(row,col - 1) if col - 1 > -1 \n # NW\n open_up(row - 1,col - 1) if (row -1 > -1) && (col - 1 > -1) \n\n return\n\n end", "def place(col, player)\n col = col.to_i\n i = 0 \n while i < @height \n if !invalid_move?(col) && @grid[i][col].nil? && i == @height - 1\n @grid[i][col] = player \n if win?(i, col, player)\n puts \"#{player} wins! Game over!\"\n @game = false \n end\n elsif !invalid_move?(col) && @grid[i][col].nil? && @grid[i + 1][col]\n @grid[i][col] = player\n if win?(i, col, player)\n puts \"#{player} wins! Game over!\"\n @game = false \n end\n end \n i += 1 \n end \n pp @grid\n end", "def input_move(column, player)\n placed = false\n return false unless (1..width).include?(column)\n\n grid.reverse_each do |row|\n if row[column - 1] == empty_cell && placed == false\n row[column - 1] = player\n placed = true\n end\n end\n placed\n end", "def go_to(rows,cols,face=nil)\n \tface = 'north' if (rows == 0 && cols == 0)\n @position.change ({:x => rows, :y => cols, :face => face.to_sym}) if face\n end", "def next_move(_n, bot_pos_x, bot_pos_y, princess_position, _grid)\n case\n when princess_position[0] - bot_pos_x < 0 then move = 'UP'\n when princess_position[0] - bot_pos_x > 0 then move = 'DOWN'\n when princess_position[1] - bot_pos_y < 0 then move = 'LEFT'\n when princess_position[1] - bot_pos_y > 0 then move = 'RIGHT'\n end\n move\n end", "def populate_grid\n start_rows = { red: (0..2), black: (5..7) }\n\n 8.times do |x|\n 8.times do |y|\n [:red, :black].each do |color|\n if (x + y).even? && start_rows[color].include?(y)\n self[[x, y]] = Piece.new(color, [x, y], self)\n end\n end\n end\n end\n\n grid.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n puts \"x=#{x}, y=#{y}, cell.class=#{cell.class}\"\n end\n end\n end", "def move row, col\n @row = row\n @col = col\n end", "def grid\n state.grid\n end", "def grid\n state.grid\n end", "def run_game\n start_game\n new_board\n while true\n print_grid\n tour_joueur1\n tour_joueur2\n end\nend", "def render_grid\n\t\t@grid_w.times.with_index do |x|\n\t\t\t@grid_h.times.with_index do |y|\n\t\t\t\tif !@has_enviroment_rendered\n \t \t\trender_wall x, y if @grid[x][y]==1\n\t\t\t\tend\n\t\t \trender_player x, y if @grid[x][y]==2\n \tend\n end\n #each_cell do |x, y, v|\n # render_wall x, y if !@has_environment_rendered && v == 1 \n # render_player x, y if v == 2\n #end\n\t\t@has_enviroment_rendered = true\n\tend", "def move(board)\n end", "def moves\n end", "def carve_passage_from(x,y)\n\t\tdirections = [@@N,@@S,@@E,@@W].sort_by{rand}\n\t\tdirections.each do |direction|\n\t\t\t#\n\t\t\t# Render updates of the maze on a \"cell-by-cell\" basis\n\t\t\t#\n\t\t\tif @animate\n\t\t\t display(x,y)\n\t\t\t sleep @delay\n\t\t\tend\n\n\t\t\tdx,dy = x + @@DX[direction], y + @@DY[direction]\n\t\t\tif dy.between?(0,@grid.length-1) && dx.between?(0,@grid[dy].length-1) && @grid[dy][dx] == 0\n\t\t\t\t@grid[y][x] |= direction\t\t\t# \"open\" the wall from current cell;\n\t\t\t\t@grid[dy][dx] |= @@OPPOSITE[direction]\t\t# \"open\" the wall from adjacent cell;\n\t\t\t\tcarve_passage_from(dx,dy)\n\t\t\tend\n\t\tend\n\n\t\t# \n\t\t# Make one final call to \"update\" to display last cell.\n\t\t# Set the coords to (-1,-1) so the cell is left \"blank\" with no cursor.\n\t\t#\n\t\tif @animate\n\t\t display(-1,-1)\n\t\tend\n\tend", "def cursor_up\n $game_system.se_play($data_system.cursor_se)\n $game_troop.enemies.size.times do\n @index += $game_troop.enemies.size - 1\n @index %= $game_troop.enemies.size\n break if self.enemy.exist?\n end\n end", "def move_up_left\n i = 1\n until false\n x, y = @pos\n x -= i\n y -= i\n pos = [x, y]\n break if x > 7 || x < 0 || y > 7 || y < 0 || @board[pos].color == @color\n @moves << pos\n break if @board[pos].color != @color\n i += 1\n end\n end", "def tick\n # Make the movement\n self.position = position.moved_in(direction)\n\n # Change direction\n lookup_result = Cart.direction_lookup[[direction, grid[position]]]\n self.direction = lookup_result unless lookup_result.nil?\n\n # Handle intersections\n if grid[position] == '+'\n case next_intersection_action\n when :turn_left\n self.next_intersection_action = :straight\n self.direction = {\n up: :left, left: :down, down: :right, right: :up\n }[self.direction]\n\n when :straight\n self.next_intersection_action = :turn_right\n\n when :turn_right\n self.next_intersection_action = :turn_left\n self.direction = {\n up: :right, right: :down, down: :left, left: :up\n }[self.direction]\n end\n end\n end", "def move\n @leading_x = coordinate_array[0]\n @leading_y = coordinate_array[1]\n end", "def new_piece\n next_tetromino\n\n col = @columns / 2 - 1\n row = 0\n\n @falling_piece.x = col * @block_size + self.screen_x\n @falling_piece.y = row * @block_size + self.screen_y\n\n @falling_piece.grid_position.x = col + 1\n @falling_piece.grid_position.y = row\n\n if collides?\n game_over\n end\n end", "def pile(w)\n w.drag_to(@current)\n w.set_default_refresh_loc('tl')\n @current.x += PILE_OFFSET\n end", "def slide_moves\n dirs = (@dir == :up ? UP_DIRS : DOWN_DIRS)\n dirs = DOWN_DIRS + UP_DIRS if king\n\n dirs.each_with_object([]) do |dir, moves|\n new_square = add_dir(pos, dir)\n unless !@board.on_board?(new_square) || @board[*new_square]\n moves << [pos, new_square]\n end\n end\n end", "def step(new_direction = @cells.first.direction, eat)\n @cells.each do |cell|\n old_direction = cell.direction\n cell.direction = new_direction\n new_direction = old_direction\n end\n @cells.each(&:step)\n check_border\n if equal_place(@cells.first, eat)\n add_cell\n remove_eat(eat)\n true\n else\n false\n end\n end", "def move_piece fr, fc, tr, tc\r\n puts \"Moving X from #{fr}, #{fc} to #{tr}, #{tc}\"\r\n current = @board[fr][fc]\r\n @board[fr][fc]= 0\r\n @board[tr][tc]=current\r\n\r\n end", "def move\n \n end", "def move\n \n end", "def sink(y, x, grid)\n return if grid[y][x] == 0\n grid[y][x] = 0\n sink(y - 1, x, grid) if y > 0\n sink(y, x - 1, grid) if x > 0\n sink(y + 1, x, grid) if y < grid.length - 1\n sink(y, x + 1, grid) if x < grid[y].length - 1\nend", "def update_position!(next_move)\n table.x = next_move[:x]\n table.y = next_move[:y]\n end", "def walk\n if @headed_left\n move_left\n else\n move_right\n end\n end", "def update_grid commands, offset=0\n commands.each_with_index do |command, index|\n i = (index + offset) % 2\n filler = i == 0 ? 'XX' : 'OO'\n grid[command.row][command.column] = filler\n end\n end", "def moves\n\n end", "def move\n start_show_thinking\n @board.move(best_moves.first)\n stop_show_thinking\n board.last_move\n end", "def forward_steps(new_row) # ahhh all the logic to see if this should be added or not should be in here awesome, yeah helper methods *are* supposed to be like this right to better help modularize things nice\n f_steps = Array.new\n one_step = [new_row, @pos[1]] \n two_step_row = new_row + forward_dir # if it can jump you've gotta increment this by another step lol can't believe you forgot this about pawns wow\n if (two_step_row >= 0) && (two_step_row <= 7) # ah lmfao didn't fucking check if it's a NullPiece there or not LOL amazing bug catching god debugger is god mode\n (f_steps << [two_step_row, @pos[1]]) if (at_start_row? && @board.grid[two_step_row][@pos[1]].is_a?(NullPiece) && @board.grid[new_row][@pos[1]].is_a?(NullPiece)) # if the pawn is at the start step then add this new step if it's valid otherwise don't note can't do self.at_start_row? because this is invalid. # also added another check here wow so many things to watch out for you can't double step past a square that's occupied by another piece so have to check that the one step piece is also a NullPiece amazing catch man so much to catch lol\n end\n f_steps << one_step if @board.grid[new_row][@pos[1]].is_a?(NullPiece) # only allow this move if the new row is in bounds and there is no piece in that position\n f_steps\n end", "def moveForward\n case @currentDir\n when :north\n incrementY\n when :south\n decrementY\n when :east\n incrementX\n when :west\n decrementX\n end\n\n #if new current position has obstacle, move back and report it\n if @grid.obstacles.include?(@currentPos)\n puts \"Cannot move forward. Obstacle present ahead at (#{@currentPos.x}, #{@currentPos.y})\"\n moveBackward\n return false\n end\n\n true\n end", "def move_west\n @x -= 1\n end", "def update_player_route\n @passed_positions ||= []\n @starting_position = [@selected_unit.x, @selected_unit.y]\n ### The cursor was located outside of the highlighted tiles\n if @outside_of_range\n @outside_of_range = false\n # The cursor moves back into the range, and over a spot where arrow was drawn\n result = false\n @passed_positions.each_index{|index|\n path = @passed_positions[index]\n if [path.x,path.y] == [cursor.x,cursor.y]\n result = index\n break\n end\n }\n # It found the spot where the arrow was drawn\n if result\n @passed_positions = @passed_positions[0, result+1]\n # If moved back into range and over the unit's location\n elsif [cursor.x,cursor.y] == [@selected_unit.x, @selected_unit.y]\n @passed_positions = []\n # If the cursor moves back into range but not where an arrow was drawn\n elsif @positions[cursor.x][cursor.y].is_a?(MoveTile)\n # See if can extend current path to here\n added_path = extend_path(@selected_unit, @passed_positions, [cursor.x,cursor.y])\n # If possible to extend path, do so\n if added_path != false\n @passed_positions += added_path\n else \n # Generate new path\n @passed_positions = find_path(@positions, \n @positions[@selected_unit.x][@selected_unit.y],\n @positions[cursor.x][cursor.y])\n end\n # Did not move back in range; still outside \n else\n @outside_of_range = true\n end\n \n \n else\n ### If position player moves over was already passed over\n result = false\n @passed_positions.each_index{|index|\n path = @passed_positions[index]\n if [path.x,path.y] == [cursor.x,cursor.y]\n result = index\n break\n end\n }\n if result\n @passed_positions = @passed_positions[0, result+1]\n ### If position is outside of available positions...\n elsif !@positions[cursor.x][cursor.y].is_a?(MoveTile)\n # Activate switch to tell game player is out of move range\n @outside_of_range = true\n ### If the cursor is anywhere in the range EXCEPT on the selected unit\n elsif [cursor.x,cursor.y] != [@selected_unit.x, @selected_unit.y]\n # See if can extend current path to here\n added_path = extend_path(@selected_unit, @passed_positions, [cursor.x,cursor.y])\n # If possible to extend path, do so\n if added_path != false\n @passed_positions += added_path\n else \n # Generate new path\n @passed_positions = find_path(@positions, \n @positions[@selected_unit.x][@selected_unit.y],\n @positions[cursor.x][cursor.y])\n end\n ### Else player is back to the unit's position\n else\n # Reset all stored values (starting fresh)\n @passed_positions = []\n end\n end\n draw_route unless @outside_of_range\n end", "def move\n case @facing\n when \"north\"\n @posY += 1 if @posY+1 < @table.width\n when \"east\"\n @posX += 1 if @posX+1 < @table.height\n when \"south\"\n @posY -= 1 if @posY-1 >= 0\n when \"west\"\n @posX -= 1 if @posX-1 >= 0\n end\n end", "def move_player_down(grid, player)\n return if player.grid_y == grid.length - 1\n return if player.bottom_wall\n\n return grid[player.grid_y + 1][player.grid_x]\nend", "def move\n @position.shift unless @growing\n case @direction\n when 'down'\n @position.push(new_coords(head[0], head[1] + 1))\n when 'up'\n @position.push(new_coords(head[0], head[1] - 1))\n when 'left'\n @position.push(new_coords(head[0] - 1, head[1]))\n when 'right'\n @position.push(new_coords(head[0] + 1, head[1]))\n end\n @growing = @turned = false\n end", "def move_piece_back\n @chess_board.board[@row][@col] = @chess_board.board[@row_new][@col_new]\n end", "def move_to(x, y); end", "def move\n if inside_table?(next_move_x_y(next_move))\n update_position!(next_move_x_y(next_move))\n else\n almost_die\n end\n end", "def process_movement\n # Delete the graphics associated to moving\n @ranges.each{|tile| tile.visible = false}\n @ranges = []\n @arrow_path.each{|a| a.dispose}\n @arrow_path = []\n # Move the cursor back to the selected unit\n proc = Proc.new{@selected_unit.selected = false\n @show_move = false\n @selected_unit.sprite.move(@passed_positions)\n @selected_unit.stop_capture if @passed_positions.size != 0}\n cursor.add_move_action(@selected_unit.x, @selected_unit.y, proc)\n # go to phase 3\n @phase = 3\n end", "def translate_index_to_grid_position(index)\n @grid_positions[index]\nend", "def scroll_backward\n #@oldindex = @current_index\n @current_index -= @scrollatrows\n @prow = @current_index - @scrollatrows\n end" ]
[ "0.7168583", "0.7013342", "0.7005228", "0.7004463", "0.69918585", "0.68964064", "0.6727364", "0.6652382", "0.6651018", "0.66299087", "0.6525214", "0.6508586", "0.64858186", "0.6467565", "0.6467565", "0.6467565", "0.64178395", "0.6410734", "0.6398985", "0.6367399", "0.63577425", "0.6341713", "0.632727", "0.62627846", "0.6262699", "0.62486035", "0.6243824", "0.6224304", "0.62213904", "0.6220595", "0.62176645", "0.6215688", "0.6201688", "0.61992055", "0.6189337", "0.61836433", "0.6175686", "0.616675", "0.61659575", "0.6146692", "0.61417496", "0.6140381", "0.61384076", "0.6120462", "0.61117935", "0.6111419", "0.6109467", "0.6106248", "0.6104806", "0.6099106", "0.60833186", "0.60797596", "0.6073664", "0.60679317", "0.6066666", "0.6058333", "0.6055001", "0.605055", "0.60490125", "0.6047797", "0.604012", "0.60366744", "0.6035815", "0.60294306", "0.60294306", "0.6020324", "0.6019417", "0.59977436", "0.59924227", "0.5991862", "0.59777623", "0.59731895", "0.5967235", "0.5965168", "0.5962741", "0.5956941", "0.595562", "0.5951837", "0.5950641", "0.59488696", "0.59488696", "0.5942292", "0.5942066", "0.59419996", "0.5937406", "0.5933634", "0.59274447", "0.59257", "0.59228396", "0.5920573", "0.5918583", "0.5916134", "0.59137034", "0.59125763", "0.59094983", "0.59065825", "0.58983296", "0.5891031", "0.58869326", "0.5885577" ]
0.60271174
65
testing position these may not be necessary since, whenever a cell wants to know if it's not at an edge, it's because it wants to do something with that position, and the movement methods already test for edgeness
def notTopEdge? @y.positive? ? self : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_is_valid?(position)\r\n position.x < @col &&\r\n position.y < @row &&\r\n position.x >= 0 &&\r\n position.y >= 0\r\n end", "def pos_nt?(x, y)\r\n pos?(x, y) && !@through\r\n end", "def valid_move?\n\t\t@table.stays_on_table?(@robot_direction, @x, @y)\n\tend", "def invalid_cell?(pos)\n pos[0] < 0 || pos[1] < 0 || pos[0] > MAXX || pos[1] > MAXY\n end", "def is_invalid_move?(x, y, direction, new_rows)\n return true if x == 0 and direction == \"left\"\n return true if y == 0 and direction == \"up\"\n return true if x == @x - 1 and direction == \"right\"\n return true if y == @y - 1 and direction == \"down\"\n return true if direction == \"up\" and y - 1 > 0 and new_rows[y-1][x] == Block.new(0)\n return true if direction == \"down\" and y < @y - 1 and new_rows[y+1][x] == Block.new(0)\n return true if direction == \"left\" and x - 1 > 0 and new_rows[y][x-1] == Block.new(0)\n return true if direction == \"right\" and x < @x - 1 and new_rows[y][x+1] == Block.new(0)\n end", "def position?(row, col)\n @move.key?([row, col])\n end", "def moving?\n if tdd_use_fme?\n Input.dir8 > 0\n else\n @real_x != @x || @real_y != @y\n end\n end", "def valid_move?(robot)\n x_pos = robot.x_position\n y_pos = robot.y_position\n dir = robot.direction\n invalid_east_move = (x_pos == @dimension) && (dir == 'EAST')\n invalid_west_move = x_pos.zero? && (dir == 'WEST')\n invalid_north_move = (y_pos == @dimension) && (dir == 'NORTH')\n invalid_south_move = y_pos.zero? && (dir == 'SOUTH')\n !(invalid_east_move || invalid_west_move || invalid_north_move || invalid_south_move)\n end", "def move_valid?(x, y)\n (0...@columns).cover?(x) && (0...@rows).cover?(y) && !@visited[x][y]\n end", "def valid_move?(row, position)\n # need to shortcirtuit for position\n cells[row] && cells[row][position] == \" \"\n end", "def movable_direction?\n\t\tif(@location.x == 0 && @direction == :WEST)\n\t\t\tthen false\n\t\telsif(@location.x == @grid-1 && @direction == :EAST)\n\t\t\tthen false\n\t\telsif(@location.y == 0 && @direction == :SOUTH)\n\t\t\tthen false\n\t\telsif(@location.y == @grid-1 && @direction == :NORTH)\n\t\t\tthen false\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend", "def valid_move?(current_obj, next_obj, current_cell, test_cell)\n cc_row = current_cell[0]\n cc_col = current_cell[1]\n tc_row = test_cell[0]\n tc_col = test_cell[1]\n\n next_obj == current_obj &&\n cc_row == tc_row - 1 && cc_col == tc_col - 1 || \\\n cc_row == tc_row - 1 && cc_col == tc_col || \\\n cc_row == tc_row - 1 && cc_col == tc_col + 1 || \\\n cc_row == tc_row && cc_col == tc_col + 1 || \\\n cc_row == tc_row + 1 && cc_col == tc_col + 1 || \\\n cc_row == tc_row + 1 && cc_col == tc_col || \\\n cc_row == tc_row + 1 && cc_col == tc_col - 1 || \\\n cc_row == tc_row && cc_col == tc_col - 1 \n end", "def valid_move?(position)\n position && @maze[position] != \"*\" && @times_visited[position] < 2 && position[0] < @maze.maze.length && position[1] < find_max_row_length \n end", "def valid_position?(row, col)\n row.between?(0, 7) && col.between?(0, 7) ? true : false\n end", "def obstructed?(current_pos,other_pos,board)\n # debugger\n tester = other_pos\n # puts tester\n # sleep 2\n\n #\n # (-1..1).each do |i|\n # (-1..1).each do |j|\n\n\n if other_pos[0] > current_pos[0] #New position is below us\n if other_pos[1] > current_pos[1] #new position is on our right--bishop move\n tester[0] -= 1\n tester[1] -= 1\n until tester == current_pos\n # puts board.grid[tester[0]][tester[1]]\n # puts !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n # sleep 2\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n # return false if the piece at tester is not a nul piece\n tester[0] -= 1\n tester[1] -= 1\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[0] -= 1\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n elsif other_pos[1] == current_pos[1] #new position is on our level horizontally\n until tester == current_pos\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n end\n\n elsif other_pos[0] < current_pos[0] #New position is above us\n if other_pos[1] > current_pos[1] #new position is on our right\n until tester == current_pos\n tester[0] += 1\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[0] += 1\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n else #new position is on our level horizontally\n until tester == current_pos\n tester[0] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n end\n\n else #new position is at our level vertically\n if other_pos[1] > current_pos[1] #new position is on our right\n until tester == current_pos\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n end\n end\n\n return false if board.grid[other_pos[0]][other_pos[1]].color == self.color\n # puts \"hello\"\n # sleep(2)\n true\n\n end", "def valid_move?(new_x, new_y)\n true\n end", "def empty_cell?(position)\n case @signs[position[0].to_i-1][position[1].to_i-1]\n when \"x \" \n return false\n when \"o \" \n return false\n else return true\n end\n end", "def valid_position?(x, y)\n !!(x && y && x > 0 && y > 0 && x <= 8 && y <= 8)\n end", "def move_possible?(ordinates)\n if @x + ordinates[0] > @plateau.x || @x + ordinates[0] < 0 || @y + ordinates[1] > @plateau.y || @y + ordinates[1] < 0\n raise Exception, 'On the edge of plateau. Not possible to move forward.'\n end\n end", "def down?(new_x_position, new_y_position)\n (self.y_position - new_y_position.to_i) < 0 && (new_x_position == self.x_position)\n end", "def valid_pos?(pos) # [0, -1]\n row, col = pos \n return false if row < 0 || row > 7\n return false if col < 0 || col > 7\n true \n end", "def safe_position?(x, y)\n x >= 0 &&\n x <= 4 &&\n y >= 0 &&\n y <= 4\n end", "def move_valid?(x, y)\n (0...@width).cover?(x) && (0...@height).cover?(y) && !@visited[x][y]\n end", "def standard_move?(x,y)\n return (x_diff(x) == 0) && (y_diff(y) == 1)\n end", "def move\n placed?\n if @direction == \"NORTH\"\n raise \"Out of bounds\" unless @tabletop.table_boundary?(@x, (@y+1))\n @y+=1\n elsif @direction == \"SOUTH\"\n raise \"Out of bounds\" unless @tabletop.table_boundary?(@x, (@y-1))\n @y-=1\n elsif @direction == \"WEST\"\n raise \"Out of bounds\" unless @tabletop.table_boundary?((@x-1), @y)\n @x-=1\n elsif @direction == \"EAST\"\n raise \"Out of bounds\" unless @tabletop.table_boundary?((@x+1), @y)\n @x+=1\n end\n end", "def can_occupy_cell?(pos=false)\n # p pos\n # # byebug\n return false if pos[0] < 0 || pos[0] >= @grid.length\n return false if pos[1] < 0 || pos[1] >= @grid[0].length\n empty?(pos)\n # return false if (pos[0] >= @grid.length || pos[1] >= @grid.length)\n # return true if pos && @grid[pos[0]][pos[1]] != nil\n # false\n end", "def valid_move?(position)\n position.between?(0,8) && !position_taken?(position)\n end", "def up?(new_x_position, new_y_position)\n (self.y_position - new_y_position.to_i) > 0 && (new_x_position == self.x_position)\n end", "def standard_move?(x_des, y_des)\n y_chg = (y_des.to_i - y_position).abs\n x_chg = (x_des.to_i - x_position).abs\n x_chg == 0 && ( y_chg == 1 ||\n ( first_move_pawn? && move_forward_two?(x_des, y_des) ) )\n end", "def valid?(position)\n row, col = position\n position.all? {|i| i >= 0 && i< @grid.length}\n \n end", "def valid_edge(x, y)\n if x < m and x > 0 and y < n and y > 0 and maze_mat[x][y] == 0\n return true\n end\n false\n end", "def isValidMove(row, col)\n \treturn isValidMoveForDisc(row, col, @disc)\n end", "def isValidMove(row, col)\n \treturn isValidMoveForDisc(row, col, @disc)\n end", "def check_move(direction)\n\n if direction == 0 #up\n if @y < 1\n \n return false\n end\n elsif direction == 1 #down\n if @y > @boundry\n \n return false\n end\n elsif direction == 2 #left\n if @x < 1\n \n return false\n end\n else #right\n\n if @x > @boundry\n \n return false\n end\n\n end\n\n return true\n end", "def move_valid?(pos)\n return false unless board.in_bounds?(pos)\n return false if board.occupied?(pos) && board.grid[pos[0]][pos[1]].color == self.color\n true\n end", "def position_taken?\nend", "def valid_move?(cur_pos, next_pos)\n return false if @all_positions[next_pos] # no need to add already seen pos \n cur_col, cur_row = cur_pos\n next_col, next_row = next_pos\n bool_1 = (next_col - cur_col).abs == 2 && (next_row - cur_row).abs == 1\n bool_2 = (next_row - cur_row).abs == 2 && (next_col - cur_col).abs == 1\n bool_1 || bool_2\n end", "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end", "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end", "def valid_move?(board, position)\n position_taken?(board, position) == false && position.between?(0, 8) ? true : false\nend", "def can_i_move?(x, y)\n x, y = x.to_i, y.to_i\n ( x >= 0 && x <= dimension.width ) && ( y >= 0 && y <= dimension.height )\n end", "def inside_table?(next_move)\n next_move[:x].between?(0, table.width - 1) && next_move[:y].between?(0, table.height - 1)\n end", "def valid_move?(board, position)\n position.between?(0, 8) && !position_taken?(board, position)\nend", "def obstructed_move?(row, col)\n current_row = self.row_position\n current_col = self.col_position\n\n # check if piece is blocking the path in positive vertical direction\n if current_col == col && row > current_row\n for i in (current_row+1...row)\n self.game.occupied?(i, col)\n end\n end\n\n # check if piece is blocking the path in negative vertical direction\n if current_col == col && row < current_row\n for i in (row+1...current_row)\n self.game.occupied?(i, col)\n end\n end\n\n # check if piece is blocking the path in positive horizontal direction\n if current_row == row && col > current_col\n for i in (current_col+1...col)\n self.game.occupied?(row, i)\n end\n end\n\n # check if piece is blocking the path in negative horizontal direction\n if current_row == row && col < current_col\n for i in (col+1...current_col)\n self.game.occupied?(row, i)\n end\n end\n\n return false\n end", "def valid_move?(board, index)\n if position_taken?(board, index)\n false\n elsif index > 8 || index < 0\n false\n else\n true\n end\nend", "def valid_move?(board, index)\n index.between?(0, 8) && position_taken?(board, index) == false\n\nend", "def check_valid_position(xcoord, ycoord)\n\tif xcoord >= GRID_SIZE || xcoord < 0\n\t\treturn false\n\telsif ycoord >= GRID_SIZE || ycoord < 0\n\t\treturn false\n\telse\n\t\treturn true\n\tend\nend", "def on_table?(x,y)\n (0 <= x && x < GRID_X) && (0 <= y && y < GRID_Y)\n end", "def valid_move?(position) ### changed from index to position - ER 2017\n\n if (position > 9) || (position < 0) #if index (position on board entered by user) is greater than 9 or less than 0, return false\n false\n elsif position_taken?(position) ###otherwise, if position on board is taken, return false\n false\n else position.between?(0, 8) ###finally, if the position isn't taken, and the index (position on board entered by user) is between 0 and 8, return true\n true\n end # end if...elsif statements\n end", "def valid_move?(board,index)\n if index < 0\n false\n else\n if index > 8\n false\n else\n !position_taken?(board,index)\n end\n end\nend", "def pos?(x, y)\n (width.include?(x) && height.include?(y)) ||\n occupied_spaces.include?([x, y])\n end", "def pos_rect_nt?(x, y, rect)\r\r\n pos_rect?(x, y, rect) && !@through\r\r\n end", "def valid_move?(board, index)\n # Is the position taken?\n pos_taken = position_taken?(board, index)\n # Is the position on the board?\n on_board = index.between?(0, board.length - 1)\n # If position is open and on the board, return true,\n if !pos_taken && on_board\n return true\n else\n return false\n end\nend", "def update_position(direction)\n ox, oy = @x, @y\n nx, ny = @x, @y\n case direction\n when :left\n nx -= 1\n when :right\n nx += 1\n when :up\n return unless @current_cell.ladder? && !@current_cell.sky?\n ny -= 1\n when :down\n ny += 1\n end\n \n # If the would-be destination isn't valid, just return without doing anything\n return if @map.cells_at[nx][ny].rock\n return unless ((0..MAP_SIZE - 1).include?(nx) && (0..MAP_SIZE - 1).include?(ny))\n \n # If we've made it this far, the move is valid. Update player's cell coords now.\n @x, @y = nx, ny\n set_center\n set_current_cell\n \n # Fire some events at the map, so it knows how to redraw things the next time around\n @map.handle(CellDugEvent.new([nx, ny])) unless @map.cells_at[nx][ny].dug? or @map.cells_at[nx][ny].sky?\n @map.handle(PlayerMovedEvent.new([ox, oy]))\n\n # Decide whether this move put the player in gravitational jeopardy\n @falling = true if @map.cells_at[nx][ny + 1].dug? && !@map.cells_at[nx][ny + 1].ladder?\n end", "def valid_move?(board, position)\n !position_taken?(board, position) && position.between?(0,8)\nend", "def valid_move?(board, position)\n indexed_position = position.to_i - 1\n indexed_position.between?(0,8) && !position_taken?(board, indexed_position)\nend", "def test_can_not_move_east\n table_top = TableTop.new(5, 5)\n @robot.place(table_top, :EAST, 5, 2)\n\n assert_equal(:EAST, @robot.direction)\n assert_equal(\"P\", @robot.get_path_value(5, 2))\n\n @robot.move\n assert_equal(5, @robot.x, \"X position should be 5 (not changed)\")\n assert_equal(2, @robot.y, \"Y position should be 2 (not changed)\")\n assert_equal(:EAST, @robot.direction, \"Direction should be :EAST (not changed)\")\n assert_equal(\"P\", @robot.get_path_value(5, 2))\n end", "def on_board?(pos)\n pos.all? {|coord| coord.between?(0, SIZE - 1)}\n end", "def valid_move?(board, index)\n if position_taken?(board, index) == true\n false\n elsif index > 8 || index < 0\n false\n else\n true\n end\nend", "def valid_move? (board, position)\n position = position.to_i - 1\n (position.between?(0,8)) && (position_taken?(board, position) == false)\nend", "def valid_move?(board, index)\n if index.between?(0, 8) && (position_taken?(board, index) == false)\n true\n elsif (index.between?(0,8) == false) || (position_taken?(board, index) == true)\n false\n end\nend", "def invalid_move?(col)\n col = col.to_i\n i = 0 \n while i < @height && col < @width\n if @grid[i][col] == nil\n return false \n end \n i += 1 \n end \n return true \n end", "def is_valid_move?(proposed_row, proposed_col, solution)\n return true\nend", "def valid_moves\n @pad.cells.select { |c| self.can_move?(*c.pos) }\n end", "def can_move_to(pos)\n\t\treturn false if pos[0] < 0 || pos[1] < 0\n\t\treturn false if pos[0] >= @area.length\t\t\t\n\t\trow = @area[pos[0]]\t\t\n\t\treturn false if pos[1] >= row.length\t\n\t\tSpaceMarks.include? from_area(pos)\n\tend", "def valid_move?(board, i)\n # check if position taken or 'out-of-bounds'\n if (position_taken?(board, i) == true) || (i > 8) || (i < 0)\n return false\n else \n return true\n end \nend", "def check_move?(new_position)\n if new_position[0].between?(0,7) &&\n new_position[1].between?(0,7) &&\n !space_full?(new_position)\n return true\n end\n false\n end", "def valid_move?(board, index)\n if index.between?(0, 8) && position_taken?(board, index) == false\n true\n else\n false\n end\nend", "def valid_move? (board, index)\n if index.between?(0, 8) && !position_taken?(board, index)\n true \n end \nend", "def valid_move?(board, index)\nif position_taken?(board, index) == false\n if between?(index) == true\n true\n else\n false\n end\nelse\n false\nend\nend", "def no_x_move?(x_des)\n (x_des.to_i - x_position) == 0\n end", "def invalid_move?(pos, board)\n if pos.nil?\n false\n elsif pos.any? {|x| x < 0 || x > 7}\n true \n elsif !board[pos].is_a?(NullPiece)\n true \n else\n false \n end\n end", "def valid_move?(board,index)\n if position_taken?(board,index)\n false\n elsif index.between?(0, 8)\n true\n end\nend", "def valid_move?(board, position)\n position = position.to_i - 1\n position_taken?(board, position) == false && position.between?(0,8) == true\nend", "def valid_move?(position)\n index=position.to_i - 1\n index.between?(0, 8) && !(position_taken?(index))\n end", "def valid_placement?\n\t\t@table.placed_on_table?(@x, @y) && @robot.vectors.include?(@robot_direction)\n\tend", "def position_taken?(board, position)\n \n if board[position.to_i-1] == \" \"\n then false\n elsif board[position.to_i-1] == \"\" \n then false\n elsif board[position.to_i-1] == nil\n then false\n elsif board[position.to_i-1] == \"X\"\n then true\n elsif board[position.to_i-1] == \"O\"\n then true\n end\nend", "def validate_position(row, column)\n\n # Assume the move is invalid\n result = false\n\n # Is this cell within the range of the board?\n if row <= @board.size and column <= @board.size\n\n # Yes, was this cell previously empty?\n if @board[row][column] == EMPTY_POSITION\n\n # Yes, the move is valid\n result = true\n\n else\n\n # No, this cell wasn't empty\n puts \"That position is occupied.\"\n\n end\n\n else\n\n # No, this cell is off the board\n puts \"Invalid position.\"\n\n end\n\n return result\n\n end", "def valid_move?(x, y)\n return false if is_obstructed?(x, y)\n diagonal_move_left?(x, y) || diagonal_move_right?(x,y)\n \n end", "def valid_position?(x, y)\n !negative_positions?(x, y) && positions_inside_table?(x, y)\n end", "def valid_move?(board, position)\n position = position.to_i - 1\n if position.between?(0, 8) && !position_taken?(board, position)\n true\n end\nend", "def move\n return false if @position.nil?\n \n movements = { north: { x: 0, y: 1 }, east: { x: 1, y: 0 }, south: { x: 0, y: -1 }, west: { x: -1, y: 0 } }\n position, movement = @position, movements[@direction]\n\n return false unless valid_position?(position[:x] + movement[:x], position[:y] + movement[:y])\n \n @position = { x: position[:x] + movement[:x], y: position[:y] + movement[:y] }\n true\n end", "def knight_move\n !(horizontal_move or vertical_move) && (((@initial_pos[0] - @final_pos[0]).abs) < 3 && ((@initial_pos[1] - @final_pos[1]).abs) < 3)\n end", "def valid_move? (board, index)\n index.between?(0, 8) && !position_taken?(board, index)\nend", "def move\n case @facing\n when \"north\"\n @posY += 1 if @posY+1 < @table.width\n when \"east\"\n @posX += 1 if @posX+1 < @table.height\n when \"south\"\n @posY -= 1 if @posY-1 >= 0\n when \"west\"\n @posX -= 1 if @posX-1 >= 0\n end\n end", "def valid_move?(board, index)\n if index.between?(0, 8)\n # re-define your #position_taken? method here, so that you can use it in the #valid_move? method above.\n def position_taken?(board, index)\n if board[index] == \" \"\n !false\n elsif board[index] == \"\"\n !false\n elsif board[index] == nil\n !false\n elsif board[index] == \"X\" || board[index] == \"O\"\n !true\n end\n end\n position_taken?(board, index)\nend\nend", "def position_taken?(board, position)\n if (board[position]==\" \") || (board[position]==\"\")\n return false\n elsif (board[position]==\"X\") || (board[position]==\"O\")\n return true\n elsif (board[position]==nil)\n return false\n end\nend", "def validate_position(row,col)\n if row<=@board.size and col <=@board.size\n if @board[row][col]==EMPTY_POS\n return true\n else\n puts \"position is occupied\"\n end\n else\n puts \"invalid position\"\n end\n return false\n end", "def valid_move?(board,position)\n position=position.to_i-1\n if position.between?(0,8) && !position_taken?(board, position)\n true\n else\n false\n end\nend", "def valid_move?(board, index)\n if position_taken?(board, index)\n false\n elsif index.between?(0, 8)\n true\n end\nend", "def valid_move?(board, index)\r\n if index.between?(0, 8) && ! position_taken?(board, index)\r\n return TRUE\r\n else \r\n return FALSE\r\n end\r\nend", "def can_go_down?(the_maze, floor, position)\r\n (floor + 1 < the_maze.size) and (the_maze[floor + 1][position] == \"0\") \r\nend", "def valid_move?(board, indx)\n if position_taken?(board, indx)\n false \n elsif (indx < 0 || indx > 8)\n false\n else \n true \n end \nend", "def valid_move?(index)\n if position_taken?(index)\n false\n elsif index < 0 || index > 8\n false\n else\n true \n end\n end", "def can_go_up?(the_maze, floor, position)\r\n (floor - 1 > -1) and (the_maze[floor - 1][position] == \"0\") \r\nend", "def valid_loc?(h_pos, v_pos)\n h_pos >= 0 && h_pos < @w\n v_pos >= 0 && v_pos < @l\n\n end", "def valid_move?(board,index)\n if position_taken?(board,index) == FALSE && index.between?(0, 8) == TRUE\n TRUE\n else\n FALSE\n end\nend", "def valid_move?(board, position)\n position = (position.to_i - 1)\n\n if position.between?(0, 8) && !position_taken?(board, position)\n true\n else false\n end\nend", "def valid_move?(board, index)\n position_taken?(board, index) == false && index.between?(0, 8) ? true : false\nend", "def valid_move?(board, position)\n position = position.to_i - 1\n if position_taken?(board, position) == false && position.to_i.between?(0, 8)\n return true\nelsif position_taken?(board, position) == true\n return false\nelse \n return false\nend\nend", "def has_left_cell?\n result = @connected_cells.select { |cell| cell.x == @x - 1 && cell.y == @y }\n !result.empty?\n end" ]
[ "0.6903216", "0.6779049", "0.673842", "0.67366546", "0.67255175", "0.66582733", "0.66227096", "0.6614334", "0.6594225", "0.65722984", "0.656498", "0.65641475", "0.6550783", "0.65323925", "0.65230536", "0.65141696", "0.6505918", "0.6502542", "0.65016514", "0.64917654", "0.6449799", "0.6449006", "0.6432683", "0.64149344", "0.640723", "0.63845736", "0.6384281", "0.6380579", "0.6378881", "0.6374657", "0.63594687", "0.63515234", "0.63515234", "0.634996", "0.63409674", "0.6334553", "0.63319933", "0.6331426", "0.6331426", "0.6326235", "0.6325488", "0.63234186", "0.63073915", "0.6296954", "0.62965655", "0.629577", "0.629084", "0.62896484", "0.6289462", "0.6279707", "0.62735313", "0.62693673", "0.62685764", "0.6267552", "0.62644184", "0.62643826", "0.6262139", "0.6262029", "0.6259036", "0.62577254", "0.62567836", "0.62479645", "0.623808", "0.6237456", "0.6235902", "0.62316465", "0.62304854", "0.62297446", "0.62255853", "0.6225264", "0.62246805", "0.6223513", "0.62214035", "0.6220627", "0.6216813", "0.6212016", "0.61993796", "0.61973065", "0.6194526", "0.618965", "0.61890644", "0.61889935", "0.61872584", "0.6183979", "0.6179899", "0.61797446", "0.61743784", "0.61742234", "0.61730504", "0.61726326", "0.6168298", "0.61666083", "0.61665845", "0.6166308", "0.616279", "0.61590207", "0.61576825", "0.6155285", "0.6154281", "0.6149091", "0.6146415" ]
0.0
-1
proxy any unknown method to the referenced Part
def method_missing(name, *args, &block) $theGrid.at(@x, @y).send(name, *args, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_proxy(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def to_proxy(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def method_missing(name, *args, &block)\n\t if(@part.respond_to?(name))\n\t\t@part.send(name, *args, &block)\n\t else\n\t\tsuper\n\t end\n\tend", "def method_missing(method, *args, &block)\n self.class.define_proxy method\n send(method, *args, &block)\n end", "def delegating_method; end", "def proxy\n super\n end", "def proxy meth\n Proxy.new self, meth\n end", "def original_method; end", "def method_missing(method, *args, &block)\n super unless original_self\n original_self.send method, *args, &block\n end", "def method_missing(method, *args, &block)\n # proxy to metadata\n if @metadata.has_key?(method)\n @metadata[method]\n\n else\n super(method, *args, &block)\n end\n end", "def method_missing(method, *args, &block)\n # proxy to metadata\n if @metadata.has_key?(method)\n @metadata[method]\n\n else\n super(method, *args, &block)\n end\n end", "def method_missing(wh,*therest)\n # xxx internal methods must be protected at some point\n end", "def method_missing(method, *args, &block) #:doc:\n super unless @wsdl.respond_to? method\n\n setup method, &block\n dispatch method\n end", "def method_missing(method_name, *args, &block)\n wrapped.send(method_name, *args, &block)\n end", "def method_missing(*rest) end", "def special\n override\n end", "def proxy; self end", "def proxy; end", "def proxy; end", "def proxy; end", "def method_missing(sym, *args, &block)\n proxy_target.__send__(sym, *args, &block)\n end", "def make_independent\n self.method = method.dup\n end", "def method_missing(method, *args, &block)\n __proxy_result__.send(method, *args, &block)\n end", "def method_missing(sym, *args, &block)\n proxy_target.__send__(sym, *args, &block)\n end", "def method_missing(name, *args, &block)\n return super unless base.respond_to? name# and forward? name\n base.send(name, *args, &block)\n end", "def method_missing (method, *args, &block)\n __proxy_result__.send(method, *args, &block)\n end", "def method_missing(meth, *args, &block)\n if !(meth.to_s =~ /=/) and (suffixed_method = \"#{meth.to_s}__c\") and respond_to?(suffixed_method)\n send(suffixed_method)\n else\n super\n end\n end", "def bound_method(block); end", "def apply(klass, method)\n if klass.is_a?(String)\n return unless Object.const_defined?(klass)\n\n klass = Object.const_get(klass)\n end\n\n proxy = self\n original_method = \"_tainted_love_original_#{method}\"\n\n klass.class_eval do\n alias_method original_method, method\n\n define_method method do |*args, &given_block|\n proxy.handle(self, original_method, *args, &given_block)\n end\n end\n end", "def original_method(obj, meth, klass=Object)\n klass.instance_method(meth).bind(obj).call\n end", "def original_method(obj, meth, klass=Object)\n klass.instance_method(meth).bind(obj).call\n end", "def method_missing(name, *args)\n if wrapped_object.respond_to? name\n wrapped_object.send name, *args\n else\n super\n end\n end", "def dispatch\n raise NotImplementedError\n end", "def method_missing(method_name, *arguments, &block)\n littlewire.send(method_name, *arguments, &block)\n end", "def method_missing(m, *args, &block)\n target = self.__getobj__\n unless target.respond_to?(m)\n super(m, *args, &block)\n else\n target.__send__(m, *args, &block)\n end\n end", "def method_missing(method_name, *method_args)\n self.ui.logger.debug { \"TESTLAB METHOD MISSING: #{method_name.inspect}(#{method_args.inspect})\" }\n\n if TestLab::Provider::PROXY_METHODS.include?(method_name)\n node_method_proxy(method_name, *method_args)\n else\n super(method_name, *method_args)\n end\n end", "def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end", "def around_method name, &block\n original_method = instance_method name\n _redefine_method name do |*args|\n instance_exec original_method, *args, &block\n end \n end", "def method_missing(m, *args, &_block)\n set_accessors(m)\n if valid_proxy_method?\n define_proxy_method(m)\n return send(m, args.first)\n end\n\n super\n end", "def method_missing(meth, *args, &block)\n Interrogate.is_interrogatory?(meth) ? Interrogate.interrogate(meth, *args, &block) : super\n end", "def delegate_method; end", "def load_proxy_list(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def load_proxy_list(*)\n raise NotImplementedError, \"#{__method__} must be implemented in a descendant class!\"\n end", "def method_missing(method_name, *args, &block)\n if target.respond_to?(method_name)\n target.public_send(method_name, *args, &block)\n else\n super\n end\n end", "def method_missing(method, *args, &block)\n Rails.logger.debug(\"#{self.class.name}##{__method__}() looking for: #{method.to_s}\")\n if proxy_u.respond_to?(method)\n block_given? ? proxy_u.send(method, *args, block) :\n (args.size == 0 ? proxy_u.send(method) : proxy_u.send(method, *args))\n else\n super\n end\n end", "def internal_methods; end", "def method_missing(method, *args, &blk); end", "def method_missing(method, *args, &block)\n return super unless object.respond_to?(method)\n\n object.public_send(method, *args, &block)\n end", "def method_missing(method, *args, &block)\n if component.respond_to?(method)\n component.__send__ method, *args, &block\n else\n super\n end\n end", "def flexmock_invoke_original(object, method, *args, &block)\n object.instance_variable_get(:@flexmock_proxy).proxy.flexmock_invoke_original(method, args, &block)\n end", "def flexmock_invoke_original(object, method, *args, &block)\n object.instance_variable_get(:@flexmock_proxy).proxy.flexmock_invoke_original(method, args, &block)\n end", "def method_missing(meth, *args, &block)\n\n end", "def method_missing(name,*args,&block)\n if resource_has_extension_method? name\n perform_operation name, *args, &block\n else\n super\n end\n end", "def method_added(*) end", "def invoke\n raise NotImplementedError, \"Author of subclass forgot to implement #invoke\"\n end", "def method_missing(method_name, *args, &block)\n component.send(method_name,*args,&block)\n end", "def methods() end", "def method_missing(mthd, *args, &blk)\n super unless allowed?(mthd)\n library = library_handler[mthd.capitalize.to_sym]\n send(\"_#{mthd}_\", library, *args, &blk)\n end", "def implement(method_name)\n method = @klass.instance_method(method_name)\n end", "def method_missing(*args)\n result = nil\n orig = args.shift\n class_sym = self.class.name.to_sym\n m = orig.to_s[0,5] == '_DAV_' ? orig : \"_DAV_#{orig}\" # If hell is doing the same thing over and over and expecting a different result this is a hell preventer\n raise NoMethodError.new(\"Undefined method: #{orig} for class #{self}.\") unless respond_to?(m)\n @runner.call(class_sym, :before, orig)\n result = send m, *args\n @runner.call(class_sym, :after, orig)\n result\n end", "def public_class_method(*rest) end", "def process_custom_method\n # da implementare per eventuali estensioni\n end", "def my_fare\n\traise NotImplementedError,\n\t \"This class #{self.class.to_s} can not respond to the method::: #{__method__.to_s}\"\n end", "def method_added(name)\n patch_info = Correspondent.patched_methods.delete(name)\n return unless patch_info\n\n class_eval(<<~PATCH, __FILE__, __LINE__ + 1)\n alias_method :original_#{name}, :#{name}\n\n def #{name}(*args, &block)\n result = original_#{name}(*args, &block)\n #{build_async_calls(patch_info, name)}\n result\n end\n PATCH\n\n super\n end", "def method_missing(method, *args, &block)\n @delegate.send(method, *args, &block)\n rescue NoMethodError => e\n raise e, e.message.sub(/ for #<.*$/, \" via proxy for #{@delegate}\")\n end", "def dynamic_forwarding\n super\n end", "def respond_to_missing?(method, incl_private=false)\n proxy_u.send(:respond_to?, method) || super(method,incl_private)\n end", "def decorated_object_behavior\n #code\n end", "def method_missing(method_name, *args) self end", "def method_missing(method_name, *args) self end", "def method_missing(method, *arguments, &block)\n if remote.respond_to?(method)\n remote.send(method, *arguments, &block)\n else\n super\n end\n end", "def method_missing(method, *args, &block)\n generate_unsafe_delegation(method)\n send(method, *args, &block)\n end", "def implement(method_name, &block)\n proxy_interface.implement_class_method(method_name, &block)\n proxy_interface.proxy\n end", "def method_missing(meth, *args, &blk) \n\t\traise NoMethodError if (meth.to_s == 'id')\n\t\t\t\n\t\tself.bien[0].send(meth, *args, &blk)\n\t\t\n\t\trescue NoMethodError\n\t\t\tsuper\n\tend", "def method_missing(method, *args, &block)\n #$stderr.puts \"Method missing: #{method}\"\n if @_receivers.last.respond_to?(method)\n #$stderr.puts \"Proxy [#{method}] to receiver\"\n @_receivers.last.__send__(method, *args, &block)\n else\n #$stderr.puts \"Proxy [#{method}] to context\"\n @_context.__send__(method, *args, &block)\n end\n end", "def method_missing(sym, *args, &block)\n @original_self.send(sym, *args, &block)\n end", "def method_missing(meth, *args, &block); end", "def method_missing(meth, *args, &block); end", "def method_missing(meth, *args, &block); end", "def liquid_method_missing(method); end", "def method_removed(*) end", "def define_entity_methods(name)\n super if defined?(super)\n\n attachment = self\n\n # Returns the attached file.\n if shrine_class::Attacher.instance_method(:get).arity == 0\n define_method :\"#{name}\" do\n send(:\"#{name}_attacher\").get\n end\n else # derivatives\n define_method :\"#{name}\" do |*args|\n send(:\"#{name}_attacher\").get(*args)\n end\n end\n\n # Returns the URL to the attached file.\n define_method :\"#{name}_url\" do |*args, **options|\n send(:\"#{name}_attacher\").url(*args, **options)\n end\n\n # Returns an attacher instance.\n define_method :\"#{name}_attacher\" do |**options|\n attachment.send(:attacher, self, **options)\n end\n end", "def method_missing(method, *args)\r\n self.class.method_missing(method, *args)\r\n end", "def method_added(method_name) #:doc:\n super\n\n if ! Apipie.active_dsl? || ! Apipie.apipie_provided?\n Apipie.clear_last\n return\n end\n\n begin\n # remove method description if exists and create new one\n Apipie.remove_method_description(self, Apipie.last_dsl_data[:api_versions], method_name)\n description = Apipie.define_method_description(self, method_name, Apipie.last_dsl_data[:api_versions])\n ensure\n Apipie.clear_last\n end\n\n # redefine method only if validation is turned on\n if description && Apipie.configuration.validate == true\n\n old_method = instance_method(method_name)\n\n define_method(method_name) do |*args|\n\n if Apipie.configuration.validate == true\n description.params.each do |_, param|\n\n # check if required parameters are present\n if param.required && !params.has_key?(param.name)\n raise ParamMissing.new(param.name)\n end\n\n # params validations\n if params.has_key?(param.name)\n param.validate(params[:\"#{param.name}\"])\n end\n\n end\n end\n\n # run the original method code\n old_method.bind(self).call(*args)\n end\n\n end\n end", "def method_missing(method, *args, &block)\n object.public_send(method, *args, &block)\n end", "def method_missing(method, *args, &block); end", "def method_missing(method_name, *args, &block)\n if @object.respond_to? method_name.to_sym\n @object.__send__(method_name, *args, &block)\n else\n super\n end\n end", "def call\n __proxied_call\n end", "def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end", "def method_missing(sym, *args)\n # Extend this object only when needed and immediately redefine\n # #method_missing so that the new version is used on all future calls.\n extensions.each {|e| extend(e) } if @extensions\n redefine_method_missing!\n __send__(sym, *args)\n end", "def method_missing(method_name, *args, &block)\r\n if @loaded[method_name]\r\n @loaded[method_name]\r\n elsif self.class.associations(version)[method_name] ||\r\n self.class.model.reflect_on_association(method_name)\r\n\r\n class_eval <<CODE, __FILE__, __LINE__ + 1\r\ndef #{method_name}\r\n @loaded[#{method_name.inspect}] ||\r\n Restful::Resource::AssociationProxy.new(self, :#{method_name})\r\nend\r\nCODE\r\n\r\n send method_name\r\n elsif args.size <= 1 && attributes(*args).has_key?(method_name)\r\n self[method_name, *args]\r\n else\r\n super\r\n end\r\n # rescue => e\r\n # raise [method_name, args, block].inspect\r\n end", "def method_missing(method_name, *args, &block)\n base.respond_to?(method_name) ? base.send(method_name, *args, &block) : super\n end", "def method_missing(method, *arguments, &block); end", "def method_missing(method_id, *args)\n return super unless @resource.respond_to? method_id\n @resource.public_send method_id, *args\n end", "def method_missing(meth, *args, &block)\n if respond_to?(meth)\n object.__send__(meth, *args, &block)\n else\n super\n end\n end", "def method_missing(_method, *_args, &_block)\n ext = @ext[_method]\n return super if ext.nil?\n instance_exec(*_args, &exc)\n end", "def method_missing(code, *args, &blk); end", "def method_missing(code, *args, &blk); end", "def method_undefined(*) end", "def http_method\n raise \"Implement in child class\"\n end", "def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end" ]
[ "0.6837945", "0.6837945", "0.68185043", "0.6499762", "0.6461625", "0.6368551", "0.6285678", "0.62588704", "0.623574", "0.62302125", "0.62302125", "0.612466", "0.61205405", "0.60762626", "0.6076032", "0.6041817", "0.6026485", "0.6018271", "0.6018271", "0.6018271", "0.60111535", "0.6006748", "0.59943366", "0.5987952", "0.59817713", "0.59781146", "0.59743637", "0.5943793", "0.5921879", "0.5905682", "0.5905682", "0.5903394", "0.5897502", "0.58831376", "0.5873606", "0.5869533", "0.5859544", "0.58594114", "0.5851837", "0.5844055", "0.5841681", "0.58351505", "0.58351505", "0.58304256", "0.58118093", "0.5802028", "0.57742923", "0.57697636", "0.5767055", "0.57521766", "0.57521766", "0.5751969", "0.5750097", "0.57497185", "0.57484335", "0.57482314", "0.57473814", "0.5744592", "0.57329726", "0.57245857", "0.5715952", "0.57089764", "0.57080364", "0.5707547", "0.5700915", "0.5696798", "0.5693907", "0.56935734", "0.56927633", "0.56927633", "0.568599", "0.5667728", "0.56552184", "0.5652055", "0.56397843", "0.56329983", "0.56318957", "0.56318957", "0.56318957", "0.5625522", "0.56250167", "0.5624435", "0.56230974", "0.56200546", "0.56191367", "0.5616629", "0.56138676", "0.56118876", "0.5611398", "0.561089", "0.5607325", "0.5606517", "0.5603341", "0.56026447", "0.56009316", "0.5592026", "0.55892116", "0.55892116", "0.55858886", "0.55803204", "0.55782425" ]
0.0
-1
GET /config_tables/1 GET /config_tables/1.json
def show @config_table = ConfigTable.find(params[:id]) respond_to do |format| format.js format.html # show.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @configtable }\n end\n end", "def get_table_list()\n resp = @dynamo_db.list_tables()\n puts \"Table list : \" + resp.table_names.to_s\nend", "def list(table)\n self.get(\"/#{table}\")\n end", "def index\n @config_templates = ConfigTemplate.all\n\n if params[:table_only] then\n render :partial => \"table\"\n else\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @config_templates }\n format.xml { render :xml => @config_templates }\n end\n end\n end", "def new\n @configtable = Configtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configtable }\n end\n end", "def get_tables\n tables\n end", "def get_tables\n get_schemas.keys\n end", "def get_all_tables\n\t\ttc = new_sub(@discovery['tables']['url'], @discovery['tables']['capability'])\n\t\ttc.listen.map {|x| JSON.parse(x) rescue nil}.compact\n\tend", "def index\n @ip_tables = IpTable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ip_tables }\n end\n end", "def get_schema\n schema = CLIENT_TABLES.map {|t| {:name => t.table_name, :columns => table_schema(t)} }\n \n# respond_to do |format|\n# format.js { render({:content_type => :js, :text => schema.to_json}) }\n# end\n \n render_json schema.to_json\n end", "def get_table(table, env=nil)\n require 'net/http'\n http_config = get_remote_credentials(env)\n ret = false\n Net::HTTP.start(http_config['server_name'], http_config['server_port']) {|http|\n req = Net::HTTP::Get.new(\"/dumps/#{table}.txt\")\n req.basic_auth http_config['http_user'], http_config['http_pass']\n resp = http.request(req)\n ret = tab_to_array_of_hashes(resp.body) if resp.code == '200'\n }\n ret\n end", "def tables\n options.fetch(:tables)\n end", "def create\n @configtable = Configtable.new(params[:configtable])\n\n respond_to do |format|\n if @configtable.save\n format.html { redirect_to @configtable, notice: 'Configtable was successfully created.' }\n format.json { render json: @configtable, status: :created, location: @configtable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_table(table_name, options = {})\n headers = {\n Azure::Storage::Common::HeaderConstants::ACCEPT => Serialization.get_accept_string(:full_meta),\n }\n options[:request_location_mode] = Azure::Storage::Common::RequestLocationMode::PRIMARY_OR_SECONDARY\n response = call(:get, table_uri(table_name, new_query(options), options), nil, headers, options)\n Serialization.table_entries_from_json(response.body)\n rescue => e\n raise_with_response(e, response)\n end", "def index\n @app_configs = AppConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @app_configs }\n end\n end", "def get_tables\n\t\t@@tables\n\tend", "def table_response(key, query = nil, *args)\n url = File.join(properties.primary_endpoints.table, *args)\n\n headers = build_headers(url, key, 'table')\n headers['Accept'] = 'application/json;odata=fullmetadata'\n\n # Must happen after headers are built\n unless query.nil? || query.empty?\n url << \"?#{query}\"\n end\n\n ArmrestService.send(\n :rest_get,\n :url => url,\n :headers => headers,\n :proxy => proxy,\n :ssl_version => ssl_version,\n :ssl_verify => ssl_verify,\n )\n end", "def index\n current_admin_user\n @tablets = Tablet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tablets }\n end\n end", "def test_it_can_get_list_of_tables\n VCR.insert_cassette 'tables'\n tables = @api.tables('writer1')\n\n assert_kind_of Array, tables\n assert_equal 2, tables.size\n\n assert_kind_of Hash, tables.first\n assert_kind_of Hash, tables.last\n\n assert_equal \"out.c-main.categories\", tables.first[\"id\"]\n assert_equal \"out.c-main.products\", tables.last[\"id\"]\n assert_equal \"Categories\", tables.first[\"name\"]\n assert_equal \"Products\", tables.last[\"name\"]\n end", "def index\n @service_tables = ServiceTable.all\n end", "def get_table(name, table_id, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_table_with_http_info(name, table_id, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_table_with_http_info(name, table_id, opts)\n else\n raise\n end\n return data\n end", "def table\n Airmodel.client.table base_config[:base_id], base_config[:table_name]\n end", "def destroy\n @configtable = Configtable.find(params[:id])\n @configtable.destroy\n\n respond_to do |format|\n format.html { redirect_to configtables_url }\n format.json { head :no_content }\n end\n end", "def get_all_tables\n\t\ttc = new_sub(@discovery['tables'])\n\t\ttc.poll[:messages].map {|x| pp x; JSON.parse(x.content) rescue nil}.compact\n\tend", "def tables\n @tables ||= begin\n tables_channel = channel(\n Admin::V2::BigtableTableAdminClient::SERVICE_ADDRESS\n )\n Admin::V2::BigtableTableAdminClient.new(\n credentials: tables_channel,\n timeout: timeout,\n client_config: client_config,\n lib_name: \"gccl\",\n lib_version: Google::Cloud::Bigtable::VERSION\n )\n end\n end", "def get_table(table_name, options={})\n query = { }\n query[\"timeout\"] = options[:timeout].to_s if options[:timeout]\n\n response = call(:get, table_uri(table_name, query), nil, {}, options)\n results = Table::Serialization.hash_from_entry_xml(response.body)\n results[:updated]\n rescue => e\n raise_with_response(e, response)\n end", "def table table_id, app_profile_id: nil\n ensure_service!\n Client::Table.new(\n @service.client,\n table_path(table_id),\n app_profile_id: app_profile_id\n )\n end", "def tables(key = nil)\n key ||= properties.key1\n response = table_response(key, nil, \"Tables\")\n JSON.parse(response.body)['value'].map{ |t| Table.new(t) }\n end", "def index\n @ip_table_overrides = IpTableOverride.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ip_table_overrides }\n end\n end", "def index\n @configs = Config.all\n end", "def index\n @event_configurations = EventConfiguration.all.order(:id)\n render json: @event_configurations.to_json\n end", "def index\n @system_configurations = SystemConfiguration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @system_configurations }\n end\n end", "def data\r\n tables_ret = []\r\n tables.list.each do |name, table|\r\n tables_ret << table.data\r\n end\r\n \r\n return {\r\n \"tables\" => tables_ret\r\n }\r\n end", "def get_table(scaffold, **filters)\n get_url = \"#{@device_address}/admin/scaffolds/#{scaffold}/index.json?api_key=#{@device_api_key}\"\n json_body = JSON.parse(Excon.get(get_url).body)\n\n if filters.any?\n filters.each do |name, value|\n json_body.keep_if { |return_item| return_item[name.to_s] == value.to_s }\n end\n end\n\n json_body\n end", "def index\n @system_configs = SystemConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @system_configs }\n end\n end", "def tables\n []\n end", "def index\n @tables = Table.all\n end", "def index\n @tables = Table.all\n end", "def index\n @tables = Table.all\n end", "def index\n @tables = Table.all\n end", "def show\n @global_config = AppConfig.where(:section => params[:sect])\n @global_config.each do |conf|\n puts conf.confkey\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @global_config }\n end\n end", "def show\n @custom_table = CustomTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @custom_table }\n end\n end", "def index\n # @ddconfigs = Ddconfig.all\n if Ddconfig.all.size == 0\n render json: {message: \"还未配置\"}, status: 200 and return\n else\n ddconfig = Ddconfig.first\n render json:{CorpId: ddconfig.CorpId, AppKey: ddconfig.AppKey, AppSecret: ddconfig.AppSecret, AgentId: ddconfig.AgentId}, status: :ok and return\n end\n end", "def table(table_id); Table.new(@opts, get(\"tables/#{table_id}\")); end", "def index\n @title = 'Tables'\n @tables = Table.all\n\n respond_to do |format|\n format.html {\n @tables_rabl = Rabl.render(@tables, 'tables/index', view_path: 'app/views', format: 'json')\n @guests_rabl = Rabl.render(Guest.attending, 'tables/guests', view_path: 'app/views', format: 'json')\n }\n format.json { render json: @tables }\n end\n end", "def get_data\n raise \"This method should be overriden to return the JSON data for a concrete table\"\n end", "def tables\n [\n ]\n end", "def index\n @bs_tables = BsTable.all\n end", "def api_table\n controller_name\n end", "def index\n @api_configs = ApiConfig.all\n end", "def index\n @table_settings = TableSetting.all\n end", "def show\n @identity_table = IdentityTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @identity_table }\n end\n end", "def update\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n if @configtable.update_attributes(params[:configtable])\n format.html { redirect_to @configtable, notice: 'Configtable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @table = Table.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end", "def getTable() \n puts @table[0][\"name\"];\n end", "def index\n @data_tables = DataTable.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @data_tables.as_json(only: [:title, :username, :name, :email, :hometown]) }\n # end\n end", "def show\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end", "def show\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end", "def show\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end", "def index\n @timetables = Timetable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timetables }\n end\n end", "def table\n Response\n end", "def destroy\n @config_table = ConfigTable.find(params[:id])\n @config_table.destroy\n respond_to do |format|\n @config_tables = ConfigTable.all\n format.js\n end\n end", "def show\n @ip_table = IpTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ip_table }\n end\n end", "def index\n conditions = []\n params[:per_page] = perpage if params[:per_page].nil?\n params[:page] = 1 if params[:page].blank?\n unless params[:search].blank?\n conditions.push \"config_type like ? or key like ?\"\n conditions.push \"%#{params[:search]}%\"\n conditions.push \"%#{params[:search]}%\"\n end\n @kf_global_configs = Kf::GlobalConfig.order(\"id DESC\").paginate(:page => params[:page], :per_page => params[:per_page] ,:conditions => conditions)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kf_global_configs }\n end\n end", "def get_tables(db_name)\n response = @glue_client.get_tables(database_name: db_name)\n response.table_list\n rescue Aws::Glue::Errors::GlueException => e\n @logger.error(\"Glue could not get tables #{db_name}: \\n#{e.message}\")\n raise\n end", "def get_table instance_id, table_id, view: nil\n tables.get_table name: table_path(instance_id, table_id), view: view\n end", "def index\n @cdn_configs = CdnConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cdn_configs }\n end\n end", "def index\n @configurations = ::Configuration.all\n end", "def index\n @user_device_configurations = UserDeviceConfiguration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_device_configurations }\n end\n end", "def show\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_config }\n end\n end", "def index\n @task_tables = TaskTable.all\n end", "def tables\n @tables ||= if @registration[:tables].present?\n @registration[:tables].call(@connection)\n else\n @connection.tables\n end\n end", "def show\n @dummy_table = DummyTable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dummy_table }\n end\n end", "def index\n\t\t@tables = Table.all\n\tend", "def readTable(path)\n return JSON.parse(File.read(path).rstrip)\nend", "def load_profiles()\n # read profiles\n puts \"Loading configs from #{@server_host}:#{@server_port}\" # Rails.logger.info\n\n res = Net::HTTP.start(@server_host, @server_port) {|http|\n http.open_timeout = 5\n http.read_timeout = 10\n http.get('/api/profiles')\n }\n raise \"HTTP status is not succeeded\" if res.code != '200'\n\n profiles_arr = JSON.parse(res.body)\n @table = ProfileTable.new(profiles_arr)\n end", "def show\n @table_alias = TableAlias.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table_alias }\n end\n end", "def index\n @tournament_configs = TournamentConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tournament_configs }\n end\n end", "def index\n @through_tables = ThroughTable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @through_tables }\n end\n end", "def structure\n self.change_schema_to 'information_schema';\n @database_name, @table_name = request[:database_name], request[:name]\n @result = Hash.new success: true\n @result[:columns] = Column.where TABLE_SCHEMA: @database_name, TABLE_NAME: @table_name\n structure = Table.where(TABLE_SCHEMA: @database_name, TABLE_NAME: @table_name).first.attributes\n @result[:desc] = []\n structure.keys.length.times do |i|\n key = structure.keys[i]\n @result[:desc].push COLUMN_NAME: key, COLUMN_TYPE: structure[key]\n end\n \n @result[:type] = 'table'\n @result[:name] = @table_name\n \n render json: @result\n end", "def show\n @clientconfig = Clientconfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientconfig }\n end\n end", "def index\n @schema_tables = SchemaTable.all\n end", "def show\n @ip_table_override = IpTableOverride.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ip_table_override }\n end\n end", "def index\n if current_user.role.title != 'admin'\n if current_user.developer.nil?\n @config_files = []\n else\n @config_files = current_user.developer.config_files(:order => 'created_at DESC')\n end\n else\n @config_files = ConfigFile.all(:order => 'created_at DESC')\n end\n #@config_files = ConfigFile.all(:order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @config_files }\n end\n end", "def tables()\n tables = []\n @client.query(\"SHOW TABLES;\").each do |table|\n tables.push(table.values[0])\n end\n\n tables\n end", "def index\n @sysconfigs = Sysconfig.order(created_at: :desc).page(params[:page])\n end", "def show\n @sysconfig = Sysconfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sysconfig }\n end\n end", "def show\n @cg_table_type = CgTableType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cg_table_type }\n end\n end", "def index\n @a_serverconfigurations = AServerconfiguration.all\n end", "def get_config()\n return @api.do_request(\"GET\", get_base_api_path() + \"/config\")\n end", "def index\n @app_configs = AppConfig.all\n end", "def index\n @configuration_details = ConfigurationDetail.all\n end", "def tables\n sanity_check\n @handle.tables\n end", "def tables view: nil\n client.list_tables(\n instance_path,\n view: view\n )\n end", "def _get_dyn_table(console, address, payload = nil)\n if payload\n response = AJAX.post(console, address, payload)\n else\n response = AJAX.get(console, address)\n end\n response = REXML::Document.new(response)\n\n headers = _dyn_headers(response)\n rows = _dyn_rows(response)\n rows.map { |row| Hash[headers.zip(row)] }\n end", "def get_config_infos\n configinfo =\n {\n :init_one_appointment_price => Settings.init_one_appointment_price,\n :income_call_number => Settings.income_call_number,\n :call_length => Settings.call_length,\n :tutor_online_time => Settings.tutor_online_time,\n :call_delay_time => Settings.call_delay_time,\n :tutor_single_price => Settings.tutor_single_price\n }\n render :json => configinfo.to_json(), :status => 200\n end", "def as_json(*args)\n super.as_json['table']\n end", "def configure(conf)\n super\n @tables = Hash.new\n end", "def all\n JSON.parse(@client.call('config.get'))\n end", "def list_tables\n data.keys\n end" ]
[ "0.74101096", "0.6346767", "0.6217009", "0.61968213", "0.6138534", "0.6107675", "0.6063181", "0.6037319", "0.6028485", "0.5991478", "0.5958607", "0.59477735", "0.5934612", "0.5927", "0.5901325", "0.5808314", "0.58078724", "0.5801319", "0.57814103", "0.578059", "0.5778919", "0.57706434", "0.5765149", "0.5764424", "0.57583797", "0.5754707", "0.5743484", "0.5729934", "0.5720499", "0.57176524", "0.56810176", "0.56776166", "0.5673635", "0.5654162", "0.5653472", "0.56289554", "0.5585838", "0.5585838", "0.5585838", "0.5585838", "0.55690044", "0.5567419", "0.5560818", "0.5560331", "0.55602044", "0.55601263", "0.555812", "0.5551249", "0.55475444", "0.5539966", "0.5532724", "0.55288947", "0.55239195", "0.5521264", "0.5518808", "0.5516149", "0.5512099", "0.5512099", "0.5512099", "0.55024654", "0.5498475", "0.5495775", "0.5494773", "0.5489968", "0.5480237", "0.5477147", "0.5474737", "0.54679143", "0.5447029", "0.5439816", "0.54334867", "0.54308426", "0.5423002", "0.5417974", "0.5411298", "0.5386985", "0.53768986", "0.5361113", "0.5358845", "0.5356833", "0.5345661", "0.53448963", "0.5341553", "0.5329024", "0.5325803", "0.53240484", "0.53186786", "0.53152686", "0.5309056", "0.5302851", "0.5297326", "0.5296903", "0.52953666", "0.52916664", "0.5286782", "0.5284531", "0.5281153", "0.5280107", "0.5278477", "0.52778244" ]
0.5931553
13
GET /config_tables/new GET /config_tables/new.json
def new @config_table = ConfigTable.new respond_to do |format| format.js format.html # new.html.erb end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @configtable = Configtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configtable }\n end\n end", "def create\n @configtable = Configtable.new(params[:configtable])\n\n respond_to do |format|\n if @configtable.save\n format.html { redirect_to @configtable, notice: 'Configtable was successfully created.' }\n format.json { render json: @configtable, status: :created, location: @configtable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\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 @custom_table = CustomTable.new\n\n respond_to do |format|\n format.json { render json: @custom_table }\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 @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 @ip_table = IpTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ip_table }\n end\n end", "def new\n @cg_table_type = CgTableType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cg_table_type }\n end\n end", "def new\n @table_alias = TableAlias.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table_alias }\n end\n end", "def new\n @ip_table_override = IpTableOverride.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ip_table_override }\n end\n end", "def create\n @config_table = ConfigTable.new(params[:config_table])\n @config_table.year = params[:config_table][:id] \n respond_to do |format|\n if @config_table.save\n format.html { redirect_to config_tables_path, :notice => 'Config table was successfully created.' }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def new\n @table = Table.new\n if Table.last.blank?\n @table.number = 1\n else\n @table.number = Table.last.number+1\n end\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 @stable = Stable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stable }\n end\n end", "def new\n current_admin_user\n @tablet = Tablet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tablet }\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 @table_user = TableUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table_user }\n end\n end", "def new\n\tadd_breadcrumb \"Nueva configuración\", :new_configuracion_path\n @configuracion = Configuracion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @configuracion }\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to tables_path, notice: 'Table was successfully created.' }\n format.json { render action: 'show', status: :created, location: @table }\n else\n format.html { render action: 'new' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @configtable }\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to admin_index_tables_path, notice: 'Mesa creada!.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @sysconfig = Sysconfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sysconfig }\n end\n end", "def create\n @table = Table.new(params[:table])\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render json: @table, status: :created, location: @table }\n else\n format.html { render action: 'new' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\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 @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 @schema = Schema.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @schema }\n end\n end", "def new\n @config_file = ConfigFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @config_file }\n end\n end", "def create\n @custom_table = CustomTable.new(params[:custom_table])\n\n respond_to do |format|\n if @custom_table.save\n format.html { redirect_to @custom_table, notice: 'Custom table was successfully created.' }\n format.json { render json: @custom_table, status: :created, location: @custom_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @custom_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @schema = Schema.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @schema }\n end\n end", "def new\n @conf = Conf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conf }\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render action: 'show', status: :created, location: @table }\n else\n format.html { render action: 'new' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\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 @tablet = Tablet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tablet }\n end\n end", "def new\n @config_template = ConfigTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @config_template }\n format.xml { render :xml => @config_template }\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @through_table = ThroughTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @through_table }\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\n @configure = Configure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configure }\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 create\n @table = Table.new(params[:table].permit(:name, :notes, :x, :y, :table_type, :guest_ids => []))\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render 'tables/create', status: :created, location: @table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @table_menu = Table::Menu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table_menu }\n end\n end", "def new\n @timetable = Timetable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timetable }\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 if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n @timetable = Timetable.new\n puts @timetable.to_json\n end", "def create\n @identity_table = IdentityTable.new(params[:identity_table])\n\n respond_to do |format|\n if @identity_table.save\n format.html { redirect_to identity_tables_path, alert: '新表添加成功!' }\n format.json { render json: @identity_table, status: :created, location: @identity_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @identity_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @lookup_truthtable = LookupTruthtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_truthtable }\n end\n end", "def new\n @restaurant_table = RestaurantTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @restaurant_table }\n end\n end", "def create\n @schema_table = SchemaTable.new(schema_table_params)\n\n respond_to do |format|\n if @schema_table.save\n format.html { redirect_to @schema_table, notice: 'Schema table was successfully created.' }\n format.json { render :show, status: :created, location: @schema_table }\n else\n format.html { render :new }\n format.json { render json: @schema_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:database_version]\n last_edit = LogEdit.find(:first, :order => \"id DESC\")\n if (last_edit and last_edit.id.to_i != params[:database_version].to_i)\n render_json({:error => 'Database Version Mismatch', :server_version => last_edit.id}.to_json)\n return\n end\n end\n # json = {type:ModelName, attr:{hash of attributes}}\n if request.post?\n data = ActiveSupport::JSON.decode(params[:json])\n klass = Object.const_get(data['type'].camelcase)\n if CLIENT_TABLES.include? klass\n res = klass.merge_create(data['attr'])\n render_json res.to_json\n return\n end\n end\n render_json \"error\".to_json # TODO add error for bad table name \n end", "def create\n @table = Table.new\n @table.user_id = current_user.id\n @table.name = params[:name] if params[:name]\n @table.description = params[:description] if params[:description]\n @table.the_geom_type = params[:the_geom_type] if params[:the_geom_type]\n @table.force_schema = params[:schema] if params[:schema]\n @table.tags = params[:tags] if params[:tags]\n @table.import_from_query = params[:from_query] if params[:from_query]\n\n if @table.valid? && @table.save\n @table = Table.fetch(\"select *, array_to_string(array(select tags.name from tags where tags.table_id = user_tables.id),',') as tags_names\n from user_tables\n where id=?\",@table.id).first\n render_jsonp(@table.public_values, 200, { :location => table_path(@table) })\n else\n CartoDB::Logger.info \"Error on tables#create\", @table.errors.full_messages\n render_jsonp( { :description => @table.errors.full_messages,\n :stack => @table.errors.full_messages\n }, 400)\n end\n end", "def new\n\t\n\t@timetable = Timetable.new\n\t\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timetable }\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Mesa criada com sucesso.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dummy_table = DummyTable.new(params[:dummy_table])\n\n respond_to do |format|\n if @dummy_table.save\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully created.' }\n format.json { render json: @dummy_table, status: :created, location: @dummy_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @temp_table_for_cust = TempTableForCust.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @temp_table_for_cust }\n end\n end", "def new\n @global_config = AppConfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @global_config }\n end\n end", "def new\n @itemstable = Itemstable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @itemstable }\n end\n end", "def create_table(payload)\n make_request(payload, 'post')\n [status, body]\n end", "def new\n @configuration_set = ConfigurationSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configuration_set }\n end\n end", "def new\n @congestion = Congestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @congestion }\n end\n end", "def new\n @classtable = Classtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classtable }\n end\n end", "def new\n @system_config = SystemConfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @system_config }\n end\n end", "def new\n @var_conf = VarConf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @var_conf }\n end\n end", "def create\n @task_table = TaskTable.new(task_table_params)\n\n respond_to do |format|\n if @task_table.save\n format.html { redirect_to @task_table, notice: 'Task table was successfully created.' }\n format.json { render :show, status: :created, location: @task_table }\n else\n format.html { render :new }\n format.json { render json: @task_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(table, new_record)\n self.post(\"/#{table}/create\", body: {record: new_record})\n end", "def new\n @col = Col.new\n \n respond_to do |format|\n format.html {render :layout => false}\n format.json { render json: @col }\n end\n end", "def new\n @annex = Annex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @annex }\n end\n end", "def get_all_new\n uri = [@@base_uri, 'all', 'getAllNew'].join('/')\n return get(uri)\n end", "def new\n @sequence_database = SequenceDatabase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sequence_database }\n end\n end", "def create\n @ip_table = IpTable.new(params[:ip_table])\n\n respond_to do |format|\n if @ip_table.save\n format.html { redirect_to @ip_table, notice: 'Ip table was successfully created.' }\n format.json { render json: @ip_table, status: :created, location: @ip_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ip_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @code_table = CodeTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @code_table }\n end\n end", "def create\n @table_def = TableDef.new(table_def_params)\n authorize! :create, @table_def\n\n respond_to do |format|\n if @table_def.save\n format.html { redirect_to @table_def, notice: t('.create_ok') }\n format.json { render action: 'show', status: :created, location: @table_def }\n else\n format.html { render action: 'new' }\n format.json { render json: @table_def.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @notify_config = NotifyConfig.new\n\n add_breadcrumb('Create Notification Configuration')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notify_config }\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 @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 @tgl_row = TglRow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tgl_row }\n end\n end", "def new\n @get = Get.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @get }\n end\n end", "def new\n @baton = Baton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @baton }\n end\n end", "def create\n @bs_table = BsTable.new(bs_table_params)\n\n respond_to do |format|\n if @bs_table.save\n format.html { redirect_to @bs_table, notice: 'Bs table was successfully created.' }\n format.json { render :show, status: :created, location: @bs_table }\n else\n format.html { render :new }\n format.json { render json: @bs_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @my_configuration = MyConfiguration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_configuration }\n end\n end", "def new\n @deployment = Deployment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deployment }\n end\n end", "def new\n @lookup = Lookup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lookup }\n end\n end", "def create\n if current_user.restaurant_ids.include?(params[:restaurant_id].to_i)\n # find new table number\n table_index = 1\n tables = Table.where(restaurant_id: params[:restaurant_id])\n if !tables.nil? && tables.count > 0\n tables.each do |table|\n table_index = table.table_number + 1 if table.table_number >= table_index\n end \n end\n\n @table = Table.new(restaurant: Restaurant.find(params[:restaurant_id]), table_number: table_index)\n\n if @table.save\n render json: @table, status: :created, location: nil\n else\n render json: @table.errors, status: :unprocessable_entity\n end\n else\n render json: { error: \"can't add tables to restaurants you don't own\" }, status: :unprocessable_entity\n end\n end", "def new\n\tif signed_in?\n\t\t@current_client = current_user.username\n\t\tif current_user.username == 'admin'\n\t\t\t@clientconfig = Clientconfig.new\n\t\t\t@clients = Client.all.collect {|c| [c.name, c.id]}\n\t\telse\n\t\t\tredirect_to home_path\n\t\tend\n\telse\n\t\tredirect_to signin_path\n\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientconfig }\n end\n end", "def new\n @chef_mapping = ChefMapping.new\n @source = []\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chef_mapping }\n end\n end", "def new\n @reference_database = ReferenceDatabase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reference_database }\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 @coffee_table = CoffeeTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @coffee_table }\n end\n end", "def new\n @barn_configuration = BarnConfiguration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @barn_configuration }\n end\n end", "def new\n @hive = Hive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hive }\n end\n end", "def new\n @site_config = SiteConfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site_config }\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 @query_history = QueryHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @query_history }\n end\n end", "def new\n @system_configuration = SystemConfiguration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system_configuration }\n end\n end", "def new\n @confrence = Confrence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @confrence }\n end\n end", "def bulk_new\n @bulk_new = BulkNew.new\n\n respond_to do |format|\n format.html # bulk_new.html.erb\n format.json { render json: @bulk_new }\n end\n end", "def new\n @consensu = Consensu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @consensu }\n end\n end", "def new\n @onecolumnmodel = Onecolumnmodel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @onecolumnmodel }\n end\n end", "def new\n @constraint = Constraint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @constraint }\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 create\n @liber777_table = Liber777Table.new(params[:liber777_table])\n\n respond_to do |format|\n if @liber777_table.save\n format.html { redirect_to @liber777_table, notice: 'Liber777 table was successfully created.' }\n format.json { render json: @liber777_table, status: :created, location: @liber777_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @liber777_table.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.79658824", "0.73223513", "0.68264925", "0.68264925", "0.6751242", "0.6603381", "0.65405256", "0.6509538", "0.62613326", "0.6238379", "0.6107124", "0.61063665", "0.609677", "0.6087505", "0.6083514", "0.60793495", "0.6061373", "0.6051682", "0.6036759", "0.6003502", "0.6001668", "0.5981566", "0.59810835", "0.59801596", "0.59572244", "0.59532607", "0.59488136", "0.5944296", "0.59439933", "0.5937999", "0.59316534", "0.5898841", "0.5863522", "0.5850299", "0.5844886", "0.58415174", "0.58384234", "0.5838054", "0.5832104", "0.5830768", "0.5816336", "0.5804898", "0.5803963", "0.5781333", "0.5780919", "0.57766634", "0.5772879", "0.57700276", "0.57581335", "0.57563686", "0.5747562", "0.5724101", "0.57031286", "0.570264", "0.56953174", "0.56868744", "0.56501603", "0.5644957", "0.5636539", "0.5625651", "0.56188756", "0.561716", "0.561278", "0.56122786", "0.5605754", "0.5602578", "0.55951244", "0.55907315", "0.55826944", "0.5575968", "0.5568603", "0.5551991", "0.55405086", "0.55361605", "0.55337703", "0.5531266", "0.5528376", "0.54970896", "0.54923695", "0.54918945", "0.547709", "0.5476392", "0.5470076", "0.5457368", "0.5454757", "0.54433745", "0.5436759", "0.54299825", "0.54271597", "0.5423078", "0.5417295", "0.5405616", "0.53973925", "0.5392684", "0.53913206", "0.5390166", "0.5387696", "0.53871155", "0.5384086", "0.5382271" ]
0.68837845
2
POST /config_tables POST /config_tables.json
def create @config_table = ConfigTable.new(params[:config_table]) @config_table.year = params[:config_table][:id] respond_to do |format| if @config_table.save format.html { redirect_to config_tables_path, :notice => 'Config table was successfully created.' } else format.html { render :action => "new" } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @configtable = Configtable.new(params[:configtable])\n\n respond_to do |format|\n if @configtable.save\n format.html { redirect_to @configtable, notice: 'Configtable was successfully created.' }\n format.json { render json: @configtable, status: :created, location: @configtable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_table(payload)\n make_request(payload, 'post')\n [status, body]\n end", "def create_tog_config_table\n ActiveRecord::Base.connection.create_table \"config\", :force => false do |t|\n t.string :key, :limit => 255, :default => \"\", :null => false\n t.string :value\n t.timestamps\n end\n ActiveRecord::Base.connection.add_index \"config\", [\"key\"], :name => \"key\", :unique => true\n end", "def create_tables\n self.conn.exec(\n File.read(\"./lib/creating_tables.txt\")\n \n )\n end", "def create_table_request\n {\n table_name: self.table_name.to_s,\n attribute_definitions: self.attribute_definitions,\n key_schema: self.key_schema,\n provisioned_throughput: self.provisioned_throughput\n }\n end", "def create body = {}\n @connection.request(method: :post, path: \"/configs/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end", "def create\n @schema_table = SchemaTable.new(schema_table_params)\n\n respond_to do |format|\n if @schema_table.save\n format.html { redirect_to @schema_table, notice: 'Schema table was successfully created.' }\n format.json { render :show, status: :created, location: @schema_table }\n else\n format.html { render :new }\n format.json { render json: @schema_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @table = Table.new(params[:table].permit(:name, :notes, :x, :y, :table_type, :guest_ids => []))\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render 'tables/create', status: :created, location: @table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_table!\n raise InvalidTableDefinition.new \"#{ self.name } has invalid table configuration\" unless model_table_config_is_valid?\n TinyDyno::Adapter.create_table(create_table_request)\n end", "def new\n @configtable = Configtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configtable }\n end\n end", "def table_params\n params.require(:table).permit!\n end", "def create\n @table = Table.new\n @table.user_id = current_user.id\n @table.name = params[:name] if params[:name]\n @table.description = params[:description] if params[:description]\n @table.the_geom_type = params[:the_geom_type] if params[:the_geom_type]\n @table.force_schema = params[:schema] if params[:schema]\n @table.tags = params[:tags] if params[:tags]\n @table.import_from_query = params[:from_query] if params[:from_query]\n\n if @table.valid? && @table.save\n @table = Table.fetch(\"select *, array_to_string(array(select tags.name from tags where tags.table_id = user_tables.id),',') as tags_names\n from user_tables\n where id=?\",@table.id).first\n render_jsonp(@table.public_values, 200, { :location => table_path(@table) })\n else\n CartoDB::Logger.info \"Error on tables#create\", @table.errors.full_messages\n render_jsonp( { :description => @table.errors.full_messages,\n :stack => @table.errors.full_messages\n }, 400)\n end\n end", "def device_table_mapping_params\n params.require(:device_table_mapping).permit(:device_id, :device_name, :table_no)\n end", "def table_params\n params.require(:table).permit(:name, :is_outdoor, :location)\n end", "def bs_table_params\n params.require(:bs_table).permit(:bs_system_id, :logical, :physical, :remark, :bs_db_id, :db_name, :schema, :delflag)\n end", "def create\n @identity_table = IdentityTable.new(params[:identity_table])\n\n respond_to do |format|\n if @identity_table.save\n format.html { redirect_to identity_tables_path, alert: '新表添加成功!' }\n format.json { render json: @identity_table, status: :created, location: @identity_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @identity_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def table_params\n params.require(:table).permit(:name)\n end", "def table_params\n params.require(:table).permit(:name, :statu)\n end", "def configure(conf)\n super\n @tables = Hash.new\n end", "def create(table, hash_of_attributes)\n @@pg_conn.exec(\"insert into #{tablename}#{table}(json) values ('#{JSON::dump(hash_of_attributes)}') \")\n end", "def registration_table_params\n params.require(:registration_table).permit(:table_id, :user_event_id)\n end", "def bootstrap\n sql = 'CREATE TABLE IF NOT EXISTS states(uuid VARCHAR(128) PRIMARY KEY,'\n sql << ' id INTEGER, name VARCHAR(128), deploy_id VARCHAR(128), timestamp INTEGER,'\n sql << ' missing INTEGER, state VARCHAR(128), hyperv VARCHAR(128))'\n\n @db.execute(sql)\n\n sql = 'CREATE TABLE IF NOT EXISTS settings(key VARCHAR(128) PRIMARY KEY,'\n sql << ' value VARCHAR(128))'\n\n @db.execute(sql)\n end", "def table_params\n params.require(:table).permit(\n :name\n )\n end", "def table_setting_params\n params.require(:table_setting).permit(:table_name, :column_name, :attribute, :standard, :use, :custom_name_ja, :custom_name_en, :description_ja, :description_en, :required, :default, :sys_lower, :sys_high, :custom_lower, :custom_high, :format, :currency, :order_input, :order_list, :order_result)\n end", "def create_table(create_table_request)\n table_settings = {\n provisioned_throughput: {\n read_capacity_units: 200,\n write_capacity_units: 200,\n },\n }.merge!(create_table_request)\n\n # Should or shouldn't we?\n # begin\n # resp = connection.describe_table(table_name: table_settings[:table_name])\n # rescue Aws::DynamoDB::Errors::ResourceNotFoundException\n # ensure\n # if resp.respond_to?(:table)\n # p \"Warning, table was already present : #{ table_settings[:table_name]}\"\n # end\n # end\n connection.create_table(table_settings)\n if wait_on_table_status(table_status: :table_exists, table_name: table_settings[:table_name])\n update_table_cache\n return true\n else\n return false\n end\n end", "def create\n @table_setting = TableSetting.new(table_setting_params)\n\n respond_to do |format|\n if @table_setting.save\n format.html { redirect_to @table_setting, notice: 'Table setting was successfully created.' }\n format.json { render :show, status: :created, location: @table_setting }\n else\n format.html { render :new }\n format.json { render json: @table_setting.errors, status: :unprocessable_entity }\n end\n end\n end", "def createTaskTable\n @Handle.execute( @TaskSchema ) \n end", "def registration_table_params\n params.require(:registration_table).permit(:table_id, :user_event_id, :paid, :payment_amount, :payment_id,\n :payment_date)\n end", "def create_table\n params.require(:table).permit(:restourant_id, :name, :min_num, :max_num)\n end", "def schema_table_params\n params.require(:schema_table).permit(:name, :schema_version_id)\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to admin_index_tables_path, notice: 'Mesa creada!.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def table_params\n params.require(:table).permit(:name, :reverse_ends, :banner_id, :banner_message)\n end", "def table_params\n params.require(:table).permit(:name, :owner, :game_id, :user_id, :event_id)\n end", "def table(name, &block)\n if block\n @config[:tables][name] = Docile.dsl_eval(Watchy::Config::TableConfigBuilder.new, &block).build\n else\n @config[:tables][name] = {\n rules: {\n insert: [],\n update: [],\n delete: [ Watchy::DefaultDeleteRule.new ]\n },\n versioning_enabled: true\n }\n end\n\n if @config[:tables][name][:rules][:delete].empty?\n @config[:tables][name][:rules][:delete] << Watchy::DefaultDeleteRule.new\n end\n end", "def create\n @custom_table = CustomTable.new(params[:custom_table])\n\n respond_to do |format|\n if @custom_table.save\n format.html { redirect_to @custom_table, notice: 'Custom table was successfully created.' }\n format.json { render json: @custom_table, status: :created, location: @custom_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @custom_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def table_params\n params.require(:table).permit(:description, :state, :branch_id, :number, :assign)\n end", "def destroy\n @configtable = Configtable.find(params[:id])\n @configtable.destroy\n\n respond_to do |format|\n format.html { redirect_to configtables_url }\n format.json { head :no_content }\n end\n end", "def create\n @dummy_table = DummyTable.new(params[:dummy_table])\n\n respond_to do |format|\n if @dummy_table.save\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully created.' }\n format.json { render json: @dummy_table, status: :created, location: @dummy_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def tnTableCreation(tableName)\n pk_list = @pkList.join(',')\n pk_list = \"#{pk_list},branch_name,node_name\"\n q = QueryBuilder.create_tbl(tableName, pk_list, \"select #{@pkSelect}, 0 as test_id,''::varchar(30) as node_name, ''::varchar(30) as branch_name, ''::varchar(5) as type from #{@fTable} f where 1 = 0\")\n # pp q\n DBConn.exec(q)\n\n # q=\"ALTER TABLE #{tableName} add column test_id int, add column node_name varchar(30), add column branch_name varchar(30), add column type varchar(5);\"\n # DBConn.exec(q)\n # pk=@pkList.join(',')\n # # add index\n # q=\"create index ix_#{tableName}t on #{tableName} (#{pk},branch_name);\"\n # pp q\n # DBConn.exec(q)\n end", "def create\n @table = Table.new(params[:table])\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render json: @table, status: :created, location: @table }\n else\n format.html { render action: 'new' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @task_table = TaskTable.new(task_table_params)\n\n respond_to do |format|\n if @task_table.save\n format.html { redirect_to @task_table, notice: 'Task table was successfully created.' }\n format.json { render :show, status: :created, location: @task_table }\n else\n format.html { render :new }\n format.json { render json: @task_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_table(table_name, options={})\n query = { }\n query['timeout'] = options[:timeout].to_s if options[:timeout]\n\n body = Table::Serialization.hash_to_entry_xml({\"TableName\" => table_name}).to_xml\n call(:post, collection_uri(query), body, {}, options)\n nil\n end", "def table_params\n params.require(:table).permit(:table_number, :company_id)\n end", "def create\n @bs_table = BsTable.new(bs_table_params)\n\n respond_to do |format|\n if @bs_table.save\n format.html { redirect_to @bs_table, notice: 'Bs table was successfully created.' }\n format.json { render :show, status: :created, location: @bs_table }\n else\n format.html { render :new }\n format.json { render json: @bs_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_sky_table\n @sky_table = sky_client.create_table(:name => sky_table_name)\n @sky_table.create_property(:name => 'channel', :transient => true, :data_type => 'factor')\n @sky_table.create_property(:name => 'resource', :transient => true, :data_type => 'factor')\n @sky_table.create_property(:name => 'action', :transient => true, :data_type => 'factor')\n @sky_table.create_property(:name => 'href', :transient => true, :data_type => 'factor')\n @sky_table.create_property(:name => 'anonymous', :transient => true, :data_type => 'boolean')\n @sky_table.create_property(:name => 'url', :transient => true, :data_type => 'factor')\n end", "def generate_table_def_table()\r\n table_def_name = \"table_definitions\"\r\n\r\n # If the table doesn't already exist, create it\r\n puts \"Creating table definition table (#{table_def_name}) if it doesn't exist.\" if @enable_debug_logging\r\n db_column_size_limits = @db_column_size_limits\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n @db.create_table?(table_def_name.to_sym) do\r\n String :tableName, :primary_key => true, :size => db_column_size_limits[:tableName]\r\n String :kappSlug, :size => db_column_size_limits[:kappSlug]\r\n String :formSlug, :size => db_column_size_limits[:formSlug]\r\n String :formName, :size => db_column_size_limits[:formName]\r\n end\r\n end\r\n end", "def create \n Configurations.create ( configurations_params)\n end", "def create\n @post_table = PostTable.new(post_table_params)\n\n respond_to do |format|\n if @post_table.save\n format.html { redirect_to @post_table, notice: 'Post table was successfully created.' }\n format.json { render :show, status: :created, location: @post_table }\n else\n format.html { render :new }\n format.json { render json: @post_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def data\r\n tables_ret = []\r\n tables.list.each do |name, table|\r\n tables_ret << table.data\r\n end\r\n \r\n return {\r\n \"tables\" => tables_ret\r\n }\r\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to tables_path, notice: 'Table was successfully created.' }\n format.json { render action: 'show', status: :created, location: @table }\n else\n format.html { render action: 'new' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n begin\n puts \"Creating...\"\n ActiveRecord::Schema.define do\n #create_table :test_relations do |table|\n # table.column :test_case_id, :integer\n # table.column :test_collection_id, :integer\n #end\n create_table :defaults do |table|\n table.column :configuration_id, :integer\n end\n\n\n # Project configuration\n create_table :configurations do |table|\n table.column :name, :string\n table.column :server, :string\n table.column :devkey, :string\n table.column :smtp_host, :string\n table.column :smtp_recipient, :string\n table.column :project, :string # aka prefix\n table.column :vm_user, :string\n table.column :vm_password, :string\n table.column :ssh_key_path, :string\n table.column :ssh_key_pw, :string\n table.column :base_path, :string\n table.column :output_path, :string\n table.column :public_options, :string\n end\n\n\n # A test collection is a collection of test, defined by project, testplan and build\n create_table :test_collections do |table|\n table.column :project, :string\n table.column :project_id, :string\n table.column :plan, :string\n table.column :plan_id, :string\n #table.column :build, :string\n #table.column :testrun_id, :string\n #table.column :test_cases, :string\n end\n\n create_table :test_cases do |table|\n table.column :urgency, :string\n table.column :name, :string\n table.column :file, :string\n table.column :external_id, :string\n table.column :platform_id, :string\n table.column :test_collection_id, :string\n\n end\n\n end\n\n rescue ActiveRecord::StatementInvalid\n # Table already created\n puts \"Setup already done. Destroy tables first before creating\"\n end\n\n\n end", "def tables\n options.fetch(:tables)\n end", "def post_page_tables(name, page_number, tables, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = post_page_tables_with_http_info(name, page_number, tables, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = post_page_tables_with_http_info(name, page_number, tables, opts)\n else\n raise\n end\n return data\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_table(*params)\n connection.create_table(*params) {}\n end", "def create\n @ip_table = IpTable.new(params[:ip_table])\n\n respond_to do |format|\n if @ip_table.save\n format.html { redirect_to @ip_table, notice: 'Ip table was successfully created.' }\n format.json { render json: @ip_table, status: :created, location: @ip_table }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ip_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_table(table)\n db_client.query(\"SHOW CREATE TABLE #{table['name']}\").first['Create Table'] + ';'\n end", "def table_def_params\n params.require(:table_def).permit(:name, fields_attributes: [:id, :name, :field_type, :required, :order, :_destroy])\n end", "def migrate_route_tables(dir)\n puts Colors.blue(\"Migrating route tables to #{dir}\")\n Hash[EC2::named_route_tables.map do |name, route_table|\n puts \"Migrating route table #{name}\"\n\n cumulus_rt = RouteTableConfig.new(name).populate!(route_table)\n\n json = JSON.pretty_generate(cumulus_rt.to_hash)\n File.open(\"#{dir}/#{name}.json\", \"w\") { |f| f.write(json) }\n\n [route_table.route_table_id, name]\n end]\n end", "def migrate_configuration\n puts \"migrating configuration\"\n ActiveRecord::Base.connection.execute('truncate table configuration')\n Configuration.create name: 'home', data: {headlines: [], today: [], tracklists: []}\n Configuration.create name: 'home_components', data: {headlines: 5, today: 3, tracklists: 3}\n Configuration.create name: 'navigation', data: {categories: []}\n Configuration.create name: 'about', data: {hebrew: nil, english: nil}\nend", "def create_tables\n create_mirrors\n create_users\n create_user_tokens\n create_products\n create_users_products\n create_versions\n create_dependencies\n create_access_keys\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Table was successfully created.' }\n format.json { render action: 'show', status: :created, location: @table }\n else\n format.html { render action: 'new' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def insertindb \n file = File.open(ENV[\"HOME\"]+ \"/config.rb\") \n content = file.read\n stmt = @con.prepare \"UPDATE #{$SVCTABLE} SET config=? WHERE svcid='#{$SVCID}';\"\n rs = stmt.execute content \n stmt.close\n end", "def generate_kapp_table(kapp_slug, opt_args = {})\r\n # If the table doesn't already exist, create it\r\n db_table_name = get_kapp_table_name(kapp_slug, {:is_temporary => opt_args[:is_temporary]})\r\n db_options = {}\r\n db_options[:temp] = true if opt_args[:is_temporary]\r\n db_options[:on_commit_preserve_rows] = true if opt_args[:is_temporary] && @info_values[\"jdbc_database_id\"].downcase == \"oracle\"\r\n\r\n db_column_size_limits = @db_column_size_limits\r\n using_oracle = @using_oracle\r\n kapp_fields = @kapp_fields\r\n kapp_unlimited_column_name = {}\r\n kapp_limited_column_name = {}\r\n kapp_fields.each do |field|\r\n kapp_unlimited_column_name[field] = get_field_column_name(:unlimited => true, :field => field)\r\n kapp_limited_column_name[field] = get_field_column_name(:unlimited => false, :field => field)\r\n end\r\n puts \"Creating Kapp table (#{db_table_name}) if it doesn't exist.\"\r\n @db.transaction(:retry_on => [Sequel::SerializationFailure]) do\r\n @db.create_table?(db_table_name.to_sym, db_options) do\r\n String :c_id, :primary_key => true, :size => db_column_size_limits[:id]\r\n String :c_originId, :size => db_column_size_limits[:originId]\r\n String :c_parentId, :size => db_column_size_limits[:parentId]\r\n String :c_formSlug, :size => db_column_size_limits[:formSlug]\r\n String :c_anonymous, :size => db_column_size_limits[:anonymous]\r\n column :c_closedAt, (using_oracle ? 'timestamp with time zone' : DateTime)\r\n String :c_closedBy, :size => db_column_size_limits[:closedBy], :unicode => true\r\n String :c_coreState, :size => db_column_size_limits[:coreState]\r\n column :c_createdAt, (using_oracle ? 'timestamp with time zone' : DateTime)\r\n String :c_createdBy, :size => db_column_size_limits[:createdBy], :unicode => true\r\n column :c_deletedAt, (using_oracle ? 'timestamp with time zone' : DateTime)\r\n column :c_submittedAt, (using_oracle ? 'timestamp with time zone' : DateTime)\r\n String :c_submittedBy, :size => db_column_size_limits[:submittedBy], :unicode => true\r\n column :c_updatedAt, (using_oracle ? 'timestamp with time zone' : DateTime)\r\n String :c_updatedBy, :size => db_column_size_limits[:updatedBy], :unicode => true\r\n String :c_type, :size => db_column_size_limits[:type]\r\n kapp_fields.each do |field|\r\n if using_oracle then\r\n send(\"column\", kapp_unlimited_column_name[field], \"CLOB\")\r\n else\r\n send(\"String\", kapp_unlimited_column_name[field], :text => true, :unicode => true)\r\n end\r\n send(\"String\",kapp_limited_column_name[field], :unicode => true, :size => db_column_size_limits[:formField])\r\n end\r\n end\r\n end\r\n end", "def init_conn_table(table_name)\n # Create destination table\n sql = <<SQL\ndrop table if exists #{table_name};\ncreate table #{table_name} (\n day timestamp, \n id int,\n value int,\n dw_created timestamp,\n dw_updated timestamp\n );\nSQL\n conn.run(sql)\n return conn\n end", "def tables\n [\n ]\n end", "def destroy\n @config_table = ConfigTable.find(params[:id])\n @config_table.destroy\n respond_to do |format|\n @config_tables = ConfigTable.all\n format.js\n end\n end", "def schema_params\n params.require(:schema).permit(:name, :database_type, :username, :password, :changelogfile, :changelogtable, :host, :port, :application_id, :environment_id)\n end", "def create_tables_in_test_schema\n ActiveRecord::Schema.define(version: 1) do\n ActiveRecord::Base.connection.ddl_batch do\n create_table :all_types, id: { limit: 8 } do |t|\n t.column :col_string, :string\n t.column :col_int64, :bigint\n t.column :col_float64, :float\n t.column :col_numeric, :numeric\n t.column :col_bool, :boolean\n t.column :col_bytes, :binary\n t.column :col_date, :date\n t.column :col_timestamp, :datetime\n t.column :col_json, :json\n\n t.column :col_array_string, :string, array: true\n t.column :col_array_int64, :bigint, array: true\n t.column :col_array_float64, :float, array: true\n t.column :col_array_numeric, :numeric, array: true\n t.column :col_array_bool, :boolean, array: true\n t.column :col_array_bytes, :binary, array: true\n t.column :col_array_date, :date, array: true\n t.column :col_array_timestamp, :datetime, array: true\n t.column :col_array_json, :json, array: true\n end\n\n create_table :firms do |t|\n t.string :name\n t.integer :rating\n t.string :description\n t.references :account\n end\n\n create_table :customers do |t|\n t.string :name\n end\n\n create_table :accounts do |t|\n t.references :customer, index: false\n t.references :firm, index: false\n t.string :name\n t.integer :credit_limit\n t.integer :transactions_count\n end\n\n create_table :transactions do |t|\n t.float :amount\n t.references :account, index: false\n end\n\n create_table :departments do |t|\n t.string :name\n t.references :resource, polymorphic: true, index: { name: \"index_departments_on_resource\" }\n end\n\n create_table :member_types do |t|\n t.string :name\n end\n\n create_table :members do |t|\n t.string :name\n t.references :member_type, index: false\n t.references :admittable, polymorphic: true, index: false\n end\n\n create_table :memberships do |t|\n t.datetime :joined_on\n t.references :club, index: false\n t.references :member, index: false\n t.boolean :favourite\n end\n\n create_table :clubs do |t|\n t.string :name\n end\n\n create_table :authors do |t|\n t.string :name, null: false\n t.date :registered_date\n t.references :organization, index: false\n end\n\n create_table :posts do |t|\n t.string :title\n t.string :content\n t.references :author\n t.integer :comments_count\n t.date :post_date\n t.time :published_time\n end\n\n create_table :comments do |t|\n t.string :comment\n t.references :post, index: false, foreign_key: true\n end\n\n create_table :addresses do |t|\n t.string :line1\n t.string :postal_code\n t.string :city\n t.references :author, index: false\n end\n\n create_table :organizations do |t|\n t.string :name\n t.datetime :last_updated, allow_commit_timestamp: true\n end\n\n create_table :singers, id: false do |t|\n t.primary_key :singerid\n t.column :first_name, :string, limit: 200\n t.string :last_name\n t.integer :tracks_count\n t.integer :lock_version\n t.virtual :full_name, type: :string, as: \"COALESCE(first_name || ' ', '') || last_name\", stored: true\n end\n\n create_table :albums, id: false do |t|\n t.interleave_in :singers\n t.primary_key :albumid\n # `singerid` is part of the primary key in the table definition, but it is not visible to ActiveRecord as part of\n # the primary key, to prevent ActiveRecord from considering this to be an entity with a composite primary key.\n t.parent_key :singerid\n t.string :title\n t.integer :lock_version\n end\n\n create_table :tracks, id: false do |t|\n # `:cascade` causes all tracks that belong to an album to automatically be deleted when an album is deleted.\n t.interleave_in :albums, :cascade\n t.primary_key :trackid\n t.parent_key :singerid\n t.parent_key :albumid\n t.string :title\n t.numeric :duration\n t.integer :lock_version\n end\n\n add_index :tracks, [:singerid, :albumid, :title], interleave_in: :albums, null_filtered: true, unique: false\n\n end\n end\nend", "def create_table(name, min_players = 2, blinds = 1)\n\t\traise \"No player yet!\" unless @player_id\n\t\t@table_response = new_sub(@discovery['tables']['url'],\n\t\t\t\t@discovery['tables']['capability'])\n\t\t@create_table_channel = new_channel(@discovery['create_table']['url'],\n\t\t\t\t@discovery['create_table']['capability'])\n\t\t@table_response.last = (Time.now.to_i * 1000) - 5\n\t\t@table_response.add_listener('table_response') {|m| my_table_created(m)}\n\t\t@table_response.start_listening\n\t\t@create_table_channel.publish({'name' => name, 'id' => @player_id,\n\t\t\t'min_players' => min_players, 'blinds' => blinds}.to_json)\n\tend", "def create_table\n if TinyDyno::Adapter.table_exists?(table_name: self.table_name)\n return true\n end\n raise InvalidTableDefinition.new \"#{ self.name } has invalid table configuration\" unless model_table_config_is_valid?\n TinyDyno::Adapter.create_table(create_table_request)\n end", "def create\n @registration_table = RegistrationTable.new(registration_table_params)\n\n unless event_host?\n @registration_table.user_event_id = user_event_id == current_user.registration_for_event(event).id\n end\n\n # TODO: - is there a better way to do this?\n seat = RegistrationTable.where(table_id: @table.id).maximum('seat')\n if seat.nil?\n seat = 1\n else\n seat += 1\n end\n @registration_table.seat = seat\n\n respond_to do |format|\n if @registration_table.save\n if @registration_table.payment_ok?\n format.html { redirect_to [@event], notice: 'Table was successfully added.' }\n else\n format.html do\n redirect_to new_event_session_table_registration_table_table_payment_path(@event, @session, @table,\n @registration_table)\n end\n end\n else\n format.html { render :new }\n format.json { render json: @registration_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @web_table = Web::Table.new(web_table_params)\n\n respond_to do |format|\n if @web_table.save\n format.html { redirect_to @web_table, notice: 'Table was successfully created.' }\n format.json { render :show, status: :created, location: @web_table }\n else\n format.html { render :new }\n format.json { render json: @web_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n if @configtable.update_attributes(params[:configtable])\n format.html { redirect_to @configtable, notice: 'Configtable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @table_def = TableDef.new(table_def_params)\n authorize! :create, @table_def\n\n respond_to do |format|\n if @table_def.save\n format.html { redirect_to @table_def, notice: t('.create_ok') }\n format.json { render action: 'show', status: :created, location: @table_def }\n else\n format.html { render action: 'new' }\n format.json { render json: @table_def.errors, status: :unprocessable_entity }\n end\n end\n end", "def createTables \n createUserTable\n createTaskTable\n createProjectTable\n end", "def create\n @app_config = AppConfig.new(params[:app_config])\n\n respond_to do |format|\n if @app_config.save\n format.html { redirect_to @app_config, notice: 'App config was successfully created.' }\n format.json { render json: @app_config, status: :created, location: @app_config }\n else\n format.html { render action: \"new\" }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @data_table = DataTable.new(data_table_params)\n\n respond_to do |format|\n if @data_table.save\n format.html { redirect_to @data_table, notice: 'Data table was successfully created.' }\n format.json { render :show, status: :created, location: @data_table }\n else\n format.html { render :new }\n format.json { render json: @data_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @table = @restaurant.tables.build(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to restaurant_tables_path(@restaurant), notice: 'Table was successfully created.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def insert_table dataset_id, new_table_gapi\n execute { service.insert_table @project, dataset_id, new_table_gapi }\n end", "def api_v11_clusters_cluster_name_services_service_name_commands_sqoop_create_database_tables_post_with_http_info(service_name, cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster_name_services_service_name_commands_sqoop_create_database_tables_post ...\"\n end\n \n # verify the required parameter 'service_name' is set\n fail \"Missing the required parameter 'service_name' when calling api_v11_clusters_cluster_name_services_service_name_commands_sqoop_create_database_tables_post\" if service_name.nil?\n \n # verify the required parameter 'cluster_name' is set\n fail \"Missing the required parameter 'cluster_name' when calling api_v11_clusters_cluster_name_services_service_name_commands_sqoop_create_database_tables_post\" if cluster_name.nil?\n \n # resource path\n path = \"/api/v11/clusters/{clusterName}/services/{serviceName}/commands/sqoopCreateDatabaseTables\".sub('{format}','json').sub('{' + 'serviceName' + '}', service_name.to_s).sub('{' + 'clusterName' + '}', cluster_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\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 = []\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(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_clusters_cluster_name_services_service_name_commands_sqoop_create_database_tables_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def config_params\n params.require(:config).permit(:key, :value)\n end", "def table_params\n params.require(:table).permit(:restaurant_id, :number_table)\n end", "def create\n @registration_table = RegistrationTable.new(registration_table_params)\n\n respond_to do |format|\n if @registration_table.save\n format.html { redirect_to @registration_table, notice: 'Registration table was successfully created.' }\n format.json { render :show, status: :created, location: @registration_table }\n else\n format.html { render :new }\n format.json { render json: @registration_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @app_config = AppConfig.new(app_config_params)\n\n respond_to do |format|\n if @app_config.save\n format.html { redirect_to @app_config, notice: 'App config was successfully created.' }\n format.json { render :show, status: :created, location: @app_config }\n else\n format.html { render :new }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize config\n connect config\n create_table_if_not_exists!\n end", "def create\n @talk_table = TalkTable.new(talk_table_params)\n\n respond_to do |format|\n if @talk_table.save\n format.html { redirect_to @talk_table, notice: 'Talk table was successfully created.' }\n format.json { render :show, status: :created, location: @talk_table }\n else\n format.html { render :new }\n format.json { render json: @talk_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @table = Table.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to @table, notice: 'Mesa criada com sucesso.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_table(table_name, options = {})\n headers = {\n Azure::Storage::Common::HeaderConstants::ACCEPT => Serialization.get_accept_string(options[:accept]),\n }\n headers[Azure::Storage::Common::HeaderConstants::PREFER] = options[:prefer] unless options[:prefer].nil?\n body = Serialization.hash_to_json(\"TableName\" => table_name)\n\n call(:post, collection_uri(new_query(options)), body, headers, options)\n nil\n end", "def table_params\n params.require(:table).permit(:name, :seats)\n end", "def create_table(name, min_players = 2, blinds = 1)\n\t\traise \"No player yet!\" unless @player_id\n\t\t@table_response = new_sub(@discovery['tables'])\n\t\t@create_table_channel = new_channel(@discovery['create_table'])\n\t\t@table_response.last = ((Time.now.to_i - 5) * 1000 * 1000)\n\t\t@table_response.add_listener('message', 'table_response') {|m|\n begin\n my_table_created(m.content)\n rescue\n puts \"Error with my table created: #{$!.inspect}\"\n end\n }\n\t\t@table_response.start_listening\n\t\t@create_table_channel.publish({'name' => name, 'id' => @player_id,\n\t\t\t'min_players' => min_players, 'blinds' => blinds}.to_json)\n\tend", "def post_table_params\n params.require(:post_table).permit(:title, :content)\n end", "def tabla_params\n params.require(:tabla).permit(:tabla, :padre_id, :padre_class, :archivo, :orden, :archivos, :imagenes)\n end", "def create\n if current_user.restaurant_ids.include?(params[:restaurant_id].to_i)\n # find new table number\n table_index = 1\n tables = Table.where(restaurant_id: params[:restaurant_id])\n if !tables.nil? && tables.count > 0\n tables.each do |table|\n table_index = table.table_number + 1 if table.table_number >= table_index\n end \n end\n\n @table = Table.new(restaurant: Restaurant.find(params[:restaurant_id]), table_number: table_index)\n\n if @table.save\n render json: @table, status: :created, location: nil\n else\n render json: @table.errors, status: :unprocessable_entity\n end\n else\n render json: { error: \"can't add tables to restaurants you don't own\" }, status: :unprocessable_entity\n end\n end", "def create\n @connection_table_column = ConnectionTableColumn.new(connection_table_column_params)\n\n respond_to do |format|\n if @connection_table_column.save\n format.html { redirect_to @connection_table_column, notice: 'Connection table column was successfully created.' }\n format.json { render action: 'show', status: :created, location: @connection_table_column }\n else\n format.html { render action: 'new' }\n format.json { render json: @connection_table_column.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def schema_params\n params.require(:schema).permit(:name, :task_id, :default, :max_slaves)\n end", "def create_kitten(db,data)\n db.execute(\".mode csv\n.import ? pods\", [data])\nend", "def create\n @user = User.find(current_user.id)\n @game = Game.find(params[:table][:game_id])\n @table = @game.tables.new(table_params)\n\n respond_to do |format|\n if @table.save\n format.html { redirect_to event_path(@table.event_id), notice: 'Table was successfully created.' }\n format.json { render :show, status: :created, location: @table }\n else\n format.html { render :new }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @config = Config.new(config_params)\n\n respond_to do |format|\n if @config.save\n format.html { redirect_to @config, notice: \"Config was successfully created.\" }\n format.json { render :show, status: :created, location: @config }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @config.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.70930433", "0.6398037", "0.6278978", "0.5945581", "0.59276456", "0.57608575", "0.56159836", "0.56158894", "0.5548966", "0.55304754", "0.5507424", "0.5471813", "0.5457857", "0.54023975", "0.5391116", "0.5391028", "0.53833014", "0.5376602", "0.5322543", "0.53113735", "0.52766263", "0.52745", "0.5267551", "0.5266772", "0.52607274", "0.52525264", "0.5226997", "0.5224012", "0.5199269", "0.5199137", "0.519826", "0.519745", "0.5182625", "0.5167349", "0.5163942", "0.51541704", "0.51447207", "0.51314896", "0.5109582", "0.5107115", "0.5107072", "0.5093609", "0.5091003", "0.50875944", "0.50711596", "0.5069316", "0.50668037", "0.5054539", "0.50490135", "0.5038707", "0.5038456", "0.5032063", "0.50256", "0.50255185", "0.50206804", "0.5012964", "0.5011832", "0.5008033", "0.5006669", "0.49942175", "0.49868852", "0.4970574", "0.4968413", "0.4963101", "0.49614933", "0.4960086", "0.4959173", "0.49537605", "0.49426442", "0.4931316", "0.49253017", "0.49252346", "0.4921934", "0.4919103", "0.49190965", "0.49103242", "0.49091685", "0.4896524", "0.48940182", "0.48773256", "0.48728427", "0.48679256", "0.4863319", "0.4852934", "0.48445037", "0.48436496", "0.48432383", "0.48389795", "0.48389155", "0.48381352", "0.48379847", "0.48368868", "0.48333693", "0.4830836", "0.48182625", "0.48177776", "0.4817333", "0.48059", "0.48057196", "0.4804454" ]
0.53820014
17
PUT /config_tables/1 PUT /config_tables/1.json
def update @config_table = ConfigTable.find(params[:id]) @config_table.year = params[:config_table][:id] respond_to do |format| if @config_table.update_attributes(params[:config_table]) format.html { redirect_to config_tables_path, :notice => 'Config table was successfully updated.' } else format.html { render :action => "edit" } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n if @configtable.update_attributes(params[:configtable])\n format.html { redirect_to @configtable, notice: 'Configtable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @configtable = Configtable.new(params[:configtable])\n\n respond_to do |format|\n if @configtable.save\n format.html { redirect_to @configtable, notice: 'Configtable was successfully created.' }\n format.json { render json: @configtable, status: :created, location: @configtable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @configtable.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @schema_table.update(schema_table_params)\n format.html { redirect_to @schema_table, notice: 'Schema table was successfully updated.' }\n format.json { render :show, status: :ok, location: @schema_table }\n else\n format.html { render :edit }\n format.json { render json: @schema_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @configtable = Configtable.find(params[:id])\n @configtable.destroy\n\n respond_to do |format|\n format.html { redirect_to configtables_url }\n format.json { head :no_content }\n end\n end", "def create_tog_config_table\n ActiveRecord::Base.connection.create_table \"config\", :force => false do |t|\n t.string :key, :limit => 255, :default => \"\", :null => false\n t.string :value\n t.timestamps\n end\n ActiveRecord::Base.connection.add_index \"config\", [\"key\"], :name => \"key\", :unique => true\n end", "def set_schema_table\n @schema_table = SchemaTable.find(params[:id])\n end", "def update\n respond_to do |format|\n if @table.update(table_params)\n format.html { redirect_to admin_index_tables_path, notice: 'Table was successfully updated.' }\n format.json { render :show, status: :ok, location: @table }\n else\n format.html { render :edit }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @identity_table = IdentityTable.find(params[:id])\n\n respond_to do |format|\n if @identity_table.update_attributes(params[:identity_table])\n format.html { redirect_to identity_tables_path, alert: '表名更新成功!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @identity_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @table = Table.find(params[:id])\n\n respond_to do |format|\n if @table.update_attributes(params[:table].permit(:name, :notes, :x, :y, :table_type, :guest_ids => []))\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @table_def.update(table_def_params)\n format.html { redirect_to @table_def, notice: t('.update_ok') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @table_def.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def show\n @configtable = Configtable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @configtable }\n end\n end", "def put_table(name, table_id, table, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_table_with_http_info(name, table_id, table, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_table_with_http_info(name, table_id, table, opts)\n else\n raise\n end\n return data\n end", "def set_table_setting\n @table_setting = TableSetting.find(params[:id])\n end", "def update\n @custom_table = CustomTable.find(params[:id])\n\n respond_to do |format|\n if @custom_table.update_attributes(params[:custom_table])\n format.html { redirect_to @custom_table, notice: 'Custom table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def schema_table_params\n params.require(:schema_table).permit(:name, :schema_version_id)\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def update\n @table = Table.find(params[:id])\n\n respond_to do |format|\n if @table.update_attributes(params[:table])\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @table.update(table_params)\n format.html { redirect_to events_path, notice: 'Table was successfully updated.' }\n format.json { render :show, status: :ok, location: @table }\n else\n format.html { render :edit }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_audit_tables\n tables.each(&:update_audit_table)\n end", "def set_table\n @table = Table.find(params[:id])\n end", "def set_service_table\n @service_table = ServiceTable.find(params[:id])\n end", "def insertindb \n file = File.open(ENV[\"HOME\"]+ \"/config.rb\") \n content = file.read\n stmt = @con.prepare \"UPDATE #{$SVCTABLE} SET config=? WHERE svcid='#{$SVCID}';\"\n rs = stmt.execute content \n stmt.close\n end", "def update!(**args)\n @oracle_tables = args[:oracle_tables] if args.key?(:oracle_tables)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update\n @dummy_table = DummyTable.find(params[:id])\n\n respond_to do |format|\n if @dummy_table.update_attributes(params[:dummy_table])\n format.html { redirect_to @dummy_table, notice: 'Dummy table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dummy_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @config_table = ConfigTable.new(params[:config_table])\n @config_table.year = params[:config_table][:id] \n respond_to do |format|\n if @config_table.save\n format.html { redirect_to config_tables_path, :notice => 'Config table was successfully created.' }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def table(name, &block)\n if block\n @config[:tables][name] = Docile.dsl_eval(Watchy::Config::TableConfigBuilder.new, &block).build\n else\n @config[:tables][name] = {\n rules: {\n insert: [],\n update: [],\n delete: [ Watchy::DefaultDeleteRule.new ]\n },\n versioning_enabled: true\n }\n end\n\n if @config[:tables][name][:rules][:delete].empty?\n @config[:tables][name][:rules][:delete] << Watchy::DefaultDeleteRule.new\n end\n end", "def save_with_http_info(table_name, app_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CloudTableApi#save ...\"\n end\n \n # verify the required parameter 'table_name' is set\n fail \"Missing the required parameter 'table_name' when calling save\" if table_name.nil?\n \n # verify the required parameter 'app_id' is set\n fail \"Missing the required parameter 'app_id' when calling save\" if app_id.nil?\n \n # verify the required parameter 'body' is set\n fail \"Missing the required parameter 'body' when calling save\" if body.nil?\n \n # resource path\n local_var_path = \"app/{app_id}/{table_name}\".sub('{format}','json').sub('{' + 'table_name' + '}', table_name.to_s).sub('{' + 'app_id' + '}', app_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CloudTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudTableApi#save\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def api_table\n controller_name\n end", "def update\n respond_to do |format|\n if @table_setting.update(table_setting_params)\n format.html { redirect_to @table_setting, notice: 'Table setting was successfully updated.' }\n format.json { render :show, status: :ok, location: @table_setting }\n else\n format.html { render :edit }\n format.json { render json: @table_setting.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @table.update(table_params)\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { render :show, status: :ok, location: @table }\n else\n format.html { render :edit }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def configure(conf)\n super\n @tables = Hash.new\n end", "def update\n respond_to do |format|\n if @table.update(table_params)\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @schema = args[:schema] if args.key?(:schema)\n @table = args[:table] if args.key?(:table)\n end", "def update!(**args)\n @schema = args[:schema] if args.key?(:schema)\n @table = args[:table] if args.key?(:table)\n end", "def destroy\n @config_table = ConfigTable.find(params[:id])\n @config_table.destroy\n respond_to do |format|\n @config_tables = ConfigTable.all\n format.js\n end\n end", "def update\n @ip_table = IpTable.find(params[:id])\n\n respond_to do |format|\n if @ip_table.update_attributes(params[:ip_table])\n format.html { redirect_to @ip_table, notice: 'Ip table was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ip_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tables\n @old_ethereum_address = @user_extended_details.ethereum_address\n\n @user_extended_details.ethereum_address = @encrypted_ethereum_address\n @user_extended_details.save!\n\n update_user_md5_extended_details\n\n @edit_kyc_request.status = GlobalConstant::EditKycRequest.processed_status\n @edit_kyc_request.save!\n\n @user_kyc_detail.last_acted_by = @admin_id\n @user_kyc_detail.last_acted_timestamp = Time.now.to_i\n @user_kyc_detail.save!\n\n log_activity\n\n success\n end", "def put(id, 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 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 # Check if the ID exists\n db = MIDB::API::Dbengine.new(@engine.config, @db)\n dbc = db.connect()\n dbq = db.query(dbc, \"SELECT * FROM #{self.get_structure.values[0].split('/')[0]} WHERE id=#{id};\")\n unless db.length(dbq) > 0\n resp = MIDB::Interface::Server.json_error(404, \"ID not found\")\n @engine.http_status = 404\n bad_request = true\n end\n \n # Update the values if we have a good request\n unless bad_request\n fields = Hash.new\n inserts = Hash.new\n where_clause = Hash.new\n main_table = self.get_structure.values[0].split('/')[0]\n where_clause[main_table] = \"id=#{id}\"\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 where_clause[table] = \"#{matching_field}=(SELECT #{row_field} FROM #{main_table} WHERE #{where_clause[main_table]});\"\n end\n end\n queries = []\n updates = Hash.new\n # Turn it into a hash\n inserts.each do |table, values|\n updates[table] ||= Hash.new\n updates[table] = Hash[fields[table].zip(inserts[table])]\n query = \"UPDATE #{table} SET \"\n updates[table].each do |f, v|\n query = query + \"#{f}=#{v} \"\n end\n queries.push query + \"WHERE #{where_clause[table]};\"\n end\n # Run the queries\n results = []\n queries.each do |q|\n results.push db.query(dbc, q)\n end\n @engine.http_status = \"200 OK\"\n resp = {status: \"200 OK\"}\n end\n return resp\n end", "def set_table_def\n @table_def = TableDef.find(params[:id])\n end", "def set_table_acl(table_name, options={})\n query = { 'comp' => 'acl'}\n query['timeout'] = options[:timeout].to_s if options[:timeout]\n\n uri = generate_uri(table_name, query)\n body = nil\n body = Table::Serialization.signed_identifiers_to_xml options[:signed_identifiers] if options[:signed_identifiers] && options[:signed_identifiers].length > 0\n\n call(:put, uri, body, {'x-ms-version' => '2012-02-12'}, options)\n nil\n end", "def table_params\n params.require(:table).permit(:name)\n end", "def table_params\n params.require(:table).permit!\n end", "def update\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n if @app_config.update_attributes(params[:app_config])\n format.html { redirect_to @app_config, notice: 'App config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task_table.update(task_table_params)\n format.html { redirect_to @task_table, notice: 'Task table was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_table }\n else\n format.html { render :edit }\n format.json { render json: @task_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @object_table.update(object_table_params)\n format.html { redirect_to @object_table, notice: 'Object table was successfully updated.' }\n format.json { render :show, status: :ok, location: @object_table }\n else\n format.html { render :edit }\n format.json { render json: @object_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @force = args[:force] if args.key?(:force)\n @table_uri = args[:table_uri] if args.key?(:table_uri)\n end", "def put_table_with_http_info(name, table_id, table, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.put_table ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PdfApi.put_table\"\n end\n # verify the required parameter 'table_id' is set\n if @api_client.config.client_side_validation && table_id.nil?\n fail ArgumentError, \"Missing the required parameter 'table_id' when calling PdfApi.put_table\"\n end\n # verify the required parameter 'table' is set\n if @api_client.config.client_side_validation && table.nil?\n fail ArgumentError, \"Missing the required parameter 'table' when calling PdfApi.put_table\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/tables/{tableId}\".sub('{' + 'name' + '}', name.to_s).sub('{' + 'tableId' + '}', table_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].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 # Fix header in file\n post_body = nil\n\n # http body (model)\n post_body = @api_client.object_to_http_body(table)\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AsposeResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#put_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n authorize! :update, @concerto_config\n params[:concerto_config].each do |k,v|\n ConcertoConfig.set(k,v) #only set this if the config already exists\n end\n redirect_to :action => :index\n end", "def update\n respond_to do |format|\n if @table.update(table_params)\n format.html { redirect_to @table, notice: 'Mesa atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @table }\n else\n format.html { render :edit }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @existing_schema = args[:existing_schema] if args.key?(:existing_schema)\n @new_schema = args[:new_schema] if args.key?(:new_schema)\n @sampled_data_locations = args[:sampled_data_locations] if args.key?(:sampled_data_locations)\n @schema_change = args[:schema_change] if args.key?(:schema_change)\n @table = args[:table] if args.key?(:table)\n end", "def table_params\n params.require(:table).permit(:name, :statu)\n end", "def update\n respond_to do |format|\n if @bs_table.update(bs_table_params)\n format.html { redirect_to @bs_table, notice: 'Bs table was successfully updated.' }\n format.json { render :show, status: :ok, location: @bs_table }\n else\n format.html { render :edit }\n format.json { render json: @bs_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @postgresql_tables = args[:postgresql_tables] if args.key?(:postgresql_tables)\n @schema = args[:schema] if args.key?(:schema)\n end", "def requires_table_name_for_update\n true\n end", "def index\n @schema_tables = SchemaTable.all\n end", "def set_object_table\n @object_table = ObjectTable.find(params[:id])\n end", "def table_params\n params.require(:table).permit(:table_number, :company_id)\n end", "def table_params\n params.require(:table).permit(:name, :owner, :game_id, :user_id, :event_id)\n end", "def update\n\n @table = Table.find(params[:id])\n\n @table.number = params[:table][:number].to_i\n @table.size = params[:table][:size].to_i\n @table.status = params[:table][:status].to_i\n @table.name = params[:table][:name]\n\n begin\n Table.transaction do\n @table.save!\n flash[:notice] = '修改餐桌成功'\n\n\n end\n redirect_to :action => :show, :id => @table.id #, :port => PORT\n rescue\n error_message = ''\n @table.errors[:error_message].each do |error|\n if error == @table.errors[:error_message].last\n error_message += error.to_s\n else\n error_message += error.to_s + ','\n end\n end\n flash[:msg] = error_message\n @table.errors.clear\n render :edit and return\n\n end\n\n end", "def update_table_with_http_info(table_id, app_id, qb_realm_hostname, authorization, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TablesApi.update_table ...'\n end\n # verify the required parameter 'table_id' is set\n if @api_client.config.client_side_validation && table_id.nil?\n fail ArgumentError, \"Missing the required parameter 'table_id' when calling TablesApi.update_table\"\n end\n # verify the required parameter 'app_id' is set\n if @api_client.config.client_side_validation && app_id.nil?\n fail ArgumentError, \"Missing the required parameter 'app_id' when calling TablesApi.update_table\"\n end\n # verify the required parameter 'qb_realm_hostname' is set\n if @api_client.config.client_side_validation && qb_realm_hostname.nil?\n fail ArgumentError, \"Missing the required parameter 'qb_realm_hostname' when calling TablesApi.update_table\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling TablesApi.update_table\"\n end\n # resource path\n local_var_path = '/tables/{tableId}'.sub('{' + 'tableId' + '}', table_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'appId'] = app_id\n\n # header parameters\n header_params = {}\n header_params[:'QB-Realm-Hostname'] = qb_realm_hostname\n header_params[:'Authorization'] = authorization\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'generated'])\n auth_names = []\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 => 'Hash<String, Object>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TablesApi#update_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_swot_table\n @swot_table = SwotTable.find(params[:id])\n end", "def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end", "def migrate_route_tables(dir)\n puts Colors.blue(\"Migrating route tables to #{dir}\")\n Hash[EC2::named_route_tables.map do |name, route_table|\n puts \"Migrating route table #{name}\"\n\n cumulus_rt = RouteTableConfig.new(name).populate!(route_table)\n\n json = JSON.pretty_generate(cumulus_rt.to_hash)\n File.open(\"#{dir}/#{name}.json\", \"w\") { |f| f.write(json) }\n\n [route_table.route_table_id, name]\n end]\n end", "def table_params\n params.require(:table).permit(\n :name\n )\n end", "def patch_table dataset_id, table_id, patched_table_gapi\n patch_with_backoff = false\n options = {}\n if patched_table_gapi.etag\n options[:header] = { \"If-Match\" => patched_table_gapi.etag }\n # The patch with etag operation is considered idempotent\n patch_with_backoff = true\n end\n execute backoff: patch_with_backoff do\n service.patch_table @project, dataset_id, table_id, patched_table_gapi, options: options\n end\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def vendor_table\n update unless @vendor_table\n @vendor_table\n end", "def update\n respond_to do |format|\n if @service_table.update(service_table_params)\n format.html { redirect_to service_tables_path, notice: 'Đã cập nhật thành công!' }\n format.json { render :show, status: :ok, location: @service_table }\n else\n format.html { render :edit }\n format.json { render json: @service_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_table_acl(table_name, options = {})\n query = new_query(options)\n query[Azure::Storage::Common::QueryStringConstants::COMP] = Azure::Storage::Common::QueryStringConstants::ACL\n\n uri = generate_uri(table_name, query)\n body = nil\n body = Serialization.signed_identifiers_to_xml options[:signed_identifiers] if options[:signed_identifiers] && options[:signed_identifiers].length > 0\n\n call(:put, uri, body, { \"x-ms-version\" => \"2012-02-12\" }, options)\n nil\n end", "def prefix_table\n update unless @prefix_table\n @prefix_table\n end", "def set_bs_table\n @bs_table = BsTable.find(params[:id])\n end", "def update\n respond_to do |format|\n if @swot_table.update(swot_table_params)\n format.html { redirect_to @swot_table, notice: 'Swot table was successfully updated.' }\n format.json { render :show, status: :ok, location: @swot_table }\n else\n format.html { render :edit }\n format.json { render json: @swot_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_device_table_mapping\n @device_table_mapping = DeviceTableMapping.find(params[:id])\n end", "def update_array_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/arrays/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def free\n @tables = Table.find_all_by_status('free')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tables }\n end\n\n def busy\n @tables = Table.find_all_by_status('busy')\n respond_to do |format|\n format.html\n format.json { render :json => @tables }\n end\n end\n\n def dirty\n @tables = Table.find_all_by_status('dirty')\n respond_to do |format|\n format.html\n format.json { render :json => @tables }\n end\n end\n\n #modify status of table's id\n def change_free_status\n @table = Table.find(params[:id])\n if @table.status == 'free'\n @table.status = 'busy'\n @table.save\n end\n respond_to do |format|\n format.html\n format.json { render :json => @table }\n end\n end\n\n def change_busy_status\n @table = Table.find(params[:id])\n if @table.status == 'busy'\n @table.status = 'dirty'\n @table.save\n end\n respond_to do |format|\n format.html\n format.json { render :json => @table }\n end\n end\n\n def change_dirty_status\n @table = Table.find(params[:id])\n if @table.status == 'dirty'\n @table.status = 'free'\n @table.save\n end\n respond_to do |format|\n format.html\n format.json { render :json => @table }\n end\n end\n\n end", "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @tables = args[:tables] if args.key?(:tables)\n end", "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @tables = args[:tables] if args.key?(:tables)\n end", "def update\n respond_to do |format|\n if @data_table.update(data_table_params)\n format.html { redirect_to @data_table, notice: 'Data table was successfully updated.' }\n format.json { render :show, status: :ok, location: @data_table }\n else\n format.html { render :edit }\n format.json { render json: @data_table.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @configtable = Configtable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @configtable }\n end\n end", "def table table_id, app_profile_id: nil\n ensure_service!\n Client::Table.new(\n @service.client,\n table_path(table_id),\n app_profile_id: app_profile_id\n )\n end", "def table_params\n params.require(:table).permit(:name, :is_outdoor, :location)\n end", "def update\n respond_to do |format|\n if @app_config.update(app_config_params)\n format.html { redirect_to @app_config, notice: 'App config was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_config }\n else\n format.html { render :edit }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(table,cond,op)\n connection.update(path(table),cond,op)\n end", "def settable_cmd(tablename, content)\n @datafiles[tablename] = DataFile.new\n @datafiles[tablename].insert_cmd(content, 1)\n end", "def update_db(struct)\n File.write('app/services/db/database.json', JSON.generate(struct))\n end", "def connect(table_name)\n conf = HBaseConfiguration.create\n admin = HBaseAdmin.new(conf)\n admin.tableExists('enron2')\n tables = admin.listTables\n table = HTable.new(conf, 'enron2')\nend", "def set_task_table\n @task_table = TaskTable.find(params[:id])\n end", "def update\n @sysconfig = Sysconfig.find(params[:id])\n\n respond_to do |format|\n if @sysconfig.update_attributes(params[:sysconfig])\n format.html { redirect_to @sysconfig, notice: 'Sysconfig was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sysconfig.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_table_spec 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_update_table_spec_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AutoML::V1beta1::TableSpec.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def bs_table_params\n params.require(:bs_table).permit(:bs_system_id, :logical, :physical, :remark, :bs_db_id, :db_name, :schema, :delflag)\n end", "def update_data(table_name, column_values, criteria, config={})\n body = column_values.merge!({:ZOHO_CRITERIA => criteria})\n body = body.merge!(config) if config.any?\n\n options = {\n :query => {\n 'ZOHO_ACTION' => 'UPDATE',\n },\n :body => body\n }\n\n send_request get_uri(table_name), 'post', options\n end" ]
[ "0.67758095", "0.59656894", "0.5854576", "0.5742794", "0.5655333", "0.56162375", "0.5560202", "0.5522187", "0.5515743", "0.5417478", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.53967446", "0.5388336", "0.53850406", "0.53725445", "0.536419", "0.53598374", "0.5359684", "0.5345165", "0.5332463", "0.53097904", "0.5287337", "0.52612877", "0.5250081", "0.52391", "0.5234647", "0.52334356", "0.52261305", "0.52084786", "0.5207084", "0.5197359", "0.51950115", "0.51887983", "0.51785076", "0.5176647", "0.5176647", "0.5174941", "0.5156184", "0.51487076", "0.5122909", "0.5120794", "0.50901365", "0.5089288", "0.5085383", "0.5080827", "0.5056373", "0.5050841", "0.50492555", "0.50427806", "0.504099", "0.5029323", "0.50192565", "0.5017531", "0.5004235", "0.49941704", "0.498084", "0.49748856", "0.49699208", "0.49696085", "0.49696037", "0.49690875", "0.49608767", "0.4954427", "0.49514836", "0.49443084", "0.49431753", "0.4941002", "0.4932449", "0.4920891", "0.4909692", "0.4909477", "0.4906893", "0.48952726", "0.4883683", "0.48773253", "0.48728767", "0.48683384", "0.48623157", "0.48623157", "0.48597333", "0.48553717", "0.48483616", "0.48475266", "0.48430607", "0.48323843", "0.48294505", "0.48292923", "0.48292166", "0.48267865", "0.4825168", "0.4825142", "0.48202005", "0.4814012" ]
0.5810449
3
DELETE /config_tables/1 DELETE /config_tables/1.json
def destroy @config_table = ConfigTable.find(params[:id]) @config_table.destroy respond_to do |format| @config_tables = ConfigTable.all format.js end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @configtable = Configtable.find(params[:id])\n @configtable.destroy\n\n respond_to do |format|\n format.html { redirect_to configtables_url }\n format.json { head :no_content }\n end\n end", "def delete_table(table_id); delete(\"tables/#{table_id}\"); nil; end", "def delete_test_tables\n DynamoTable.delete_test_tables(CHEF_ENV)\n render_head_204\n end", "def single_delete(table_name, id=nil)\n status = true\n begin\n sql = \"DELETE FROM #{table_name}\"\n sql << \"WHERE id = #{id}\" unless id.nil?\n @mysql_client.query(sql)\n rescue\n status = false\n end\n return status\n end", "def delete()\n db = PG connect( {dbname: 'bounty_hunter',\n host: 'localhost'\n })\n sql = 'DELETE from bounty_hunter'\n db.prepare('delete_one', sql)\n db.exec_prepared('delete_one', value)\n db.close()\nend", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def delete\n\n DB.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\")\n end", "def delete\n CONNECTION.execute(\"DELETE FROM '#{tablename}' WHERE id = ?;\", @id)\n \"Deleted.\"\n end", "def destroy\n @schema_table.destroy\n respond_to do |format|\n format.html { redirect_to schema_tables_url, notice: 'Schema table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to app_configs_url }\n format.json { head :no_content }\n end\n end", "def delete\n # Read the configuration from DynamoDB \n db = AWS::DynamoDB.new\n table = db.tables[CONFIGS[:db][:party_configs][:table]]\n table.hash_key = [:party_id, :string]\n item = table.items[id]\n return false if (!item.exists?)\n item.delete\n return true\n end", "def destroy\n @my_configuration = MyConfiguration.find(params[:id])\n @my_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to my_configurations_url }\n format.json { head :no_content }\n end\n end", "def delete_data(table_name, criteria, config={})\n body = {'ZOHO_CRITERIA' => criteria}\n body = body.merge!(config) if config.present?\n\n options = {\n :query => {\n 'ZOHO_ACTION' => 'DELETE',\n },\n :body => body\n }\n\n send_request get_uri(table_name), 'post', options\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @config.destroy\n respond_to do |format|\n format.html { redirect_to configs_url, notice: \"Config was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy(table)\n end", "def destroy(table, id)\n self.post(\"/#{table}/destroy/#{id}\")\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def test_delete1()\n key = \"_Delete1\"\n c = Scalaroid::JSONConnection.new(url = Scalaroid::DEFAULT_URL)\n rdht = Scalaroid::ReplicatedDHT.new(conn = c)\n sc = Scalaroid::TransactionSingleOp.new(conn = c)\n\n (0..($_TEST_DATA.length - 1)).each do |i|\n sc.write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n\n # now try to delete the data:\n (0..($_TEST_DATA.length - 1)).each do |i|\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(4, ok)\n results = rdht.get_last_delete_result()\n assert_equal(4, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(0, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n\n # try again (should be successful with 0 deletes)\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(0, ok)\n results = rdht.get_last_delete_result()\n assert_equal(0, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(4, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n end\n\n c.close()\n end", "def delete_from_table(db,id,table_name)\n db.execute(\"DELETE FROM #{table_name} WHERE #{table_name}.id =#{id}\")\nend", "def delete_table(database_name, table_name)\n @glue_client.delete_table(database_name: database_name, name: table_name)\n rescue Aws::Glue::Errors::ServiceError => e\n @logger.error(\"Glue could not delete job: \\n#{e.message}\")\n end", "def destroy\n @config_file = ConfigFile.find(params[:id])\n @config_file.destroy\n\n respond_to do |format|\n format.html { redirect_to config_files_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dummy_table = DummyTable.find(params[:id])\n @dummy_table.destroy\n\n respond_to do |format|\n format.html { redirect_to dummy_tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @conf = Conf.find(params[:id])\n @conf.destroy\n\n respond_to do |format|\n format.html { redirect_to confs_url }\n format.json { head :no_content }\n end\n end", "def delete_database(table_name)\n table_details = @client.describe_table(table_name: table_name).table\n wait_until_table_available(table_name) if table_details.table_status != 'ACTIVE'\n @client.delete_table(table_name: table_name)\n rescue Aws::DynamoDB::Errors::ResourceNotFoundException\n puts 'Table did not exist. Nothing to delete.'\n end", "def destroy\n @configuration_key.destroy\n respond_to do |format|\n format.html { redirect_to configuration_keys_url }\n format.json { head :no_content }\n end\n end", "def delete_table dataset_id, table_id\n execute { service.delete_table @project, dataset_id, table_id }\n end", "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to admin_index_tables_path, notice: 'Table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n # Figure out the table's name from the object we're calling the method on.\n table_name = self.class.to_s.pluralize.underscore\n CONNECTION.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\") # need to see if this one will work, if not look up.\n end", "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @table_def.destroy\n respond_to do |format|\n format.html { redirect_to table_defs_url, status: 303 }\n format.json { head :no_content }\n end\n end", "def destroy\n @global_config = AppConfig.find(params[:id])\n @global_config.destroy\n\n respond_to do |format|\n format.html { redirect_to global_configs_url }\n format.json { head :no_content }\n end\n end", "def 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 delete_table(name, columns = nil)\n begin\n request = Request::TableRequest.new(name)\n Response::TableResponse.new(rest_delete(request.delete(columns)))\n rescue => e\n if e.to_s.include?(\"TableNotFoundException\")\n raise TableNotFoundError, \"Table '#{name}' not exists\"\n elsif e.to_s.include?(\"TableNotDisabledException\")\n raise TableNotDisabledError, \"Table '#{name}' not disabled\"\n end\n end\n end", "def delete_table\n TinyDyno::Adapter.delete_table(table_name: self.table_name)\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()\n sql = \"DELETE FROM transactions\n WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\nend", "def delete\n table = self.class.to_s.pluralize.underscore\n\n DATABASE.execute(\"DELETE FROM #{table} WHERE id = #{@id};\")\n end", "def delete_table(table_name)\n data.delete(table_name)\n end", "def delete\n Iterable.request(conf, base_path).delete\n end", "def delete(table)\n # Encode destination table name\n url = \"https://www.googleapis.com/bigquery/v1/tables/#{CGI.escape(table)}\"\n\n # Send table deletetion request\n result = BQ.request(:delete, {}.to_json, url)\n\n return result\n end", "def destroy\n @<%= singular_table_name %>.destroy\n respond_to do |format|\n format.html { redirect_to <%= table_name %>_url }\n format.json { head :no_content }\n end", "def destroy\n @app_config.destroy\n respond_to do |format|\n format.html { redirect_to app_configs_url, notice: 'App config was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n table_name = self.class.to_s.pluralize.underscore\n DATABASE.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\")\n end", "def testDelete1()\n key = \"_Delete1\"\n c = Scalaris::JSONConnection.new(url = Scalaris::DEFAULT_URL)\n rdht = Scalaris::ReplicatedDHT.new(conn = c)\n sc = Scalaris::TransactionSingleOp.new(conn = c)\n\n (0..($_TEST_DATA.length - 1)).each do |i|\n sc.write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n \n # now try to delete the data:\n (0..($_TEST_DATA.length - 1)).each do |i|\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(4, ok)\n results = rdht.get_last_delete_result()\n assert_equal(4, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(0, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n \n # try again (should be successful with 0 deletes)\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(0, ok)\n results = rdht.get_last_delete_result()\n assert_equal(0, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(4, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n end\n \n c.close()\n end", "def destroy\n @custom_table = CustomTable.find(params[:id])\n @custom_table.destroy\n\n respond_to do |format|\n format.html { redirect_to custom_tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end", "def drop\n\t\tActiveRecord::Base.connection.execute \"SET AUTOCOMMIT=0\"\n\t\tActiveRecord::Base.connection.execute \"SET FOREIGN_KEY_CHECKS=0\"\n\n self.change_schema_to 'information_schema';\n @result[:deleted] = []\n \n if request[:remove_all]\n #remove all tables\n @tables = ActiveRecord::Base.connection.select_all \"select TABLE_NAME table_name from `TABLES` where `TABLE_SCHEMA`='#{request[:db_name]}'\"\n self.change_schema_to request[:db_name];\n \n @tables.each do |table|\n ActiveRecord::Base.connection.execute \"drop table `#{table[\"table_name\"]}`\"\n @result[:deleted].push table[\"table_name\"];\n end\n else\n self.change_schema_to request[:db_name];\n ActiveRecord::Base.connection.execute \"drop table `#{request[:key]}`\";\n @result[:deleted].push request[:key];\n end\n \n self.change_schema_to 'information_schema';\n @result[:type] = 'table'\n render json: @result\n end", "def testDelete1()\n key = \"_Delete1\"\n c = Scalaris::JSONConnection.new(url = Scalaris::DEFAULT_URL)\n rdht = Scalaris::ReplicatedDHT.new(conn = c)\n sc = Scalaris::TransactionSingleOp.new(conn = c)\n rt = Scalaris::RoutingTable.new\n r = rt.get_replication_factor\n \n (0..($_TEST_DATA.length - 1)).each do |i|\n sc.write(@testTime.to_s + key + i.to_s, $_TEST_DATA[i])\n end\n \n # now try to delete the data:\n (0..($_TEST_DATA.length - 1)).each do |i|\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(r, ok)\n results = rdht.get_last_delete_result()\n assert_equal(r, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(0, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n \n # try again (should be successful with 0 deletes)\n ok = rdht.delete(@testTime.to_s + key + i.to_s)\n assert_equal(0, ok)\n results = rdht.get_last_delete_result()\n assert_equal(0, results.ok)\n assert_equal(0, results.locks_set)\n assert_equal(r, results.undefined)\n _checkKeyDoesNotExist(@testTime.to_s + key + i.to_s)\n end\n \n c.close()\n end", "def destroy\n conf.delete 'api'\n end", "def delete_row(row_id); rest_delete(\"#{link('rows')}/#{row_id}\"); nil; end", "def delete\n %w[\n hathi_isbn\n hathi_issn\n hathi_lccn\n hathi_oclc\n hathi_title\n hathi_enumc\n hathi_pubdate\n hathi_publisher\n hathi_sudoc\n hathi_related\n hathi_gd\n ].each do |tablename|\n sql = \"DELETE FROM #{tablename}\";\n q = @conn.prepare(sql);\n puts sql;\n q.execute();\n end\nend", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def delete_one()\n #connect to db\n db = PG.connect({ dbname: \"bounty_hunters\", host: \"localhost\" })\n #write SQL statement string\n sql = \"DELETE FROM bounties WHERE id = $1\"\n #make values array - in this case it only needs one value\n values = [@id]\n #prepare statemnt\n db.prepare(\"delete_one\", sql)\n #run prepared statement\n db.exec_prepared(\"delete_one\", values)\n #close db link\n db.close()\n end", "def destroy\n @testdb = Testdb.find(params[:id])\n @testdb.destroy\n\n respond_to do |format|\n format.html { redirect_to testdbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n begin\n @tconfiguration = Tconfiguration.find(params[:id])\n \n @tconfiguration.destroy\n rescue ActiveRecord::RecordNotFound\n end\n\n respond_to do |format|\n format.html { redirect_to(tconfigurations_url) }\n format.xml { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete(id)\n @conn.exec(\"DELETE FROM students WHERE id = '#{id}';\");\nend", "def delete\n table_name = self.class.to_s.pluralize.underscore\n DATABASE.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\")\n end", "def destroy\n @table_alias = TableAlias.find(params[:id])\n @table_alias.destroy\n\n respond_to do |format|\n format.html { redirect_to table_aliases_url }\n format.json { head :ok }\n end\n end", "def destroy\n @configuracion.destroy\n respond_to do |format|\n format.html { redirect_to configuraciones_url }\n format.json { head :no_content }\n end\n end", "def delete\n \n end", "def destroy\n @wp_dyna_config = WpDynaConfig.find(params[:id])\n @wp_dyna_config.destroy\n\n respond_to do |format|\n format.html { redirect_to wp_dyna_configs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n conf.delete 'dashboard'\n end", "def delete_db_post account\n # Tell the user\n puts \"> Tar bort kontot från databasen\".green\n\n # Connect to the database\n conn = PG.connect( dbname: DB_DATABASE_NAME, user: DB_USER, password: DB_PASSWORD )\n\n # Delete the account\n res = conn.exec \"DELETE FROM #{DB_ACCOUNTS_TABLE} WHERE userid = '#{account['userid']}'\" unless $simulate\n\n # Close the connection\n conn.close\nend", "def destroy\n @conf.destroy\n respond_to do |format|\n format.html { redirect_to confs_url, notice: 'Conf was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conf.destroy\n respond_to do |format|\n format.html { redirect_to confs_url, notice: 'Conf was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(id)\n @conn.exec(\"DELETE FROM students WHERE id = '#{id}';\")\nend", "def delete\n\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 @sm_backend_config = SmBackendConfig.find(params[:id])\n @sm_backend_config.destroy\n\n respond_to do |format|\n format.html { redirect_to sm_backend_configs_url }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @configuration_set = ConfigurationSet.find(params[:id])\n @configuration_set.destroy\n\n respond_to do |format|\n format.html { redirect_to configuration_sets_url }\n format.json { head :no_content }\n end\n end", "def delete_at index\n @config.delete_at index\n end", "def delete table, keys = [], transaction_id: nil\n commit transaction_id: transaction_id do |c|\n c.delete table, keys\n end\n end", "def delete\n \n end", "def delete_db_post\n # Tell the user\n puts \"> Tar bort aliaset från databasen\".green\n\n # Connect to the database\n conn = PG.connect( dbname: DB_DATABASE_NAME, user: DB_USER, password: DB_PASSWORD )\n\n # Delete the account\n res = conn.exec \"DELETE FROM #{DB_ALIAS_TABLE} WHERE address = '#{$alias}' AND userid = '#{$email}'\" unless $simulate\n\n # Close the connection\n conn.close\nend", "def destroy\n @sysconfig = Sysconfig.find(params[:id])\n @sysconfig.destroy\n\n respond_to do |format|\n format.html { redirect_to sysconfigs_url }\n format.json { head :no_content }\n end\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(app_configs_url) }\n format.xml { head :ok }\n end\n end", "def delete table\n table = table.to_sym\n @lookup = @lookup.reject { |k, v| k == table }\n @schema = @schema.reject { |k, v| k == table }\n nil\n end", "def destroy\n @api_config.destroy\n respond_to do |format|\n format.html { redirect_to api_configs_url, notice: 'Api config was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def delete(id)\n @conn.exec(\"DELETE FROM students WHERE id = '#{id}'\")\nend", "def destroy\n @tournament_config.destroy\n respond_to do |format|\n format.html { redirect_to tournament_configs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ip_table = IpTable.find(params[:id])\n @ip_table.destroy\n\n respond_to do |format|\n format.html { redirect_to ip_tables_url }\n format.json { head :ok }\n end\n end", "def destroy\n @task_config.destroy\n respond_to do |format|\n format.html { flash[:danger] = I18n.t('task_config.destroy.notice.success'); redirect_to task_configs_url }\n format.json { head :no_content }\n end\n end", "def delete(query)\n\n connect if @persevere.nil?\n\n deleted = 0\n\n if ! query.is_a?(DataMapper::Query)\n resources = [query].flatten\n else\n resources = read_many(query)\n end\n\n resources.each do |resource|\n tblname = resource.model.storage_name\n id = resource.attributes(:field)['id']\n \n # Retrieve the ID from persever if the resource doesn't have an ID field\n if id.nil?\n query = Persevere.enhance(resource.query)\n path = \"/#{tblname}/#{query.to_json_query_filter}[={'id':id}]\"\n response = @persevere.retrieve(path, {})\n id = JSON.parse(response.body)[0]['id'].match(/(\\w+\\/)*(\\d+)/)[2]\n end\n \n path = \"/#{tblname}/#{id}\"\n # path = \"/#{tblname}/#{resource.key.first}\"\n \n DataMapper.logger.debug(\"(Delete) PATH/QUERY: #{path}\")\n\n result = @persevere.delete(path)\n\n if result.code == \"204\" # ok\n deleted += 1\n end\n end\n return deleted\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def delete\n sql = \"DELETE FROM albums WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\nend", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @cdn_config = CdnConfig.find(params[:id])\n @cdn_config.destroy\n\n respond_to do |format|\n format.html { redirect_to cdn_configs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @system_config.destroy\n respond_to do |format|\n format.html { redirect_to system_configs_url }\n format.json { head :no_content }\n end\n end", "def delete_table_with_http_info(table_name, app_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CloudTableApi#delete_table ...\"\n end\n \n # verify the required parameter 'table_name' is set\n fail \"Missing the required parameter 'table_name' when calling delete_table\" if table_name.nil?\n \n # verify the required parameter 'app_id' is set\n fail \"Missing the required parameter 'app_id' when calling delete_table\" if app_id.nil?\n \n # verify the required parameter 'body' is set\n fail \"Missing the required parameter 'body' when calling delete_table\" if body.nil?\n \n # resource path\n local_var_path = \"app/{app_id}/{table_name}\".sub('{format}','json').sub('{' + 'table_name' + '}', table_name.to_s).sub('{' + 'app_id' + '}', app_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CloudTable')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudTableApi#delete_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @config_log.destroy\n respond_to do |format|\n format.html { redirect_to config_logs_url, notice: 'Config log was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_table instance_id, table_id\n tables.delete_table name: table_path(instance_id, table_id)\n end", "def delete\n sql = \"DELETE FROM tickets WHERE id = $1\"\n values = [id]\n SqlRunner.run(sql, values)\n end" ]
[ "0.75203604", "0.673097", "0.665987", "0.64183164", "0.6256067", "0.6233195", "0.6229347", "0.6221335", "0.62204826", "0.6214161", "0.62134194", "0.61959535", "0.61733806", "0.6151156", "0.6141388", "0.61253417", "0.6114254", "0.6112506", "0.60952306", "0.60897404", "0.60889363", "0.6088776", "0.6063911", "0.6056506", "0.60560685", "0.60395914", "0.60382926", "0.6034064", "0.6033756", "0.60289323", "0.60289323", "0.60252327", "0.6020056", "0.60165536", "0.6012454", "0.60077477", "0.6004187", "0.60037893", "0.6001237", "0.59945375", "0.59944767", "0.59921396", "0.5990453", "0.59904265", "0.59846807", "0.5983932", "0.5977388", "0.59709483", "0.59709483", "0.59709483", "0.5961811", "0.5953035", "0.5952628", "0.59509736", "0.59490824", "0.5949016", "0.59360105", "0.5933727", "0.5933237", "0.59255075", "0.5916944", "0.5916344", "0.59134907", "0.59067327", "0.5904456", "0.5904437", "0.589937", "0.5899326", "0.58970916", "0.58970916", "0.58969927", "0.58962053", "0.58868635", "0.58772695", "0.5876735", "0.58751625", "0.58750176", "0.58743745", "0.5872453", "0.58722514", "0.5868744", "0.58681434", "0.5866162", "0.58619004", "0.5860868", "0.585998", "0.58558995", "0.58524764", "0.5852436", "0.5851048", "0.5850934", "0.5845177", "0.58432126", "0.5842708", "0.58425593", "0.5840707", "0.5840277", "0.58393216", "0.58354515", "0.5834793" ]
0.6572693
3
Add an action that gives us the user's status
def check_status user = current_user respond_to do |format| format.html format.json { render json: { status: user.order_status } } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_callout\n\t\t\tbegin\n\t\t\t\t@user = User.find params[:id]\n\t\t\t\t@status = params[:status]\n\t\t\trescue \n\t\t\t\tredirect_to '/'\n\t\t\tend\n\t\tend", "def user_action=(value)\n @user_action = value\n end", "def status(text)\n @user.enqueue_message('_' + text + '_')\n end", "def status(text)\n @user.enqueue_message('_' + text + '_')\n end", "def handle(status, user)\n end", "def check_user_background\n self.status = Status::PENDING_ADMIN_ACTION if offender && offender.new_user?\n end", "def update_status\n do_load_resource\n do_authorize_instance\n\n update_status_user_check\n end", "def update_status\n User.find(current_user.id).update_attributes(new_user: false) if current_user && params[:ajax]\n\n render text: 'ok'\n end", "def status\n end", "def status\n end", "def status\n end", "def status\n end", "def on_change_status(&block)\n self.actions[:change_status] = block\n end", "def statuses; end", "def status_update\n current_user.gold = params[:gold]\n current_user.lives = params[:lives]\n current_user.income = params[:income]\n\n # Send out the updated user list to all clients\n update_user_list(current_game.id)\n end", "def status_getuser!()\n @status = TAC_PLUS_AUTHEN_STATUS_GETUSER\n end", "def approve!\n self.update_attribute(:status, ConfigCenter::User::APPROVED)\n end", "def ping\n current_user.update_column(:last_action_at, Time.now) if current_user\n render :nothing => true, :status => 204\n end", "def toggle_status\n desired_status = @user.published? ? User::STATUS[:unpublished] : User::STATUS[:published]\n @page = params[:page] || 1\n if @user.toggle_status\n redirect_to(users_url(:page => @page), :notice => t(\"users.#{desired_status}_successfully\"))\n else\n redirect_to(users_url(:page => @page), :alert => t(\"users.cannot_#{desired_status}\"))\n end\n end", "def append_git_user_action(user, action)\n \"\\n#{action} by #{user['login']} - #{user['html_url']}\"\n end", "def toggled_status\n @users = User.find(params[:id])\n @users.status = !@users.status?\n @users.update_column(:status,@users.status)\n @users.update_column(:updated_at,Time.zone.now)\n # Update Nominee status as well \n @nominee = Nominee.find_by_user_id(params[:id])\n unless @nominee.nil?\n @nominee.status = @users.status\n @nominee.updated_at = Time.zone.now\n @nominee.save\n end\n redirect_to :back\n UserMailer.user_status_mail(@users).deliver \n end", "def update_user_status\n @user = User.find params[:id]\n @user.update(user_status: params[:status])\n end", "def user_action\n return @user_action\n end", "def handle_action(username, actiontype)\n \n end", "def update\n @user = current_user\n @user.status = params[:user][:status]\n @user.save\n redirect_to :root\n end", "def check_status\n if @current_user.blank?\n render :text => {\"continue\" => false}.to_json\n return\n end\n \n render :text => @current_user.real_time_notifications.to_json\n end", "def status_for(user)\n return \"NEW!\" if user.last_logout.nil?\n\n\n if created_at > user.last_logout\n \"NEW!\"\n elsif updated > user.last_logout\n \"UPDATED!\"\n else\n \"\"\n end\n end", "def status\n render json: { message: 'valid user'}, status: :accepted\n end", "def status(user)\n if rest_day # Rest day if flag is set\n :rest\n else \n cw = CompletedWorkout.get(user, self)\n if cw\n if cw.mgr_override # Excused if there is a manager override\n :excused \n else\n :completed # Completed normally without mgr override\n end\n else\n if active?(user)\n :open\n else\n :expired\n end\n end\n end\n \n end", "def update_status!(user, status, in_reply_to_status_id = nil)\n self.twitagent(user.token, user.secret).update_status!(status, in_reply_to_status_id)\n\tend", "def postStatusUpdateClick( sender )\n \n\t # Post a status update to the user's feedm via the Graph API, and display an alert view \n\t # with the results or an error.\n\n\t message = \"Updating #{@loggedInUser[ :first_name ]}'s status at #{NSDate.date}\"\n\t params = { :message => message }\n\t \n\t # use the \"startWith\" helper static on FBRequest to both create and start a request, with\n\t # a specified completion handler.\n\t err = Pointer.new(:object)\n\t FBRequest.startWithGraphPath( \"me/feed\",\n\t\t parameters:params,\n\t\t HTTPMethod: \"POST\",\n\t\t completionHandler: lambda { |connection, result, error|\n\t\t\tself.showAlert( message, result: result, error: error )\n\t\t\t@buttonPostStatus.enabled = true\n\t\t})\n\t \n\t @buttonPostStatus.enabled = false\n\tend", "def status(*) end", "def status\n \"approved\"\n end", "def status\n respond_to do |format|\n quest = Quest.find(params[:id])\n quest.update(:status=> params[:string])\n #update status in the db when it is done\n if (params[:string] == \"Done\")\n quest.is_completed=true\n quest.completed_at = DateTime.now.utc\n quest.save\n user = User.find(@current_user.id)\n user.points += 10\n user.save\n if @current_user.gender\n gender = 'Male'\n else\n gender = 'Female'\n end\n User.publish_event :gender, ({:gender => gender})\n\n userQuest = UsersQuest.find_by_quest_id(quest.id)\n if @current_user.id==userQuest.assignor_id && @current_user.id==userQuest.assignee_id\n User.publish_event :quest_type, ({:self_assigned => 'Self Assigned'})\n else\n User.publish_event :quest_type, ({:self_assigned => 'Not Self Assigned'})\n end\n\n notif_user = User.find_by(:id => userQuest.assignor_id)\n notif = Notification.create(:user_id => userQuest.assignor_id,\n :title => \"#{@current_user.first_name} #{@current_user.last_name} has completed your assigned quest: #{quest.title}\",\n :url => quest_path(userQuest.quest_id))\n @options = {:channel => \"/notifs/#{userQuest.assignor_id}\",\n :message => notif.title,\n :count => \"#{User.unread_notifications_count notif_user}\", :redirect => quest_path(params[:id]),\n :url => quest_path(userQuest.quest_id),\n :id => notif.id}\n\n end\n format.html {redirect_to quest_path(params[:id])}\n format.js\n end\n end", "def create\n @status = Status.new(params[:status])\n\n respond_to do |format|\n if @status.save \n @user = @status.user\n @user.view_status = @status.view_status\n @user.save\n \n if @user.view_status == 'live' && @user.teacher?\n Innsights.report(\"Maestro aceptado\", :user => current_user, :group => current_network).run\n elsif @user.teacher?\n Innsights.report(\"Maestro suspendido\", :user => current_user, :group => current_network).run\n end\n\n format.html { redirect_to :back, notice: 'El status ha sido agregado correctamente al usuario' }\n format.json { render json: :back , status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "def change_status_to_in_progress\n user = User.find_by(id: params[:user_id])\n user.send_issue_assigned_email\n issue = Issue.find_by(id: params[:id])\n expert = User.find_by(id: params[:expert_id])\n issue.update_attributes(status: \"inprogress\", expert_id: expert.id)\n flash[:success] = \"Issue status changed to in progress! Assigned to #{expert.username}\"\n redirect_to issues_path\n end", "def update_status(status, options={})\n send_audit(:kind => :status, :text => status, :category => options[:category])\n end", "def create\n @status = current_user.statuses.new(params[:status])\n\n respond_to do |format|\n if @status.save\n current_user.create_activity(@status, 'created')\n format.html { redirect_to profile_path(current_user), notice: 'Status was successfully created.' }\n format.json { render json: @status, status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_action\n @user_action = UserAction.find(params[:id])\n end", "def set_user_action\n @user_action = UserAction.find(params[:id])\n end", "def status\n @review = Review.find(params[:id])\n @review.update_attribute(:approved_id, current_user.id)\n flash[:info] = \"Review is approved!\"\n redirect_to admin_home_path\n end", "def status_follow!()\n @status = TAC_PLUS_AUTHEN_STATUS_FOLLOW\n end", "def alert_user?\n # check the three necessary conditions\n # in order of increasing cost\n self.enabled? && have_statuses_changed?\n end", "def set_status(project, type, user, mode)\n group = project.send(type == :member ? :user_group : :admin_group)\n set_status_add(project, type, user, group) if mode == :add\n set_status_remove(project, type, user, group) if mode == :remove\n end", "def set_status(user_id, status)\r\n user_id = user_id.to_s\r\n @context.validate_identifier(:user_id, user_id)\r\n @context.call_myspace_api(:status_put, :user_id => user_id, :body => {:status => status})\r\n end", "def user_status(user)\n return \"Admin\" if user.admin?\n return \"Exception\" if user.override_access?\n end", "def notify_user_actions\n @attributes[:notify_user_actions]\n end", "def update_status\n case @part.status\n when 'Unstarted'\n @part.status = 'Started'\n @part.user = current_user\n @part.bitbucket.post_user(current_user.email) if @part.name == 'Prototype'\n @part.create_activity key: 'part.started', owner: current_user\n @part.start_rep_points\n when 'Started'\n @part.status = 'Finished'\n @part.create_activity key: 'part.finished', owner: current_user\n when 'Finished' \n @part.status = 'In Review'\n @part.create_activity key: 'part.in_review', owner: current_user\n when 'In Review'\n @part.status = 'Accepted'\n @part.accepted_rep_points\n @part.create_activity key: 'part.accepted', owner: current_user\n end\n @part.save\n redirect_to :back\n end", "def user_onoff_flag\n @requested_user = User.find_by_account_number(params[:id])\n if @requested_user.is_active?\n @requested_user.update_columns(:is_active => false)\n redirect_to admin_index_path, :flash => {:notice => \"Requested user(#{@requested_user.first_name} #{@requested_user.last_name}) account successfully de-activated.\"}\n else\n @requested_user.update_columns(:is_active => true)\n redirect_to admin_index_path, :flash => {:notice => \"Requested user(#{@requested_user.first_name} #{@requested_user.last_name}) account successfully activated.\"}\n end\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def handle_action\n timeline_item = find_timeline_item(self.glass_item_id)\n\n # TODO: Should we uniq these? When glass doesn't have connection, it will queue up\n # actions, so users might press the same one multiple times.\n user_actions.uniq.each do |user_action|\n type = user_action[:type] == \"CUSTOM\" ? user_action[:payload] : user_action[:type]\n json_to_return = self.reply_request_hash ? self.reply_request_hash : self.params\n timeline_item.send(\"handles_#{type.downcase}\", json_to_return)\n end if user_actions\n end", "def status(unique_id)\n requires!(@options, :advanced_login, :advanced_password)\n\n post = {}\n add_advanced_user(post)\n add_standard_parameters('queryDR', post, unique_id)\n\n commit(post)\n end", "def toggle_notification\n if params[:status].present?\n @user.update(notification_status: params[:status])\n if @user.errors.any?\n render json: user.errors.messages, status: 400\n else\n render json: { message: 'Notification status updated successfully!' }, status: 200\n end\n else\n render json: { message: 'Please set status' }, status: 400\n end\n end", "def user_status_icon\n case user_status\n when 'accepted'\n 'fa-check'\n when 'declined'\n 'fa-times'\n end\n end", "def set_status(user_id, status)\n user_id = user_id.to_s\n validate_identifier(:user_id, user_id)\n call_myspace_api(:status_put, :user_id => user_id, :body => {:status => status})\n end", "def status_follow!()\n @status = TAC_PLUS_ACCT_STATUS_FOLLOW\n end", "def user_actions(user)\n can_act_as_logged_in_user(user) unless Revs::Application.config.restricted_beta # also have logged in privileges if we are not in beta\n end", "def status=(new_status)\n payload = {\n 'user' => {\n 'content' => {\n 'status' => new_status.to_s.upcase,\n 'userRoles' => @json['user']['content']['userRoles']\n },\n 'links' => {\n 'self' => uri\n }\n }\n }\n\n @json = client.post(\"/gdc/projects/#{project_id}/users\", payload)\n end", "def toggle_user_name_header status, action_name\n case status\n when 'sold', 'invoiced';\n 'Buyer Name'\n when 'wanted';\n action_name == 'seller_wanted' ? 'Seller Name' : 'Buyer Name'\n else\n 'Seller Name'\n end\n end", "def set_status\n @id=params[:id]\n @client = User.find(@id)\n @status = @client.status\n if @status == true\n @client.update_attributes(status: 'false')\n flash[:success] = \"Status upadated In-Active\"\n else\n @client.update_attributes(status: 'true')\n flash[:success] = \"Status updated Active\"\n end\n redirect_to clients_path\n end", "def generate_add_status(user)\n PurchaseRequisition::LEVEL_ONE\n end", "def on_status(&f)\n @on_status = f\n end", "def change_user_status(email, type)\n endpoint = \"/api/#{@version}/user/change-status/\"\n custom_params = {\n 'email' => email,\n 'type' => type\n }\n make_post_request(endpoint, custom_params)\n end", "def pending!\n self.update_attribute(:status, ConfigCenter::User::PENDING)\n end", "def status\n if params[:deactivate_id]\n User.update(params[:deactivate_id],:status=>\"Deactive\")\n @user=User.all\n render :update do |page|\n page.replace_html 'userlist', :partial => 'home/status_change', :object=>@user, :layout => false\n end\n else\n User.update(params[:activate_id],:status=>\"Active\")\n @user=User.all\n render :update do |page|\n page.replace_html 'userlist', :partial => 'home/status_change', :object=>@user, :layout => false\n end\n end\n end", "def show_review_action(movie, status)\n\tcheck = user_already_reviewed(movie)\n\tif check == -1\n\t @show_review_action = true \n\telsif (check == 0 && status == true) || (check == 1 && status == false) || check == 2\n\t @show_review_action = false \n\telse\n\t @show_review_action = true\n\tend\n\nend", "def status\n Twitter::Status.new(@status.merge(:user => self.to_hash.delete(:status))) if @status\n end", "def notification_status\n consumer = User.find_by_id(params[:user_id])\n if consumer.update_attributes(:notification_status => params[:status],\n :call_time => params[:call_time])\n render :json=> {:success=>true}, :status=>200\n else\n render :json=> {:success=>false, :message=>\"Something wrong\"}, :status=>401\n end\n end", "def update_status\n @completed_status = !completed_status\n puts \"#{description} Completed\"\n end", "def check_status(payload)\n # get login of user who set status\n sender = payload.sender.login\n commit = payload.commit.sha\n\n # determine if user who set status is in whitelist\n if WHITELIST.include? sender\n puts \"Status set by trusted user \\\\o/\"\n else\n puts \"WARNING! Status set by untrusted user #{sender}\"\n puts \"Status changed for commit #{commit}\"\n end\nend", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def check_user_status\n user = current_user\n if user && user.status != 2\n redirect_to signupcode_settings_path\n end\n end", "def show\n case @user.action\n when \"CofA\"\n @action = \"Change Of Address\"\n when \"AR\"\n @action = \"Annual Report\"\n end\n end", "def activate_user(user)\n user.status_id=0\n user.save\n end", "def activate\n admin = Administrator.find_by_user_id(params[:id])\n admin.status = true\n admin.save\n @users = User.all\n render 'index'\n end", "def is_active(user)\n user.status_id != 0\n end", "def action\n value = data['action'].capitalize\n value == 'Created' ? 'Added' : value\n end" ]
[ "0.6770906", "0.67382973", "0.6667645", "0.6667645", "0.648531", "0.6409905", "0.6383007", "0.6300225", "0.6285226", "0.6285226", "0.6285226", "0.6285226", "0.6269964", "0.6262727", "0.6248893", "0.6241792", "0.6241005", "0.6235596", "0.6231385", "0.6216671", "0.61669743", "0.61637294", "0.6162288", "0.61544585", "0.6144539", "0.6136259", "0.613404", "0.6115996", "0.6106027", "0.6088874", "0.6086506", "0.60803455", "0.60770786", "0.6061537", "0.60606825", "0.60606134", "0.60580045", "0.60532635", "0.6041958", "0.6041958", "0.60299027", "0.60225075", "0.6013946", "0.6006436", "0.6000527", "0.5994374", "0.5991311", "0.5991023", "0.59740734", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.597407", "0.59735173", "0.59733474", "0.5970983", "0.59518343", "0.5946254", "0.59381443", "0.59275615", "0.59213626", "0.592058", "0.5919728", "0.5914354", "0.5898891", "0.5886077", "0.58767647", "0.5872648", "0.58568734", "0.5856772", "0.58498204", "0.5838188", "0.5837769", "0.58366525", "0.5835328", "0.58331996", "0.5829943", "0.58182836", "0.5811627", "0.58017206", "0.5788685" ]
0.5894418
84
Represent mine/notmine with a boolean, removing borders. '| |' > [false, true, false, true, false]
def as_booleans(row) fail ValueError unless row =~ /\A\|[ *]+\|\z/ row[1..-2].each_char.map { |c| c == '*' } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_boolean(col)\n _draw_head(col){\n @f.select(col.name, [\n ['(both)', ''],\n ['', 'false'],\n ['√', 'true']])\n }\n end", "def any_mines_detonated?\n @field.flatten.each do |cell|\n if cell.mine == true && cell.revealed?\n return true\n end\n end\n return false\n end", "def flag()\n\tb=[0,0.2,0.6]\n\ty=[0.8,0.8,0.2]\n\tr=[1,0,0]\n\t\n\t[[b,b,y,y,r,r],\n\t[b,b,y,y,r,r],\n\t[b,b,y,y,r,r],\n\t[b,b,y,y,r,r],\n\t[b,b,y,y,r,r]]\nend", "def to_s\n\t\ttoBoolean.map{|ligne| ligne.map{|pix| pix ? \".\":\" \"}.join}.join(\"\\n\")\n\tend", "def clone_symptoms_negate_bool_values\n new_symptoms = symptoms.to_a.deep_dup\n new_symptoms.each do |symptom|\n if symptom.type == 'BoolSymptom'\n symptom.negate\n else\n symptom.value = nil\n end\n end\n end", "def bool_sheet(bool)\n \nend", "def toBoolean\n\t\t# image --> [true,true,false,true]\t\t\t\t\ttrue = blanc\n\t\t#\t\t\t[false,true,false,false]\t\t\t\tfalse = noir\n\t\t# \t\t\t[true,true,true,true]\n\n\t\tgrid = []\n\t\timage = toGrey(@precision)\n\t\timage.each_pixel{|pixel| grid << !pixel.isBlack?}\n\t\tgrid.each_slice(image.columns).to_a\n\tend", "def flip_flop(trueValue, falseValue)\n map! do |truth|\n truth ? trueValue : falseValue\n end\n end", "def all_cells_cleared?\n @field.flatten.each do |cell|\n if cell.mine == false && !cell.revealed?\n return false\n end\n end\n return true\n end", "def flag(cell)\n announce_flag(cell)\n @minefield.flag(cell)\n end", "def render\n\t\tclear\n\t\toutput = \"MINESWEEPER\\n-----------\\n#{@flags_remaining} Flags Remaining\\n-----------\\n\"\n\t\t# This will iterate through each row\n\t\t# on the board.\n\t\t@board.each_with_index do |row, index|\n\t\t\tindex == 0 ? output << \"#{@size - index} | \" : output << \"#{@size - index} | \"\n\t\t\t# This will iterate over each square\n\t\t\trow.each do |square|\n\t\t\t\tif square.displayed == false && square.flag == false\n\t\t\t\t\toutput << \"O\"\n\t\t\t\telsif square.displayed == false && square.flag == true\n\t\t\t\t\toutput << \"F\".green\n\t\t\t\telsif square.displayed == true && square.mine == true && square.flag == true\n\t\t\t\t\toutput << \"F\".green\n\t\t\t\telsif square.displayed == true && square.mine == true\n\t\t\t\t\toutput << \"M\".red\n\t\t\t\telsif square.displayed == true\n\t\t\t\t\tif square.surrounding_mines == 0\n\t\t\t\t\t\toutput << \"_\"\n\t\t\t\t\telsif square.surrounding_mines == 1\n\t\t\t\t\t\toutput << \"1\".blue\n\t\t\t\t\telsif square.surrounding_mines == 2\n\t\t\t\t\t\toutput << \"2\".green\n\t\t\t\t\telsif square.surrounding_mines == 3\n\t\t\t\t\t\toutput << \"3\".red\n\t\t\t\t\telse\n\t\t\t\t\t\toutput << square.surrounding_mines.to_s.blue\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\toutput << \"\\n\"\n\t\tend\n\t\toutput << \" ___________\\n\"\n\t\toutput << \" 12345678910\\n\"\n\t\tprint output\n\tend", "def remove_border_mark(sexp)\n def sexp.inline_border?\n false\n end \n end", "def exercise_1111 (bool_values)\n end", "def booleans#:doc:\n barcode.encoding.split(//).map{|c| c == '1' }\n end", "def cheat_status\n if @revealed\n \" \"\n else\n @bombed ? \"X\" : \"*\"\n end\n end", "def shadow=(bool)\r\n @shadow = bool\r\n @outline = false if bool\r\n end", "def can_clear? ( x, y )\n !self[x][y].visible && \n !self[x][y].mine && \n self[x][y].nearby_mines == 0\n end", "def remove_flag(pos)\n tile = get_tile(pos)\n unless tile.revealed && !tile.flagged\n tile.flagged = false\n true \n else \n false \n end \n end", "def fix_boolean(node)\n node.children.map! do |child|\n if child.is_a?(AST::Node) &&\n child.type == :coerce_b\n child.children.first\n else\n child\n end\n end\n end", "def false_values\n [false, 'false', :false, :no, 'no', :undef, nil, :absent]\n end", "def reveal\n return false if @flagged || @revealed\n\n @revealed = true\n @is_mine ? nil : @num_neighbor_mines\n end", "def unflag(cell)\n announce_unflag(cell)\n @minefield.unflag(cell)\n end", "def flagged?\n @flagged\n end", "def flagged?\n @flagged\n end", "def contains_mine?(row, col)\n if @mine_field[:bombs][col][row] == true && @mine_field[:cover][col][row] == true\n return true\n else\n return false\n end\n end", "def outline=(bool)\r\n @outline = bool\r\n @shadow = false if bool\r\n end", "def collapse_boolean_literals(node)\n map node do |n|\n case n\n when And\n if n.children.any? do |c|\n False === c\n end\n puts \"Collapsing and(false)\"\n False.new\n else\n n.children.delete_if do |c|\n True === c\n end\n n\n end\n when Or\n if n.children.any? do |c|\n True === c\n end\n puts \"Collapsing or(true)\"\n True.new\n else\n n.children.delete_if do |c|\n False === c\n end\n n\n end\n else\n n\n end\n end\n end", "def create_boolean_collection(options) #:nodoc:\n options[:true] ||= ::Formtastic::I18n.t(:yes)\n options[:false] ||= ::Formtastic::I18n.t(:no)\n options[:value_as_class] = true unless options.key?(:value_as_class)\n\n [ [ options.delete(:true), true], [ options.delete(:false), false ] ]\n end", "def false_true\n alternatives false, true\n end", "def format_boolean_flag(flag, small=false)\n css_small = small == true ? 'boolean-flag-xs' : ''\n if flag == true\n return \"<div class='boolean-flag boolean-flag-true #{css_small}'>#{t('shared.common.yes')}</div>\".html_safe\n else\n return \"<div class='boolean-flag boolean-flag-false #{css_small}'>#{t('shared.common.no')}</div>\".html_safe\n end\n end", "def touched_a_mine?\n self.grid.flatten.any?{ |cell| cell.visible && cell.mine }\n end", "def clean_bool dirty_vals\n vals = []\n array = separate(dirty_vals)\n array.each { |dirty_val| \n val = get_b(dirty_val)\n #if val.nil? and (!dirty_val.nil? and dirty_val.strip!='')\n # val = dirty_val.match(/(not applicable|n\\/a|not available)/i).nil?\n #end\n vals << val\n }\n if vals.empty? or vals.uniq == [nil]\n return nil\n elsif vals.include? true\n return true\n else\n return false\n end\n end", "def boolean_check_mark(boolean)\n boolean ? content_tag(:span, image_tag('check.png', :alt => 'true', :size => '20x20')) : ''\n end", "def format_checkbox\n @opts[:no_hidden] = true unless @opts.has_key?(:no_hidden)\n super\n end", "def to_s(force_reveal: false)\n if revealed || force_reveal\n if mine?\n \"x\"\n else\n neighbors_count_to_s\n end\n else\n flagged ? \"?\" : \"*\"\n end\n end", "def to_s\n return '▣' if @flagged\n return '□' unless @revealed # an empty box\n return '◈' if @is_mine # an explosion symbol\n\n @num_neighbor_mines.zero? ? '.' : @num_neighbor_mines.to_s\n end", "def booleans cols\n decode_values :boolean, cols, true\n end", "def kill_cells_in_borders\n (0..@long - 1).each do |long|\n (0..@width - 1).each do |width|\n @matriz[long][width] = ' . ' if long.zero? || (long == @long - 1) || width.zero? || (width == @width - 1)\n end\n end\n end", "def boolean cols\n decode_values :boolean, cols\n end", "def any_mines_detonated?(state = false)\n state\n end", "def has_ships_still_floating?\n board.rows.flatten.include?(\"s\") \n end", "def set_dismantle_mask_flags(flag = true)\n return unless self.is_a?(RPG::Item) || self.is_a?(RPG::EquipItem)\n @dismantle_items.each do |obj| obj.mask = flag end\n end", "def notional?\n (notional)\n end", "def hidden_ships_grid \n @grid.map do |row|\n row.map do |ele|\n if ele == :S \n :N \n else\n ele\n end\n end\n end\n end", "def match_maker setter, *args\n pairs = []\n args.to_a.each_slice(2) do |a,b|\n a = !!a#this will set show if the value is true or false. Nil is false.\n b = !!b\n if a == b\n pairs << true\n else\n pairs << false\n end\n end\n if setter == true#reverse the result if true\n pairs.map! do |i|\n i = !i\n end\n end\n p pairs\nend", "def masking?; false; end", "def marked(row, pos)\n @board[row][pos] != 0\n end", "def to_a\n @data[0][3] = true if ! @is_activated && @data[0][3].class != FalseClass\n @data\n end", "def tpl_boolean; @original; end", "def blacks\n matrix.select { |piece| piece && piece.color == :b }\n end", "def controlled_square(_)\n ([-1, 1, 0].product([-1, 1, 0]) - [[0, 0]])\n .map { |mod| [@position[0] + mod[0], @position[1] + mod[1]] }\n .select { |i| Helper::in_border?(*i) }\n end", "def oblique?\n !right?\n end", "def hidden_ships_grid\n hidden = Array.new(@grid.size) { [] }\n (0...@grid.size).each do |i|\n (0...@grid.size).each do |j|\n chit = self[[i, j]] == :S ? :N : self[[i, j]]\n hidden[i] << chit\n end\n end\n hidden\n end", "def create_boolean_collection(options) #:nodoc:\n options[:true] ||= ::I18n.t(:yes)\n options[:false] ||= ::I18n.t(:no)\n options[:value_as_class] = true unless options.key?(:value_as_class)\n\n [ [ options.delete(:true), true], [ options.delete(:false), false ] ]\n end", "def correct_flags?\n flags = 0\n @grid.each do |row|\n row.each do |tile|\n flags+=1 if tile.flagged && tile.bombed\n end\n end\n flags == @num_bombs\n end", "def boolean\n map ->(primitive) { primitive.to_bool }\n end", "def flag\n @flagged != @flagged = true unless @revealed\n end", "def write_bool(*b); end", "def marked_items\n items.select(&:marked?)\n end", "def to_s #to make p method work\n bomb = \"\\u00A5\".encode('utf-8')\n flag = \"\\u0569\".encode('utf-8')\n blank = \"\\u047A\".encode('utf-8')\n\n #only show what we want\n #if it's flagged, show 'U0569' = flag\n #if it's revealed, show value\n return nil if self.is_a?(Array) || self.nil?\n if @tile_properties[:revealed]\n if @tile_properties[:bombed]\n bomb\n else\n @tile_properties[:value]\n end\n end\n\n if @tile_properties[:flagged]\n flag\n else\n blank\n end\n end", "def booleans(reload=false)#:doc:\n if two_dimensional?\n encoding(reload).map{|l| l.split(//).map{|c| c == '1' } }\n else\n encoding(reload).split(//).map{|c| c == '1' }\n end\n end", "def contains_mine?(row, col)\n @grid[row][col].fill == \"mine\"\n end", "def reveal\n @revealed = true \n if @bombed\n return false\n elsif adjacent_mine_count == 0\n adjacents.each do |adjacent| \n unless adjacent.revealed\n adjacent.reveal\n end \n end \n return true\n end \n end", "def masking?; true; end", "def to_bool() false end", "def unflag\n @flagged != @flagged = false\n end", "def hidden_ships_grid\n @grid.map do\n |row|\n row.map do\n |el|\n if el == :S\n :N\n else\n el\n end\n end\n end\n end", "def hidden\n hidden = @pack.sample(2)\n @pack.delete_if { |el| hidden.include?(el) }\n hidden\n end", "def any_mines_detonated?\n for i in (0..@mine_field[:cover].size-1)\n for r in (0..@mine_field[:cover][0].size-1)\n if @mine_field[:cover][i][r] == true && @mine_field[:bombs][i][r] == true\n return true\n end\n end\n end\n return false\n end", "def toggle_is_pinned!\n self.is_pinned = (self.is_pinned ? false : true) # will change true to false and false to true\n end", "def bubbles?\n false\n end", "def false_positive\n observations.select(&:false_positive)\n end", "def visible\n lines.map { |line| line[ox...(ox + bordered_width)] || '' }\n end", "def flag(x,y)\n cell = @elements[\"#{x}-#{y}\"]\n\n if @stillPlaying == false\n return false\n elsif cell[\"find\"] == 0 \n if cell[\"flag\"] == 0\n cell[\"flag\"] = 1\n cell[\"show\"] = 'F'\n else\n cell[\"flag\"] = 0\n cell[\"show\"] = '.'\n end\n return true\n end\n\n return false\n end", "def boolean_type\n 'Boolean'\n end", "def boolify(val)\n\nend", "def make_mine\n\t\t@mine = true\n\tend", "def boolean_tag(bool, tip = nil, options = {})\n true_text, false_text = \"\", \"\"\n true_text = \" <b>#{options[:true_text]}</b>\" if options[:true_text]\n false_text = \" <b>#{options[:false_text]}</b>\" if options[:false_text]\n content_tag :span, (bool ? \"<span class='true'>&#x2714;#{true_text}</span>\" : \"<span class='false'>&#x2718;#{false_text}</span>\").html_safe, :class => \"boolean\", :title => tip\n end", "def immutable=(bool)\n nil\n end", "def locate_mine\n is_game = true\n cell_flagged = false\n index1,index2 = @option[2].to_i,@option[4].to_i\n choose = @option[0]\n @layout.each do | layoutVal |\n layoutVal.split(\"\").each do | value |\n if @layout[index1][index2] == 'm' and choose == 'o'\n puts \"Opened the mine -- You are OUT!!\"\n is_game = false\n elsif @layout[index1][index2] == 'x' and choose == 'o'\n puts \"You have opened the cell\"\n @layout[index1][index2] = '0'\n elsif @layout[index1][index2] == 'm' and choose == 'f'\n @layout[index1][index2] = 'f'\n elsif @layout[index1][index2] == 'x' and choose == 'f'\n puts \"You have flagged the cell\"\n @layout[index1][index2] = 'f'\n cell_flagged = true\n end\n end\n end\n=begin if value != \"f\" or value == '0' \n\n else\n if cell_flagged\n puts \"You have flagged some cells, GAME OVER!!\"\n else\n puts \"Congrats!!! You have won the Game!\"\n end\n=end\n @layout\n end", "def boolean_icons(value)\n return\"<i class=\\\"icon-tick\\\"></i>\".html_safe if value.is_a?(TrueClass)\n return \"<i class=\\\"icon-cross\\\"></i>\".html_safe if value.is_a?(FalseClass)\n return 'No hay datos' unless value\n value\n end", "def get_boolean value #:nodoc:\n # some exceptions\n value = false if value == :low or value == 0 or value == nil or value == :off or value == :ground or value == :gnd\n !! value # double invert value in to boolean form\n end", "def render(bool = false)\n if bool && !@empty\n return \"S\"\n end\n if @ship != nil && @ship.sunk\n return \"X\"\n end\n @status\n end", "def notify_unflagged(_cell); end", "def all_cells_cleared?\n for i in (0..@mine_field[:bombs].size-1)\n for r in (0..@mine_field[:bombs][0].size-1)\n if @mine_field[:bombs][i][r] == @mine_field[:cover][i][r]\n return false\n else\n return true\n end\n end\n end\n end", "def boolean_attributes\n @boolean_attributes\n end", "def outlineable?\n false\n end", "def solid?\n @solid\n end", "def format_boolean(val, istruct)\n return istruct.nil_text if val.nil?\n\n val ? istruct.true_text : istruct.false_text\n end", "def format_boolean(val, istruct)\n return istruct.nil_text if val.nil?\n\n val ? istruct.true_text : istruct.false_text\n end", "def parse_bool() false end", "def parse_bool() false end", "def negation\n attr_val('./@inversionInd') == \"true\"\n end", "def not\n ~@bits\n end", "def parse_from_human(boolean_pattern)\n self[0...length] = [] #remove the last pattern if it existed\n boolean_pattern.each_char do |char|\n if char == '1'\n push true\n elsif char == '0'\n push false\n elsif char == '-'\n push nil\n else\n raise \"Unexpected pattern character: #{char}\"\n end\n end\n end", "def munge_boolean(value)\n case value\n when true, 'true', :true\n 'true'\n when false, 'false', :false\n 'false'\n else\n raise \"Invalid value for munge_boolean #{value}\"\n end\n end", "def raw=(bool)\n @raw = (bool ? true : false)\n end", "def check_mark\n image_tag('bullet.jpg', :style => \"border: 0px\")\n end", "def uncover\n\t\tmine, uncovered = false, []\n\t\tif @state != :uncovered && @state != :flagged\n\t\t\t@state = :uncovered\n\t\t\tuncovered.push(@coords)\n\t\t\tmine = @type == :mine\n\n\t\t\t# Uncover neighbors\n\t\t\tif not mine and @count == 0\n\t\t\t\t@neighbors.each do |neighbor|\n\t\t\t\t\t# We can assume a neighbor is never a mine in this case\n\t\t\t\t\tuncovered += neighbor.uncover()[1]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn [mine, uncovered]\n\tend", "def map_tile_nocavern(tile)\n (-1..1).all? { |dx| (-1..1).all? { |dy|\n next if not t = tile.offset(dx, dy)\n tm = t.tilemat\n if !t.designation.hidden\n t.designation.flow_size < 4 and tm != :FROZEN_LIQUID\n else\n t.shape_basic == :Wall and (tm == :STONE or tm == :MINERAL or tm == :SOIL or tm == :ROOT)\n end\n } }\n end" ]
[ "0.58801216", "0.5868243", "0.582488", "0.5823771", "0.5815627", "0.56671077", "0.5574644", "0.5546624", "0.54644334", "0.54420507", "0.54393446", "0.54065824", "0.5384596", "0.5370461", "0.5341761", "0.5274628", "0.5264457", "0.52258366", "0.51862407", "0.5184713", "0.518308", "0.51789933", "0.51783407", "0.51783407", "0.5176207", "0.51627254", "0.5144875", "0.5143227", "0.51404715", "0.5130201", "0.5123911", "0.51086795", "0.5104499", "0.5096691", "0.50966895", "0.5070267", "0.5069485", "0.5066582", "0.50656277", "0.50336164", "0.5026441", "0.50052065", "0.5003324", "0.49970704", "0.49948826", "0.49895465", "0.49879408", "0.4985628", "0.4985298", "0.49750224", "0.49739188", "0.4968367", "0.49670088", "0.49625748", "0.49474838", "0.49473798", "0.49444598", "0.49432907", "0.49425092", "0.49409077", "0.49397662", "0.4936367", "0.49322197", "0.49232057", "0.4920704", "0.48931354", "0.48894644", "0.48730278", "0.487101", "0.48670247", "0.48645958", "0.48639762", "0.48625493", "0.48612845", "0.48597947", "0.48491663", "0.4842907", "0.48349994", "0.4832178", "0.48312816", "0.4830578", "0.48264012", "0.48246413", "0.48197073", "0.48161462", "0.48155865", "0.4815359", "0.48133034", "0.4804582", "0.4804582", "0.48028234", "0.48028234", "0.48010838", "0.4798576", "0.4797461", "0.47973037", "0.47969076", "0.47805175", "0.477991", "0.47787973" ]
0.5461252
9
Generate top/bottom border of the form ++
def border '+' + ('-' * @max_y) + '+' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def border; end", "def bottom_border\n \"#{self.align_center} \\n#{BORDER}\"\n end", "def top_border\n \"#{BORDER}\\n #{self.align_center}\"\n end", "def border(top_or_bottom)\n if top_or_bottom == \"top\"\n puts \"\\n ╔═══ ☆ .·:·. ☽ ✧    †    ✧ ☾ .·:·. ☆ ═══╗ \\n\"\n else\n puts \"\\n ╚═══ ☆ .·:·. ☽ ✧    †    ✧ ☾ .·:·. ☆ ═══╝ \\n\"\n end\n end", "def start_border(info = '')\n draw_border(:top, info)\n end", "def print_border_mb row, col, height, width, color, attr\n mvwaddch row, col, ACS_ULCORNER\n mvwhline( row, col+1, ACS_HLINE, width-6)\n mvwaddch row, col+width-5, Ncurses::ACS_URCORNER\n mvwvline( row+1, col, ACS_VLINE, height-4)\n\n mvwaddch row+height-3, col, Ncurses::ACS_LLCORNER\n mvwhline(row+height-3, col+1, ACS_HLINE, width-6)\n mvwaddch row+height-3, col+width-5, Ncurses::ACS_LRCORNER\n mvwvline( row+1, col+width-5, ACS_VLINE, height-4)\n end", "def draw_borders\n if borders.top > 0 # TODO: :none\n options = translate( x: margins.left, y: margins.top ).merge( width: width + margins.width, height: borders.top, foreground: borders.foreground, background: Termbox::RED )\n \n pencil.draw_rectangle( options )\n end\n \n if borders.bottom > 0 # TODO: :none\n options = translate( x: margins.left, y: offsets.top + padding.bottom ).merge( width: width + margins.width, height: borders.bottom, foreground: borders.foreground, background: Termbox::RED )\n \n pencil.draw_rectangle( options )\n end\n end", "def border\n \"#{BORDER}\\n #{self.align_center} \\n#{BORDER}\"\n end", "def top_border_stroke\n line_stroke(\n settings.border.style.top_left,\n settings.border.style.top_junc,\n settings.border.style.top_right\n ) do\n settings.border.style.top_horiz * (dimensions.inner_grid_width + (settings.scrollbar.vert? ? 1 : 0))\n end\n end", "def end_border(info = '')\n draw_border(:bottom, info)\n end", "def border_bottom()\n return get_border(:bottom)\n end", "def border_top()\n return get_border(:top)\n end", "def border=(_arg0); end", "def print_border_mb row, col, height, width, color, attr\n # the next is for xterm-256 \n att = get_attrib attr\n len = width\n len = Ncurses.COLS-0 if len == 0\n # print a bar across the screen \n #attron(Ncurses.COLOR_PAIR(color) | att)\n # this works for newmessagebox but not for old one.\n # Even now in some cases some black shows through, if the widget is printing spaces\n # such as field or textview on a messagebox.\n # 2016-01-14 - replacing 1 with space since junk is showing up in some cases.\n space_char = \" \".codepoints.first\n (row-1).upto(row+height-1) do |r|\n # this loop clears the screen, printing spaces does not work since ncurses does not do anything\n mvwhline(r, col, space_char, len)\n end\n #attroff(Ncurses.COLOR_PAIR(color) | att)\n\n mvwaddch row, col, Ncurses::ACS_ULCORNER\n mvwhline( row, col+1, Ncurses::ACS_HLINE, width-6)\n mvwaddch row, col+width-5, Ncurses::ACS_URCORNER\n mvwvline( row+1, col, Ncurses::ACS_VLINE, height-4)\n\n mvwaddch row+height-3, col, Ncurses::ACS_LLCORNER\n mvwhline(row+height-3, col+1, Ncurses::ACS_HLINE, width-6)\n mvwaddch row+height-3, col+width-5, Ncurses::ACS_LRCORNER\n mvwvline( row+1, col+width-5, Ncurses::ACS_VLINE, height-4)\n end", "def render_border(screen)\n border ? screen.box(abs_x, abs_y, abs_width, abs_height, border.style, border_style) : ''\n end", "def borders_tech_demo\n outputs.labels << [ 5, 260, \"Borders (x, y, w, h, r, g, b, a)\"]\n outputs.borders << [ 10, 180, 50, 50]\n outputs.borders << [ 70, 180, 50, 50, 0, 0, 0]\n outputs.borders << [130, 180, 50, 50, 255, 0, 0]\n outputs.borders << [190, 180, 50, 50, 255, 0, 0, 128]\n outputs.borders << [250, 180, 50, 50, 0, 0, 0, 128 + state.tick_count % 128] # transparency changes\n end", "def bottom_line\n border_options ? super : nil\n end", "def bottom_border_stroke\n line_stroke(\n settings.border.style.bottom_left,\n settings.border.style.bottom_junc,\n settings.border.style.bottom_right\n ) do\n settings.border.style.bottom_horiz * (dimensions.inner_grid_width + (settings.scrollbar.vert? ? 1 : 0))\n end\n end", "def print_borders #:nodoc:\n width = @width\n height = @height-1 # 2010-01-04 15:30 BUFFERED HEIGHT\n window = @graphic # 2010-01-04 12:37 BUFFERED\n startcol = @col \n startrow = @row \n #@color_pair = get_color($datacolor)\n bordercolor = @border_color || $datacolor\n borderatt = @border_attrib || Ncurses::A_NORMAL\n\n window.print_border startrow, startcol, height, width, bordercolor, borderatt\n print_title\n end", "def bottom\n @widget.margins.bottom + @widget.borders.bottom\n end", "def border_style ; view.borderStyle ; end", "def prv_print_border_only row, col, height, width, color, att=Ncurses::A_NORMAL\n att ||= Ncurses::A_NORMAL\n case att.to_s.downcase\n when 'normal'\n att = Ncurses::A_NORMAL\n when 'underline'\n att = Ncurses::A_UNDERLINE\n when 'bold'\n att = Ncurses::A_BOLD\n when 'blink'\n att = Ncurses::A_BLINK # unlikely to work\n when 'reverse'\n att = Ncurses::A_REVERSE \n end\n attron(Ncurses.COLOR_PAIR(color) | att)\n mvwaddch row, col, ACS_ULCORNER\n mvwhline( row, col+1, ACS_HLINE, width-2)\n mvwaddch row, col+width-1, Ncurses::ACS_URCORNER\n mvwvline( row+1, col, ACS_VLINE, height-1)\n\n mvwaddch row+height-0, col, Ncurses::ACS_LLCORNER\n mvwhline(row+height-0, col+1, ACS_HLINE, width-2)\n mvwaddch row+height-0, col+width-1, Ncurses::ACS_LRCORNER\n mvwvline( row+1, col+width-1, ACS_VLINE, height-1)\n attroff(Ncurses.COLOR_PAIR(color) | att)\n end", "def how_to_render_borders args\n # Render a square at 0, 0 with a width and height of 3\n args.nokia.borders << { x: 0, y: 0, w: 3, h: 3, a: 255 }\n\n # Render a square at 3, 3 with a width and height of 3\n args.nokia.borders << { x: 3, y: 3, w: 4, h: 4, a: 255 }\n\n # Render a square at 5, 5 with a width and height of 4\n args.nokia.borders << { x: 7, y: 7, w: 5, h: 5, a: 255 }\nend", "def calculate_top_margin\n @border_top = 5\n @border_top += title_font_size if show_graph_title\n @border_top += 5\n @border_top += subtitle_font_size if show_graph_subtitle\n end", "def border\n puts \"--------------------------------\".center(75)\nend", "def drawTop\n attron(color_pair(1))\n addstr(\"< \")\n attroff(color_pair(1))\n attron(color_pair(2))\n addstr(\"^ \")\n attroff(color_pair(2))\n attron(color_pair(3))\n addstr(\"> \")\n attroff(color_pair(3))\n attron(color_pair(4))\n addstr(\"v \")\n attroff(color_pair(4))\nend", "def print_border row, col, height, width, color, att=Ncurses::A_NORMAL\n $log.debug \" pad printborder #{row} - #{@top} , #{col} - #{@left}, #{height} , #{width} \"\n raise \"print_border: row < top, pls correct code #{row} #{@top}, #{col} #{@left} \" if row < @top or col < @left\n #$log.warn \"print_border: row < top, pls correct code #{row} #{@top} \" if row < @top\n super(row - @top, col - @left, height, width, color, att)\n end", "def bordered; self.border = true; self; end", "def border!\n border do\n # adds default border\n end\n end", "def top\n @widget.margins.top + @widget.borders.top\n end", "def border(&block)\n return '' unless block_given?\n\n border_on + yield + border_off\n end", "def border(options={})\n set RGhost::Border.new(options)\n end", "def calculate_bottom_margin\n @border_bottom = 7\n if key and key_position == :bottom\n @border_bottom += @data.size * (font_size + 5)\n @border_bottom += 10\n end\n if show_x_labels\n\t\t max_x_label_height_px = (not rotate_x_labels) ? \n x_label_font_size :\n get_x_labels.max{|a,b| \n a.to_s.length<=>b.to_s.length\n }.to_s.length * x_label_font_size * 0.6\n @border_bottom += max_x_label_height_px\n @border_bottom += max_x_label_height_px + 10 if stagger_x_labels\n end\n @border_bottom += x_title_font_size + 5 if show_x_title\n end", "def print_border_only row, col, height, width, color, att=Ncurses::A_NORMAL\n if att.nil? \n att = Ncurses::A_NORMAL\n else\n att = get_attrib att\n end\n wattron(Ncurses.COLOR_PAIR(color) | att)\n mvwaddch row, col, Ncurses::ACS_ULCORNER\n mvwhline( row, col+1, Ncurses::ACS_HLINE, width-2)\n mvwaddch row, col+width-1, Ncurses::ACS_URCORNER\n mvwvline( row+1, col, Ncurses::ACS_VLINE, height-1)\n\n mvwaddch row+height-0, col, Ncurses::ACS_LLCORNER\n mvwhline(row+height-0, col+1, Ncurses::ACS_HLINE, width-2)\n mvwaddch row+height-0, col+width-1, Ncurses::ACS_LRCORNER\n mvwvline( row+1, col+width-1, Ncurses::ACS_VLINE, height-1)\n wattroff(Ncurses.COLOR_PAIR(color) | att)\n end", "def print_border row, col, height, width, color, att=Ncurses::A_NORMAL\n raise \"height needs to be supplied.\" if height.nil?\n raise \"width needs to be supplied.\" if width.nil?\n att ||= Ncurses::A_NORMAL\n\n #$log.debug \" inside window print_border r #{row} c #{col} h #{height} w #{width} \"\n\n # 2009-11-02 00:45 made att nil for blanking out\n # FIXME - in tabbedpanes this clears one previous line ??? XXX when using a textarea/view\n # when using a pad this calls pads printstring which again reduces top and left !!! 2010-01-26 23:53 \n ww=width-2\n clr = \" \"*ww\n (row+1).upto(row+height-1) do |r|\n printstring( r, col+1, clr, color, att)\n end\n print_border_only row, col, height, width, color, att\n end", "def top_line\n border_options ? super : nil\n end", "def print_borders\n bordertitle_init unless @_bordertitle_init_called\n raise ArgumentError, \"Graphic not set\" unless @graphic\n raise \"#{self} needs width\" unless @width\n raise \"#{self} needs height\" unless @height\n width = @width\n height = @height-1\n window = @graphic\n startcol = @col \n startrow = @row \n @color_pair = get_color($datacolor)\n bordercolor = @border_color || @color_pair\n borderatt = @border_attrib || Ncurses::A_NORMAL\n window.print_border startrow, startcol, height, width, bordercolor, borderatt\n print_title\n end", "def border\n buffer = screen_width % @border_character.length\n border_length = (screen_width / @border_character.length)\n @border_character * (border_length + buffer)\n end", "def print_in_box(text)\n top_bottom_border = \"+\" + (\"-\" * (text.size + 2)) + \"+\"\n spacer_line = \"|\" + (\" \" * (text.size + 2)) + \"|\"\n message_line = \"| \" + text + \" |\"\n\n puts top_bottom_border\n puts spacer_line\n puts message_line\n puts spacer_line\n puts top_bottom_border\nend", "def add_border! (width, html_color=\"\\#000000\")\n color = Color::RGB.from_html(html_color)\n cmd = \"BO#{width},\" \n cmd << [color.r, color.g, color.b].map {|c| (c*255).to_i }.join(\",\")\n @transforms << cmd\n self\n end", "def print_border row, col, height, width, color, att=Ncurses::A_NORMAL\n raise \"height needs to be supplied.\" if height.nil?\n raise \"width needs to be supplied.\" if width.nil?\n att ||= Ncurses::A_NORMAL\n\n $log.debug \" inside window print_border r #{row} c #{col} h #{height} w #{width} \"\n\n # 2009-11-02 00:45 made att nil for blanking out\n # FIXME - in tabbedpanes this clears one previous line ??? XXX when using a textarea/view\n # when using a pad this calls pads printstring which again reduces top and left !!! 2010-01-26 23:53 \n (row+1).upto(row+height-1) do |r|\n #printstring( r, col+1,\" \"*(width-2) , $datacolor, nil)\n prv_printstring( r, col+1,\" \"*(width-2) , $datacolor, nil)\n end\n prv_print_border_only row, col, height, width, color, att\n end", "def change_border_top(weight='thin')\n change_border(:top, weight)\n end", "def display_bottom_separator(width = HOLE_SIZE, new_line = true, tab = true)\n\t\tdisplay_separator_row(SEPARATOR[:sw_corner], SEPARATOR[:s_divide], \n\t\t\t SEPARATOR[:se_corner], width, new_line, tab)\n\tend", "def outer_height; rect.height + @border_thickness * 2; end", "def border!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n type = BORDER\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 367:9: 'border'\n match( \"border\" )\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__, 37 )\n\n end", "def ehead(xmax, ymax, height)\n xmax += 100 # give space to the (last) text for ig's, to the right\n ymax += 2 * height # give space to the last row, down\n puts %(\n <svg width='#{xmax}' height='#{ymax}' xmlns='https://www.w3.org/2000/svg'>\n )\n ebox text: '<BG>', x_pos: 0, y_pos: 0, width: xmax, height: ymax\nend", "def box!(banner = nill)\n\n theEdge = self.genBar('=')\n theEdge.lPad!('+')\n theEdge.rPad!('==+')\n self.lPad!('| ')\n self.rPad!(' |')\n\n theBox = TextRect.new(banner)\n theBox.below!(theEdge)\n theBox.below!(self)\n @theLines = theBox.lines\n return self.below!(theEdge)\n\n end", "def border(n)\r\n puts \"-\" * n\r\n end", "def change_border_bottom(weight='thin')\n change_border(:bottom, weight)\n end", "def Pager_GetBorder(hwnd) send_pager_message(hwnd, :GETBORDER) end", "def to_s\n\t\t# top border\n\t\toutput = \"+\" + \"---+\" * columns + \"\\n\"\n\n\t\teach_row do |row|\n\t\t\ttop = \"|\"\n\t\t\tbottom = \"+\"\n\n\t\t\trow.each do |cell|\n\t\t\t\t# create a dummy, if no cell present (used by special geometries)\n\t\t\t\tcell = Cell.new(-1, -1) unless cell\n\n\t\t\t\tbody = \" \" # 3 spaces\n\t\t\t\teast_boundary = (cell.linked?(cell.east) ? \" \" : \"|\")\n\t\t\t\ttop << body << east_boundary\n\n\t\t\t\tsouth_boundary = (cell.linked?(cell.south) ? \" \" : \"---\")\n\t\t\t\tcorner = \"+\"\n\t\t\t\tbottom << south_boundary << corner\n\t\t\tend\n\n\t\t\toutput << top << \"\\n\"\n\t\t\toutput << bottom << \"\\n\"\n\t\tend\n\n\t\toutput\n\tend", "def wrap_in_border\n puts border if border?\n yield\n print border if border?\n end", "def hline_top\n\tputs \"__________________________________________________________\"\nend", "def issues_to_pdf_draw_borders(pdf, top_x, top_y, lower_y,\n col_id_width, col_widths)\n col_x = top_x\n pdf.Line(col_x, top_y, col_x, lower_y) # id right border\n col_widths.each do |width|\n col_x += width\n pdf.Line(col_x, top_y, col_x, lower_y) # columns right border\n end\n pdf.Line(top_x, top_y, top_x, lower_y) # left border\n pdf.Line(top_x, lower_y, col_x, lower_y) # bottom border\n end", "def print_border\n $log.debug \" SCROLL print_border ...\"\n #@window.print_border_only(@top-@rows_panned, @left+@cols_panned, @display_h, @display_w, $datacolor)\n @target_window.print_border_only(@top, @left, @display_h, @display_w+1, $datacolor)\n end", "def line_divider \n puts @header.light_blue\n end", "def display_top_separator(width = HOLE_SIZE, new_line = true, tab = true)\n\t\tdisplay_separator_row(SEPARATOR[:nw_corner], SEPARATOR[:n_divide], \n\t\t\t SEPARATOR[:ne_corner], width, new_line, tab)\n\tend", "def draw_border(x1, y)\r\n if @function_UI.mouse_over_button(mouse_x, mouse_y)\r\n draw_line(x1, y, Gosu::Color::BLUE, x1+60, y, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n draw_line(x1, y+35, Gosu::Color::BLUE, x1+60, y+35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n draw_line(x1, y,Gosu::Color::BLUE, x1, y+35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n draw_line(x1+60, y,Gosu::Color::BLUE, x1+60, y+35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n end \r\n end", "def Pager_SetBorder(hwnd, iBorder) send_pager_message(hwnd, :SETBORDER, lparam: iBorder) end", "def middle_line\n border_options.separator ? \"\" : super\n end", "def create_tab_form tab\n mtop = 0\n mleft = 0\n bottom_offset = 2 # 0 will overwrite bottom line, 1 will make another line for inner form\n layout = { :height => @height-(mtop+bottom_offset), :width => @width, :top => mtop, :left => mleft } \n # create a pad but it must behave like a window at all times 2009-10-25 12:25 \n window = VER::Pad.create_with_layout(layout)\n\n form = RubyCurses::Form.new window\n $log.debug \" pad created in TP create_tab_form: #{window.name} , form #{form.name} \"\n $log.debug \" hwtl: #{layout[:height]} #{layout[:width]} #{layout[:top]} #{layout[:left]} \"\n ## added 2010-01-21 15:46 to pass cursor up\n form.parent_form = @parent\n form.navigation_policy = :NON_CYCLICAL\n window.bkgd(Ncurses.COLOR_PAIR($datacolor));\n window.box( 0, 0);\n window.mvwaddch(0, 0, Ncurses::ACS_LTEE) # beautify the corner 2010-02-06 19:35 \n window.mvwaddch(0, @width-1, Ncurses::ACS_RTEE)\n\n # XXX TODO this wastes space we should ditch it.\n ## this prints the tab name on top left\n window.mvprintw(1,1, tab.text.tr('&', '')) if @print_subheader\n window.name = \"Tab::TAB-#{tab.text}\" # 2010-02-02 19:59 \n form.name = \"Form::TAB-#{tab.text}\" # 2010-02-02 19:59 \n form.add_cols=@col\n form.add_rows=@row\n return form\n end", "def print_employee_graphics_box(box)\n\n # Horizontal lines (top to bottom, left to right).\n x = box[:x].in\n y = box[:y].in\n self.line_width = 0.01.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.25.in\n self.line_width = 0.02.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x + 1.25.in, y], [x + 3.75.in, y])\n y -= 0.125.in\n stroke_line([x, y], [x + 1.25.in, y])\n y -= 0.125.in\n self.line_width = 0.01.in\n stroke_line([x + 1.25.in, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.75.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.75.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 1.in, y])\n stroke_line([x + 2.5.in, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 1.in, y])\n stroke_line([x + 2.5.in, y], [x + 3.75.in, y])\n y -= 0.25.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.375.in\n stroke_line([x, y], [x + 3.75.in, y])\n y -= 0.375.in\n stroke_line([x, y], [x + 3.75.in, y])\n\n # Vertical lines (top to bottom, left to right).\n x = box[:x].in\n y = box[:y].in\n stroke_line([x, y], [x, y - 4.75.in])\n stroke_line([x + 2.6.in, y], [x + 2.6.in, y - 0.25.in])\n stroke_line([x + 3.75.in, y], [x + 3.75.in, y - 4.75.in])\n self.line_width = 0.02.in\n y -= 0.25.in\n stroke_line([x, y], [x, y - 0.375.in])\n stroke_line([x + 1.25.in, y], [x + 1.25.in, y - 0.375.in])\n stroke_line([x + 2.5.in, y], [x + 2.5.in, y - 0.25.in])\n stroke_line([x + 3.75.in, y], [x + 3.75.in, y - 0.25.in])\n y -= 0.25.in\n self.line_width = 0.01.in\n stroke_line([x + 2.5.in, y], [x + 2.5.in, y - 0.25.in])\n y -= 0.125.in\n stroke_line([x + 1.25.in, y], [x + 1.25.in, y - 0.375.in])\n y -= 0.125.in\n stroke_line([x + 2.5.in, y], [x + 2.5.in, y - 0.25.in])\n y -= 2.in\n stroke_line([x + 1.25.in, y], [x + 1.25.in, y - 0.5.in])\n stroke_line([x + 2.5.in, y], [x + 2.5.in, y - 1.25.in])\n y -= 0.5.in\n stroke_line([x + 1.in, y], [x + 1.in, y - 0.75.in])\n y -= 0.75.in\n stroke_line([x + 0.3.in, y], [x + 0.3.in, y - 0.25.in])\n stroke_line([x + 1.4.in, y], [x + 1.4.in, y - 0.375.in])\n stroke_line([x + 2.6.in, y], [x + 2.6.in, y - 0.375.in])\n y -= 0.375.in\n stroke_line([x + 1.25.in, y], [x + 1.25.in, y - 0.375.in])\n stroke_line([x + 2.5.in, y], [x + 2.5.in, y - 0.375.in])\n\n # Text (top to bottom, left to right).\n x = box[:x]\n y = box[:y]\n self.vms_text_box(box[:title], x + 0.1, y, 2.4, 0.25, 7, :bold, :left, :center, nil, 'ff0000')\n self.vms_text_box(\"41-0852411\\nOMB No. 1545-0008\", x + 2.6, y, 1.15, 0.25, 6, :normal, :center, :center)\n y -= 0.25\n self.vms_text_box(\"<strong>a</strong> Employee's soc. sec. no.\", x + 0.05, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>1</strong> Wages, tips, other comp.\", x + 1.3, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>2</strong> Federal income tax withheld\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"<strong>3</strong> Social security wages\", x + 1.3, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>4</strong> Social security tax withheld\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.125\n self.vms_text_box(\"<strong>b</strong> Employer ID number (EIN)\", x + 0.05, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.125\n self.vms_text_box(\"<strong>5</strong> Medicare wages and tips\", x + 1.3, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>6</strong> Medicare tax withheld\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"<strong>c</strong> Employer's name, address, and ZIP code\", x + 0.05, y - 0.02, 3.65, _p(6), 6, :normal, :left, :top)\n y -= 0.75\n self.vms_text_box(\"<strong>d</strong> Control number\", x + 0.05, y - 0.02, 3.65, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"<strong>e</strong> Employee's name, address, and ZIP code\", x + 0.05, y - 0.02, 3.65, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"Suff.\", x + 0.05, y - 0.02, 3.65, _p(6), 6, :normal, :right, :top)\n y -= 0.75\n self.vms_text_box(\"<strong>7</strong> Social security tips\", x + 0.05, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>8</strong> Allocated tips\", x + 1.3, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>9</strong> Verification code\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"<strong>10</strong> Dependent care benefits\", x + 0.05, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>11</strong> Nonqualified plans\", x + 1.3, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>12a</strong> Code (See inst. for box 12)\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"<strong>13</strong> Statutory employee\", x + 0.05, y - 0.02, 0.9, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>14</strong> Other\", x + 1.05, y - 0.02, 1.4, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>12b</strong> Code\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"Retirement plan\", x + 0.05, y - 0.02, 0.9, _p(6), 6, :normal, :center, :top)\n self.vms_text_box(\"<strong>12c</strong> Code\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.25\n self.vms_text_box(\"Third-party sick pay\", x + 0.05, y - 0.02, 0.9, _p(6), 6, :normal, :center, :top)\n self.vms_text_box(\"<strong>12d</strong> Code\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.5\n self.vms_text_box(\"<strong>15</strong> State Employer's ID Number\", x + 0.05, y - 0.02, 1.3, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>16</strong> State wages, tips, etc.\", x + 1.45, y - 0.02, 1.1, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>17</strong> State income tax\", x + 2.65, y - 0.02, 1.05, _p(6), 6, :normal, :left, :top)\n y -= 0.125\n self.vms_text_box(\"<strong>18</strong> Local wages, tips, etc.\", x + 0.05, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>19</strong> Local income tax\", x + 1.3, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n self.vms_text_box(\"<strong>20</strong> Locality name\", x + 2.55, y - 0.02, 1.15, _p(6), 6, :normal, :left, :top)\n y -= 0.375\n self.vms_text_box(\"2018\", x, y - 0.02, 3.75, 0.25, 8, :bold, :center, :top, nil, 'ff0000')\n self.vms_text_box(\"Form W-2 Wage and Tax Statement\", x, y - 0.04, 3.75, 0.125, 6, :bold, :left, :top, nil, 'ff0000')\n self.vms_text_box(\"Dept. of the Treasury -- IRS\", x, y - 0.04, 3.75, 0.125, 6, :normal, :right, :top)\n y -= box[:bottom_left_offset]\n self.vms_text_box(box[:bottom_left], x, y - 0.04, 3.75, box[:bottom_left_height], 6, :normal, :left, :top)\n y -= box[:bottom_right_offset]\n self.vms_text_box(box[:bottom_right], x, y - 0.04, 3.75, 0.125, 6, :normal, :right, :top)\n\n end", "def print_in_box(str)\n dash_inserts = '-' * str.length\n horiz_border = '+-' + dash_inserts + '-+'\n space_inserts = ' ' * str.length\n padding_border = '| ' + space_inserts + ' |'\n puts horiz_border\n puts padding_border\n puts '| ' + str + ' |'\n puts padding_border\n puts horiz_border\nend", "def draw_border(x1, y, mouse_x, mouse_y)\r\n if @function_UI.mouse_over_button(mouse_x, mouse_y)\r\n draw_line(x1, y, Gosu::Color::BLUE, x1+60, y, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n draw_line(x1, y+35, Gosu::Color::BLUE, x1+60, y+35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n draw_line(x1, y,Gosu::Color::BLUE, x1, y+35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n draw_line(x1+60, y,Gosu::Color::BLUE, x1+60, y+35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)\r\n end \r\n end", "def header\r\n border(31)\r\n tab(10, \"Tic Tac Toe\")\r\n end", "def setbordercolorind(*)\n super\n end", "def print_in_box(text)\n length = text.size\n horizontal_border = \"+-\" + (\"-\" * length) + \"-+\"\n empty_border = \"| \" + (\" \" * length) + \" |\"\n content = \"| #{text} |\"\n \n puts horizontal_border\n puts empty_border\n puts content\n puts empty_border\n puts horizontal_border\nend", "def outer_width; rect.width + @border_thickness * 2; end", "def add_border_mark(sexp)\n def sexp.inline_border?\n true\n end \n end", "def underline; end", "def underline; end", "def pbBottomRight(window)\n window.x=Graphics.width-window.width\n window.y=Graphics.height-window.height\nend", "def border_colour\n @cr[0xf] & 0x07\n end", "def issues_to_pdf_draw_borders(pdf, top_x, top_y, lower_y,\n col_id_width, col_widths, rtl=false)\n col_x = top_x\n pdf.line(col_x, top_y, col_x, lower_y) # id right border\n col_widths.each do |width|\n if rtl\n col_x -= width\n else\n col_x += width\n end\n pdf.line(col_x, top_y, col_x, lower_y) # columns right border\n end\n pdf.line(top_x, top_y, top_x, lower_y) # left border\n pdf.line(top_x, lower_y, col_x, lower_y) # bottom border\n end", "def add_border(size=3,r=0,g=0,b=0)\n width = @x_size+2*size\n height = @y_size+2*size\n resampled = image_create_true_color(width,height)\n image_filled_rectangle(resampled,0,0,width,height, r, g, b)\n image_copy(@picture,resampled,size,size,0,0,@x_size,@y_size)\n image_destroy(@picture)\n @x_size = width\n @y_size = height\n @picture = image_create_true_color(@x_size,@y_size)\n image_filled_rectangle(@picture,0,0,@x_size,@y_size,255,255,255)\n image_color_transparent(@picture,255,255,255)\n image_copy(resampled,@picture,0,0,0,0,@x_size,@y_size)\n end", "def border_class\n orderable.border_class\n end", "def setup_border_windows(name, window)\n # Set black and white color pair\n window.attron(Curses.color_pair(8))\n name = name.to_s\n\n # Apply box border to window with pipe and dash symbols\n window.box('|', '-')\n\n # Set curser position to the middle of the top border and add name of box\n window.setpos(0, (window.maxx / 2.0).ceil - (name.length / 2.0).ceil)\n window.addstr(name.upcase)\n\n window.noutrefresh\nend", "def min_rows\n default_border_size.top + default_border_size.bottom + 2\n end", "def print_top_right(htext)\n hlen = htext.length\n len = @window.getmaxx # width was not changing when resize happens\n len = Ncurses.COLS-0 if len == 0 || len > Ncurses.COLS\n #$log.debug \" def print_top_right(#{htext}) #{len} #{Ncurses.COLS} \"\n @form.window.printstring 0, len-hlen, htext, @color_pair, @attr\n end", "def border(column_widths, location)\n result = []\n result << @symbols[:\"#{location}_left\"]\n column_widths.each.with_index do |width, i|\n result << @symbols[:\"#{location}_center\"] if i != 0\n result << (@symbols[:line] * (width + 2))\n end\n result << @symbols[:\"#{location}_right\"]\n @pastel.decorate(result.join, *@theme[:table])\n end", "def print_in_box(message)\n horizontal_rule = \"+#{'-' * (message.size + 2)}+\"\n empty_line = \"|#{' ' * (message.size + 2)}|\"\n\n puts horizontal_rule\n puts empty_line\n puts \"| #{message} |\"\n puts empty_line\n puts horizontal_rule\nend", "def print_in_box(message)\n horizontal_rule = \"+#{'-' * (message.size + 2)}+\"\n empty_line = \"|#{' ' * (message.size + 2)}|\"\n\n puts horizontal_rule\n puts empty_line\n puts \"| #{message} |\"\n puts empty_line\n puts horizontal_rule\nend", "def setborderwidth(*)\n super\n end", "def print_in_box(str)\n size = str.size\n border_line = '+-' + ('-' * size) + '-+'\n empty_line = '| ' + (' ' * size) + ' |'\n text_line = '| ' + str + ' |'\n \n puts border_line\n puts empty_line\n puts text_line\n puts empty_line\n puts border_line\nend", "def border(column_widths, location)\n symbols = @symbols\n result = []\n result << symbols[:\"#{location}_left\"]\n column_widths.each.with_index do |width, i|\n result << symbols[:\"#{location}_center\"] if i != 0\n result << (symbols[:line] * (width + 2))\n end\n result << symbols[:\"#{location}_right\"]\n styles = Array(@theme[:table])\n @pastel.decorate(result.join, *styles)\n end", "def border\n @border ||= Vedeu.borders.by_name(name)\n end", "def border\n @border ||= Vedeu.borders.by_name(name)\n end", "def c_bottomleft\n print cursor.column(0)\n print cursor.row(height)\n end", "def line_stroke(left_border, junc_border, right_border, &block)\n stroke = ''\n stroke += left_border if settings.border.left?\n dimensions.num_cols.times do |col_num|\n stroke += junc_border if col_num > 0 && settings.border.inner_vert?\n stroke += yield\n end\n stroke += right_border if settings.border.right?\n stroke\n end", "def paint_border!(style, d)\n case style\n when :round_rect then d.roundrectangle(0, 0, width, height, 10, 10)\n # default is :round_rect, but treat anything unrecognized as :rectangle (use entire image)\n else d.rectangle(0, 0, width, height)\n end\n end", "def inqbordercolorind\n inquiry_int { |pt| super(pt) }\n end", "def p_blankline_hr\n p :class => \"underline\" do\n nbsp\n end\n end", "def add_border(options = {})\n border_width = options[:width].to_i || 2\n color = hex_to_color(options[:color]) || hex_to_color(\"000000\")\n style = options[:style]\n style = nil if style.to_sym == :plain\n new_width, new_height = width + 2*border_width, height + 2*border_width\n target = paint(BufferedImage.new(new_width, new_height, color_type)) do |g|\n g.color = color\n if style\n raised = style.to_sym == :raised ? true : false\n g.fill3DRect(0, 0, new_width, new_height, raised)\n else\n g.fill_rect(0, 0, new_width, new_height)\n end\n g.draw_image(@src, nil, border_width, border_width)\n end\n block_given? ? yield(target) : target\n end", "def standard_gap\n \" \"\n end", "def borders(workbook, center, heading, _colors)\n worksheet = workbook.add_worksheet('Borders')\n\n worksheet.set_column(0, 4, 10)\n worksheet.set_column(5, 5, 40)\n\n worksheet.write(0, 0, \"Index\", heading)\n worksheet.write(0, 1, \"Index\", heading)\n worksheet.write(0, 3, \"Style\", heading)\n worksheet.write(0, 5, \"The style is highlighted in red for \", heading)\n worksheet.write(1, 5, \"emphasis, the default color is black.\",\n heading)\n\n 14.times do |i|\n format = workbook.add_format\n format.set_border(i)\n format.set_border_color('red')\n format.set_align('center')\n\n worksheet.write((2 * (i + 1)), 0, i, center)\n worksheet.write((2 * (i + 1)),\n 1, sprintf(\"0x%02X\", i), center)\n\n worksheet.write((2 * (i + 1)), 3, \"Border\", format)\n end\n\n worksheet.write(30, 0, \"Diag type\", heading)\n worksheet.write(30, 1, \"Index\", heading)\n worksheet.write(30, 3, \"Style\", heading)\n worksheet.write(30, 5, \"Diagonal Boder styles\", heading)\n\n (1..3).each do |i|\n format = workbook.add_format\n format.set_diag_type(i)\n format.set_diag_border(1)\n format.set_diag_color('red')\n format.set_align('center')\n\n worksheet.write((2 * (i + 15)), 0, i, center)\n worksheet.write((2 * (i + 15)),\n 1, sprintf(\"0x%02X\", i), center)\n\n worksheet.write((2 * (i + 15)), 3, \"Border\", format)\n end\n end", "def middle_border_stroke\n line_stroke(\n settings.border.style.left_junc,\n settings.border.style.cross_junc,\n settings.border.style.right_junc\n ) do\n settings.border.style.middle_horiz * (dimensions.inner_grid_width + (settings.scrollbar.vert? ? 1 : 0))\n end\n end", "def display_board\n row_1 = (\" | | \")\n border_1= \"-----------\"\n puts row_1\n puts border_1\n puts row_1\n puts border_1\n puts row_1\nend", "def borders\n return @borders\n end", "def draw_canvas_border(grid)\n grid[0].each do |grid_cell|\n grid_cell.top_wall = true\n end\n grid[grid.length - 1].each do |grid_cell|\n grid_cell.bottom_wall = true\n end\n\n (0..grid.length - 1).each do |j|\n grid[j][0].left_wall = true\n grid[j][grid[j].length - 1].right_wall = true\n end\nend", "def draw\n\t\tputs \"\\n\"\n\t\tmid = (@height/2.0).ceil\n\t\tfor line in 1..@height\n\t\t\tspace0 = (mid - (mid-line).abs).abs\n\t\t\tspace1 = (mid - line).abs * 2 - 1\n\t\t\tputs space1 > 0 ?\n\t\t\t\t \" \" * space0 + \"X \" + \" \" * space1 + \"X\" :\n\t\t\t\t \" \" * space0 + \"X\"\n\t\tend\n\tend" ]
[ "0.7198731", "0.7197691", "0.7186019", "0.710462", "0.7068174", "0.6899728", "0.67883116", "0.66856563", "0.6665067", "0.6623333", "0.6572159", "0.6570054", "0.65555686", "0.65298265", "0.64721256", "0.64132386", "0.640519", "0.640465", "0.6295759", "0.6285698", "0.6254861", "0.6253594", "0.62505364", "0.6176883", "0.6174601", "0.61580884", "0.61548114", "0.6087234", "0.60836023", "0.6049761", "0.60307497", "0.6023926", "0.60210323", "0.60102725", "0.60049254", "0.6000091", "0.5949261", "0.5945805", "0.5916046", "0.59115845", "0.587676", "0.5870614", "0.58561647", "0.5850415", "0.58219767", "0.58177316", "0.5809806", "0.57807744", "0.5758446", "0.5751964", "0.57360333", "0.57332456", "0.5716695", "0.56995064", "0.5679257", "0.56565094", "0.5643817", "0.56141984", "0.5610425", "0.5602768", "0.5567147", "0.5563256", "0.55617607", "0.55518585", "0.5539964", "0.55397177", "0.55330044", "0.55269796", "0.5523677", "0.55207187", "0.55207187", "0.5514938", "0.5510545", "0.55070853", "0.54999024", "0.5496123", "0.5486999", "0.5478289", "0.54608077", "0.5437962", "0.54364693", "0.54364693", "0.54203564", "0.5419417", "0.54086006", "0.53896224", "0.53896224", "0.5378546", "0.5378124", "0.5359569", "0.53530097", "0.5351104", "0.5345491", "0.5337219", "0.53224134", "0.5298127", "0.5298001", "0.5291154", "0.5280234", "0.52743685" ]
0.6102992
27
input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: create an empty hash seperate string into individual items set default quantity 1. print the hash list to the console output: hash
def new_list(items) grocery_list = Hash.new(0) items.split(" ").each do |x| grocery_list[x] += 1 end grocery_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_list_items(input_string)\n \n hsh = {}\n \n # create an array containing each item \n array_input = input_string.split(' ')\n \n # create a hash from the array (iterate), containing the information of key/value pairs \n array_input.each do |item|\n # set default quantity as value\n hsh[item] = 0\n end \n \n # print the list to the console (we will use the last method)\n print_list(hsh)\n \n # output: hash data structure of key/value pairs\n return hsh\nend", "def createlist(str)\r\n# steps:\r\n# break the string into an array\r\n items = str.split\r\n item_list = {}\r\n\r\n\t# iterate through array and build hash\r\n items.each do |item|\r\n\r\n\t\t# iterate through array and build hash\r\n\t\t# set default quantity to 1\r\n \titem_list[item] = 1\r\n end\r\n # print the list to the console [the last method that print a list and make it look pretty]\r\n print_list(item_list)\r\n\r\n # output: the hash\r\n return item_list\r\nend", "def create_list(string)\n puts \"What is the default item quantity?\"\n default_quantity = gets.chomp.to_s\n list_array = string.split(' ')\n list_hash = {}\n list_array.each do |item|\n list_hash[item] = default_quantity\n end\n\n print_list(list_hash)\n\n list_hash\nend", "def create_list(user_list)\n# input: string of items separated by spaces (example: \"carrots apples cereal pizza\")\n# puts \"\"\n# steps:\n # [fill in any steps here]\n list_array = user_list.split(\",\")\n # set default quantity\n quanity = 1\n # print the list to the console [can you use one of your other methods here?]\n p list_array.collect { |item| [item, quanity] }\n $list_hash = Hash[list_array.collect { |item| [item, quanity] } ]\n# output: [what data type goes here, array or hash?] Print result in hash\n p $list_hash\n $list_hash\nend", "def create_list(items_string)\r\n\tdefault_quantity = 1\r\n\r\n\tgrocery_list = Hash.new{|hash, key| hash[key] = default_quantity}\r\n\titems_array = items_string.split(\" \")\r\n\t\r\n\titems_array.each do |item| \r\n\t\tgrocery_list[item.to_sym]\r\n\tend\r\n\tprint_list(grocery_list)\r\n\tgrocery_list\r\nend", "def list_create(items)\n hash_items = Hash.new\n default_quantity = 1\n\n # adding a slick way to initialize hash in one line, but not as readable\n # return items.split(' ').product([1]).to_h\n\n items.split(' ').each do |x|\n hash_items[x] = default_quantity\n end\n\n return hash_items\nend", "def create_a_list(string_of_items)\n qty = 1\n grocery_hash = Hash.new\n string_of_items.split(\" \").each do |x|\n grocery_hash[x] = qty\n end\n grocery_hash\nend", "def initial_list(string_of_items)\n grocery_list = {}\n quantity = 1\n items_array = string_of_items.split(\" \")\n items_array.each do |item|\n grocery_list.store(item, quantity)\n end\n grocery_list\nend", "def create_list(items_string, quantity = 0)\n list = {}\n items = items_string.split(\" \")\n items.each do |item|\n list[item] = quantity\n end\n list\nend", "def list_of_items(userinput)\n itemlist = []\n final_list = {}\n itemlist = userinput.split(' ')\n p itemlist\n quantity = 1\n itemlist.each do |value|\n final_list[value] = 1\n end\n puts final_list\n final_list\nend", "def create_grocery_list(shopping_items)\n # steps:\n # create an empty hash\n grocery_list = {}\n # add items\n # convert input into separate items\n shopping_items = shopping_items.split\n # add items to hash and set default quantity\n shopping_items.each do |item_name|\n grocery_list[item_name.to_sym] = 1\n end\n # print the list to the console [can you use one of your other methods here?]\n print_grocery_list(grocery_list)\n# output: explicit return the hash\n grocery_list\nend", "def create_list(str, default_quantity=1)\n list = {}\n item_array = str.split\n item_array.each do |item|\n list[item] = default_quantity\n end\n print_list(list)\n return list\nend", "def create_list(string_of_items)\n hash_of_items = {}\n array_of_items = string_of_items.split(\" \")\n \n array_of_items.each do |item|\n hash_of_items[item] = 1\n end\n hash_of_items\nend", "def shopping_list(string)\n\tgrocery_list = {}\n# steps: \n \t# separate string into array\n\tarray = string.split(' ')\n\t# loop through array to create hash with items in array as key and set default quantity to \"\"\n\tarray.map {|item| grocery_list[item] = \"\"}\n\t# print the list to the console [can you use one of your other methods here?]\n\t# output: [what data type goes here, array or hash?]\n\tputs grocery_list\n\treturn grocery_list\nend", "def new_list (string)\nitem_hash= hash.new\nitem_array = string.split\nitem_array.each do |item|\n item_hash[item] = 1\nend\nitem_hash\nend", "def shopping_list(items)\n\t# separate the items into an array\n\titems = items.split\n\tputs \"Here are the items you entered.\"\n\tputs items\t\n\t# create the list to add items into.\n\t$list = Hash.new\n\t# enter quantity of each item.\n\titems.each_index do |x|\n\t\tputs \"Enter quantity with no spaces for #{items[x]}.\"\n\t\tquantity = gets.chomp\n\t\t# assign each quantity to the item and add to list\n\t\t$list[:\"#{items[x]}\"] = quantity\n\tend\n\tputs \"Here is your shopping list.\"\n\tputs $list\nend", "def create_list(string_of_items, default_quantity)\n grocery_array = string_of_items.split(' ')\n grocery_hash = {}\n grocery_array.each { |item| grocery_hash[item] = default_quantity }\n grocery_hash\nend", "def create_list(items, qty=1)\n items = items.split(\" \")\n list = Hash.new\n\n items.each do |item|\n if list.has_key?(item)\n list[item] += qty\n elsif\n list[item] = qty\n end\n end\n\n return list.each {|k,v| puts \"#{k}: #{v}\"}\nend", "def create_list(items_str)\r\n items_hash={}\r\n items_array=items_str.split(\" \")\r\n items_array.each do |it|\r\n items_hash[it]=1\r\n end\r\n print_list(items_hash)\r\nend", "def create_list(list, grocery_hash={})\n\tlist_array = list.split(\" \")\n\tquantity = 0\n\tlist_array.each do |item|\n\t\tgrocery_hash[item]=quantity\n\tend\n\tprint_list(grocery_hash)\n\treturn grocery_hash\nend", "def create_list(items, quantity=1)\r\n item_array = items.split(' ')\r\n item_hash = {}\r\n item_array.each do |items|\r\n item_hash[items] = quantity\r\n end \r\n p item_hash # p will both print and return # puts will print but will not return. It will return nil.\r\nend", "def create_list(string_of_items)\n string_ary = string_of_items.split(\" \")\n string_hash = {}\n string_ary.each { |item| string_hash[item] = 1 }\n print_grocery_list(string_hash)\n return string_hash\nend", "def add_item_to_list(string, quantity, hash)\n\thash[string.to_sym] = (hash[string.to_sym] || 0) + quantity\n\tp hash\nend", "def create_hash(items, default_qty = 0)\n groceries = {}\n items.split.each { |food| groceries[food] = default_qty }\n groceries \nend", "def generate_list(string_of_items)\n grocery_list={}\n default_value=1\n items=string_of_items.split(' ')\n items.each do |item|\n #Transfer items into hash\n grocery_list[item]=default_value\n end\n return grocery_list\n print(grocery_list)\nend", "def create_list(string)\n list = string.split(' ')\n qty = 1\n grocery_list = {}\n list.each { |item| grocery_list[item] = qty }\n grocery_list\nend", "def create_list(list)\n grocery_list = Hash.new\n default_quantity = 1 \n list.split(\" \").each {|x| grocery_list[x] = default_quantity }\n p grocery_list\nend", "def hash_start(food, quantity=1)\n\tgrocery_list = {}\n\n\tfood.split.each { |item| grocery_list[item] = quantity }\n\t\t\n\tgrocery_list\nend", "def list_maker(items, *quantities)\r\n list_hash = {}\r\n list_array = items.split(' ')\r\n for i in 0..(list_array.length - 1)\r\n list_hash[list_array[i]] = quantities[i]\r\n end\r\n list_hash.map do |item, quantity|\r\n if quantity == nil \r\n list_hash[item] = 1 \r\n end\r\n end\r\n list_hash\r\nend", "def create_list(items)\n\titem_list = {}\n\titem_array = items.split(\" \")\n\tdefault_quantity = 1\n\titem_array.each do |item|\n\t\titem_list[item] = default_quantity\n\tend\n\tpretty_list(item_list) \nend", "def create_list(input_string)\n input_arr = input_string.split(\" \")\n new_shopping_list = Hash.new\n new_shopping_list = Hash[input_arr.collect{|item, | [item, 1]}]\nend", "def create_list(items)\n\tlist = {}\n\titems = items.split(' ')\n\tquantity = 0\n\tlist = Hash.new\n\n\titems.each do |item| \n\t\tlist[item] = quantity\n\tend\n\tlist\nend", "def grocery_list(grocery_items)\n # input: string of items separated by spaces (example: \"carrots apples cereal pizza\") \n # steps: \n # Create a new empty data structure (Hash) \n grocery = {}\n # Convert the string parameter into an array of words.\n item = grocery_items.split(\" \")\n # Iterate through the array and get the element.\n item.each do |product|\n # Store the element as a key in the hash.\n # set default quantity an integer with value 3. This is the default value of the keys in the hash.\n grocery[product] = 3\n display_list(grocery)\n end\n # print the list to the console [can you use one of your other methods here?]\n # output: Hash \n grocery\nend", "def create_list(input)\n grocery_list = {}\n # convert items in string to hash keys:\n input_array = input.split\n # convert string into array using\n # iterate through array assign each string item to a hash key with default value of x\n # set default quantity\n # iteration loop\n # grocery_list[\"key_name1\"] => 3\n input_array.each do |i|\n grocery_list[i] = 3\n end\n # print the list to the console [can you use one of your other methods here?]\n # call the method for printing a list *below*\n # output: [what data type goes here, array or hash?]\n # make output return hash\n # grocery_list, call the hash so that the last evaluated item is the hash.. and then that is returned\n grocery_list\nend", "def create_list(string)\n item_array = string.split(\" \")\n shopping_list = {}\n item_array.each do |item|\n shopping_list[item] = 1\n end\n list_print(shopping_list)\n shopping_list\nend", "def list_creation(items_string)\r\n\tshopping_list = {}\r\n\tintit_list = items_string.split(' ')\r\n\tintit_list.each do|item|\r\n\t\tshopping_list[item] = 1\r\n\tend\r\n\tshopping_list\r\nend", "def create_list(string)\n list = {}\n string = string.split \n\n string.each { |item| \n list[item] = 1\n }\n\n printhash(list)\n\n list\nend", "def create_list(items=\"\")\n grocery_list = Hash.new()\n list = items.split(\" \")\n list.each {|item| grocery_list[item] = 1 }\n grocery_list\nend", "def grocery_list(items)\n #method for create list\n array = items.split(\" \")\n #separate by spaces TEST\n #p grocery_array\n #test print\n hash = {}\n #empty hash\n array.each {|item| hash[item] = 1}\n #ends hash\n hash\n #test hash\nend", "def create_list(string_of_items)\n grocery_list = {}\n grocery_items = string_of_items.split\n grocery_items.each do |item, quantity|\n grocery_list[item] = 1\n end \n return grocery_list\nend", "def create_list(new_items)\n\tshopping_list = new_items.split(\" \")\n\titems_hash = Hash.new\n\tshopping_list.each do |item| \n\titems_hash[item] = 1\n\tend\n\treturn items_hash\nend", "def create_list(items)\n hash = Hash.new(0)\n items.split(\" \").each do |item|\n hash[item] += 1\n end\n p hash\nend", "def create_list(list)\n quantity = 1\n items = list.split(' ')\n grocery_list = { }\n\n items.each do |item|\n grocery_list[item] = quantity\n end\n grocery_list\nend", "def create_list(list_str)\n food_list = {}\n list_array=list_str.split(\" \")\n default_qty = 1\n list_array.each do |food|\n food_list[food.to_sym] = default_qty\n end\n food_list\nend", "def grocery_list\n puts \"What do you need to buy?\"\n list = gets.chomp\n listarray = list.split(\" \")\n listhash = Hash.new\n \n listarray.each do |item|\n \n listhash[item] = 1\n \n end\n listhash\nend", "def create_list(input_string)\n grocery_list = {}\n items = input_string.split(' ')\n items.each do |item|\n add_item_to_list(grocery_list, item, 1)\n end\n\n print_list(grocery_list)\n\n add_item_to_list(grocery_list, \"milk\", 1)\n update_item_from_list(grocery_list, \"Lemonade\", 2)\n update_item_from_list(grocery_list, \"Tomatoes\", 3)\n update_item_from_list(grocery_list, \"Onions\", 10)\n update_item_from_list(grocery_list, \"iceCream\", 20)\n\n print_list(grocery_list)\n\n remove_item_from_list(grocery_list, \"IceCream\")\n\n print_list(grocery_list)\n\nend", "def create_list(items_string)\r\n\titems_array = items_string.split(' ')\r\n\titems_hash = Hash.new\r\n\titems_array.each do |item|\r\n\t\titems_hash[item] = 1\r\n\tend\r\n\treturn items_hash\r\nend", "def add_item(list_name, item, quantity=1)\r\n# input: list, item name, and optional quantity\r\n# steps: add item and its quantity to the hash\r\n list_name.store(item, quantity)\r\n# output: hash with new item\r\n p list_name\r\nend", "def create_list(items)\r\n item_array = items.split\r\n grocery_hash = Hash.new\r\n item_array.each do |i|\r\n grocery_hash[i] = 1\r\n end\r\n p grocery_hash\r\nend", "def string_to_hash(hash, grocery)#accept input as a string\n\tgroceryarr = grocery.split(' ')\n\tgroceryarr.each do |grocery| #split item an add them to our hash\n\t\tadd_item(hash,grocery, 1)\n\tend\nend", "def create_list(items_string)\n list = {}\n items_array = items_string.split(\",\")\n\n items_array.each do |item|\n list[item] = 1\n end\n print_pretty_list(list)\nend", "def make_list(item_string = \"\")\r\n grocery_list = {}\r\n=begin\r\n items_array = item_string.split(\" \")\r\n #puts items_array\r\n\r\n items_array.each do |shopping_item|\r\n grocery_list[shopping_item] = 1\r\n end\r\n=end\r\n grocery_list = Hash[item_string.split(\" \").map {|item| [item, 1]}] \r\n #I think this is less readable, but i wanted to find another way to do it\r\n #puts grocery_list\r\n return grocery_list \r\nend", "def create_list(list_str)\nfinal_list = {}\narr = list_str.split(\" \")\n arr.each do |key|\n final_list[key] = 1\n# One refers to the default quantity. \n end \n final_list\nend", "def create_items(string)\r\n item_list = {}\r\n string.split(\" \").each { |item| item_list[item] = 1 }\r\n item_list\r\nend", "def grocerylist(items)\n itemhash = {}\n items.split(\" \").each do |items|\n itemhash[items] = 0\n end\n # p itemhash\n return itemhash\nend", "def create_list(items)\n items = items.split(\" \")\n list = Hash.new\n items.each do |item|\n list[item] = 1\n end\n p list\nend", "def add_multiple(string,string_q, hash)\n quantity = string_q.split(\" \")\n n = 0\n string.split(\" \").each do |food|\n add(food, quantity[n], hash)\n n = n + 1\n end\nend", "def createlist(items)\n new_items = items.split(\" \")\n list = Hash.new\n new_items.each {|item| list[item] = 1}\n prettylist(list)\n # use print_list method\nend", "def add_item(my_list, item, quantity)\r\n #input: a string seperated by an integer \r\n #steps: use a method that adds an item and quantity to the hash.\r\n my_list.store(item, quantity)\r\n # use a hash or store method hash.merge!(key => value) \r\n #output = hash with the updated item/quantity. \r\n my_list\r\n \r\nend", "def create_list(item, quantity = 1)\n\tlist = {}\n\tsplit_item = item.split(\" \")\n\tsplit_item.each do |item_name|\n\t\tlist[item_name] = quantity\n\tend\n\treturn list\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def grocery_list(items)\n list = {}\n items.split.each do |item, quantity|\n list[item] = 0\n end\n p list\nend", "def create_list(str)\n list = {}\n qty_default = 1\n arr = str.split(\" \")\n arr.each {|item| list[item] = qty_default}\n return list\nend", "def create_list_of(string_of_items)\n\tary_of_items = string_of_items.split(' ')\n\titem_list = {}\n\tary_of_items.each {|x| item_list[x] = 1}\n\tprint_list(item_list)\nend", "def create_list(string)\r\n\tgrocery_hash = {}\r\n\tthe_list = string.split\r\n\tthe_list.each do |item|\r\n\t\tgrocery_hash[item] = 1\r\n\tend\r\n\tprint_list(grocery_hash)\r\nend", "def create_list(items)\r\n items_array = items.split(' ')\r\n grocery_hash = {}\r\n items_array.each do |item|\r\n add_item(grocery_hash, item)\r\n #grocery_hash[item] = 1\r\n end\r\n grocery_hash\r\nend", "def make_list(item_list)\r\n item_list = item_list.split(' ')\r\n list = {}\r\n item_list.each do | item |\r\n list[item] = 1\r\n end\r\n print_list(list)\r\n list\r\nend", "def create_list(title, list_arr)\n # grocery_list will be a string from user\n # assign an empty hash (will eventually be the list)\n final_list = {}\n # use split method to get list items\n list_arr = list_arr.split\n # Iterate through the elements of the array and insert to hash\n # set default quantity\n list_arr.each { |item| final_list[item]=1}\n # print the list to the console [can you use one of your other methods here?]\n puts print_list(title,final_list)\n final_list\nend", "def new_hash_item(inventario)\n\tnew_item = gets.chomp.split(',').map { |e| e.strip }\n\tinventario[new_item[0].to_s] = new_item[1].to_i\n\tputs inventario\nend", "def add_an_item(list_hash,item_name)\n puts 'Adding the item: #{item_name}.'\n puts 'Specify a quantity or type \"default\".'\n quantity = gets.chomp.to_s\n\n if quantity.downcase == 'default'\n quantity = '1'\n end\n\n puts list_hash\n\n if !list_hash[item_name]\n puts 'Added the item: #{item_name}.'\n list_hash[item_name] = quantity\n else\n puts 'Item already exists.'\n end\n\n list_hash\n\nend", "def create_list(string)\n\tgrocery_hash = {}\n\tthe_list = string.split\n\tthe_list.each do |item|\n\t\tgrocery_hash[item] = 1\n\tend\n\tprint_list(grocery_hash)\nend", "def shopping_list(user_input)\r\n grocery_list = {}\r\n list = user_input.split(\" \")\r\n list.each do |item|\r\n grocery_list[item] = 1\r\n end\r\n p grocery_list\r\nend", "def create_list(items)\r\n\tgrocery_list = {}\r\n\tlist_of_items = items.split(' ')\r\n\r\n\tlist_of_items.each { |item| grocery_list[item] = 1}\r\n\tgrocery_list.each {|item, quantity| puts item, quantity}\r\nend", "def create_list(items = '')\n list = {}\n items.split(' ').each {|item| list[item.to_sym] = 1}\n print_list(list)\n list\nend", "def create_list(items)\n list = items.split\n shopping_list = {}\n list.each do |item|\n shopping_list[item] = 1\n end\n shopping_list\nend", "def create_list(item_string)\r\n items = item_string.split\r\n grocery_list = {}\r\n items.each do |item|\r\n grocery_list[item] = 1\r\n end\r\n grocery_list\r\nend", "def add_item(list, item, quantity=1)\r\n# input: item name and optional quantity\r\n# steps: \r\n # Use shopping list as input\r\n # Use the item to be added as 2nd input\r\n # Use the item quantity as a 3rd input (look up whether optional input is possible)\r\n # Add the item and quantity to the shopping list\r\n list[item] = quantity\r\n# output: shopping list with the added item and quantity\r\n printlist(list)\r\nend", "def create_list\n \n list = {}\n \n puts \"Please enter items for list:\"\n \n items = gets.chomp\n\n items = items.split(' ')\n \n items.each do |key| \n \n list[key.to_sym] = \"1\"\n \n end\n \n list\n\nend", "def create_list(items)\n grocery_list = {}\n item_array = items.split(\" \")\n item_array.each do |item|\n grocery_list[item] = 1\n end\n print_list(grocery_list)\n grocery_list\nend", "def create_list (items)\n grocery_list = Hash.new(1)\n \n items.split(\" \").each { |item| grocery_list[item] = 1 }\n\n return grocery_list\nend", "def create_list(string)\r\n\tshopping_list = {}\r\n\tshopping_array = string.split(' ')\r\n\tshopping_array.each do |item|\r\n\t\tshopping_list[item] = 1\r\n\tend\r\n\tshopping_list\r\nend", "def grocery_list(items)\n hash = Hash.new\n default = 1\n items.split(' ').each { |item|\n hash[item] = default }\n hash\nend", "def create_grocery_list(str)\n items = str.split(\" \")\n grocery_list = Hash.new\n # Alternative way to store items in a list\n # counter = 0\n # while counter < items.length\n # \tgrocery_list.store(items[counter], 1)\n # \tcounter += 1\n # end\n items.each do |item|\n \tgrocery_list.store(item, 1)\n end\n p grocery_list\nend", "def create_list\n item_array = []\n puts \"Enter items, type done when finished\"\n item = gets.chomp\n while item != \"done\"\n \titem_array << item\n \titem = gets.chomp\n end\n grocery_list = {}\n item_array.each { |item| grocery_list[item.to_sym] = 1 }\n puts grocery_list\n grocery_list\nend", "def create_list(input)\n items = {}\n input.split(' ').each do |item|\n items[item] = 0\n end\n print_list(items)\nend", "def create_list(items)\n list = {}\n item_array = items.split(\" \")\n item_array.each do |item|\n list[item] = 1\n end\n print_list(list)\nend", "def create_list(items)\n list = {}\n items = items.split(' ')\n items.each do |item|\n list[item] = 1\n end\n print_list(list)\nend", "def create_list(items)\n $list = {}\n items.split(\" \").each do |item|\n $list[item] = 3\n end\n p $list\nend", "def create_list(items)\n $list = {}\n items.split(\" \").each do |item|\n $list[item] = 3\n end\n p $list\nend", "def new_list(items)\r\n list = {}\r\n split_items = items.split(' ')\r\n split_items.each { |item|\r\n list[item] = 1\r\n }\r\n print_list(list)\r\n list\r\nend", "def grocery_list(empty_string)\n hash = Hash.new(1)\n array = empty_string.split(\" \").each { |x| hash[x]=1 }\n # array.each { |x| hash[x]=1 }\n p hash\nend", "def create_list(items)\n grocery_list_array = items.split(\" \")\n grocery_list = Hash.new\n grocery_list_array.each {|item| grocery_list[item] = 1}\n grocery_list\nend", "def create_list(items)\n items = items.split(' ')\n grocery_list = {}\n items.each do |item|\n grocery_list[item] = 1\n end\n p grocery_list\n grocery_list\nend", "def create_list(item)\n list = {}\n new_item = item.split(\" \")\n \n new_item.each do |food|\n list[food] = 0\n end\n return list\nend", "def print_list(my_list)\r\n# input: \r\n \r\n# steps:\r\n# print to screen: iterate through hash item - quantity\r\n puts '------'\r\n puts \"Grocery list:\"\r\n my_list.each do |item, qty|\r\n puts \"#{item} - #{qty}\"\r\n end\r\n puts '-------'\r\n# output: each k,v pair printed surrounded by dashes\r\nend", "def new_grocery_list(items)\n items_array = items.split\n grocery_hash = {}\n \n items_array.each do |item|\n grocery_hash[item] = 1\n end\n \n print_list(grocery_hash)\n \n \nend", "def make_list(items)\n grocery_bag = {}\n items_array = items.split(' ')\n items_array.each do |item|\n grocery_bag[item] = 1\n end\n p grocery_bag\nend", "def create_list (items)\n item_array = []\n item_array = items.split(' ')\n item_hash = {}\n item_array.each do |list_item|\n item_hash[list_item] = 0\n end\nend", "def create_list(items)\n item_list = items.split(' ')\n grocery_list = {} \n item_list.each do |item|\n grocery_list[item] = 1\n end\n grocery_list \nend", "def create_list(items)\n\n\tgrocery_list_hash = {}\n\tlist_array = items.split(\" \")\n\n\tlist_array.each do |item|\n\t\tgrocery_list_hash.store(item.to_sym, 1)\n\tend\n\n\tgrocery_list_hash\nend" ]
[ "0.7665453", "0.76168394", "0.7438915", "0.74234116", "0.7272734", "0.7244853", "0.72332364", "0.7034979", "0.70265496", "0.69833905", "0.69032085", "0.6901773", "0.6889736", "0.6884736", "0.68624735", "0.68544567", "0.6853886", "0.684291", "0.6842335", "0.6819255", "0.6812664", "0.68014646", "0.6798049", "0.6776214", "0.67652863", "0.67428374", "0.67301357", "0.67244786", "0.67137957", "0.67133254", "0.6689935", "0.6688123", "0.66847605", "0.6668203", "0.6641023", "0.6627129", "0.6621095", "0.660683", "0.66028726", "0.66002905", "0.6599589", "0.6597629", "0.6573364", "0.65704703", "0.65627843", "0.6550287", "0.65424484", "0.65134", "0.6505726", "0.65015495", "0.6493813", "0.6481071", "0.6480028", "0.64739037", "0.6458867", "0.6458432", "0.6445235", "0.6442871", "0.64378977", "0.6437818", "0.6433238", "0.642469", "0.64216644", "0.6412061", "0.6407955", "0.6404403", "0.64036286", "0.63970697", "0.6395065", "0.6391894", "0.6389991", "0.6378769", "0.63734317", "0.637046", "0.6370314", "0.63670415", "0.63666993", "0.6349612", "0.63465816", "0.6334576", "0.6334053", "0.6329361", "0.6323772", "0.6302451", "0.63007814", "0.6293422", "0.6292185", "0.62874347", "0.62874347", "0.62866217", "0.6282249", "0.6279796", "0.6274952", "0.6270834", "0.6269195", "0.6256133", "0.6253031", "0.6250105", "0.6249345", "0.624689" ]
0.62439126
100
TEST create ("carrots apples cereal pizza") Method to add an item to a list input: list, item, quantity steps: add new items into hash output: modified hash
def add_item (list, item, qty) list[item]=qty end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(list_name, item, quantity=1)\r\n# input: list, item name, and optional quantity\r\n# steps: add item and its quantity to the hash\r\n list_name.store(item, quantity)\r\n# output: hash with new item\r\n p list_name\r\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def add_item(list, name, quantity = 1) \r\n# input: item name and optional quantity\r\n# steps: \r\n# create add method with name and optional quantity arguments\r\n# add name and quantity to hash\r\n list[name] = quantity\r\n# output: print \"your item has been added to the hash\"\r\n return list\r\nend", "def additem(list, item, number = 1)\n# input: hash, item name and optional quantity\n# steps: push an item into the hash\n list.store(item, number)\nend", "def add_item(my_list, item, quantity)\r\n #input: a string seperated by an integer \r\n #steps: use a method that adds an item and quantity to the hash.\r\n my_list.store(item, quantity)\r\n # use a hash or store method hash.merge!(key => value) \r\n #output = hash with the updated item/quantity. \r\n my_list\r\n \r\nend", "def add_item(list, item, quantity=1)\r\n# input: item name and optional quantity\r\n# steps: \r\n # Use shopping list as input\r\n # Use the item to be added as 2nd input\r\n # Use the item quantity as a 3rd input (look up whether optional input is possible)\r\n # Add the item and quantity to the shopping list\r\n list[item] = quantity\r\n# output: shopping list with the added item and quantity\r\n printlist(list)\r\nend", "def add_item(hash_list, new_item, quantity = 1)\n hash_list[new_item] = quantity\n p hash_list\nend", "def add_item(list, item_name, optional_quantity)\n\nlist[item_name] = optional_quantity\n\n# input: list, item name, and optional quantity\n# steps:\n # Add new hash key based on item name\n # Tell method there may or may not be a argument passed in for quantity\n # assign quantity to 'optional-quantity' argument in method definition\n # Access method that contains initialized hash def add_item(create_list, item_name, quantity = 3)\n# output:\n # updated grocery list\nend", "def add_item(list, item, quantity = 1)\r\n# input: list, item name, and optional quantity\r\n# steps: \r\n # check for optional quantity. if not present, set to default (1)\r\n list[item] = quantity\r\n # update list with input\r\n puts \"#{item.upcase} has been added to your grocery list!\"\r\n p list\r\n# output: complete list, updated\r\nend", "def list_add(hash_items, item_name, quantity = 1)\n hash_items [item_name] = quantity\n return hash_items\nend", "def add_item(existing_list, new_item, item_integer)\n\t# input: item name and optional quantity\n\t# steps: pass in item name as key and assign value\n\texisting_list[new_item] = item_integer\n\t# output: hash\n\tp existing_list\nend", "def add_item_to_list(list_name,item_to_add,quantity_to_add = 1)\n#create a hash element with the item name and the quantity, if specified\n#if no quantity is specified, default value = 1\n new_item = { \n item_name: item_to_add,\n quantity: quantity_to_add\n }\n# insert the hash into array \n list_name.push(new_item)\n new_item\nend", "def add_item(list, item, quantity)\n\n\tlist[item] = quantity\n\tlist\n\nend", "def add_item(grocery,item_name,quantity)\n # input: list, item name, and optional quantity\n # steps: insert item_name as a key and quantity as a value to the hash \n grocery[item_name] = quantity\n # output:display the latest list\n display_list(grocery)\nend", "def add_to_grocery_list(grocery_list, item_name, quantity=1)\n # steps: add item to hash and set quantity\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n list\nend", "def add_item(item, quantity, list)\r\n list[item] = quantity\r\n p list\r\n list\r\nend", "def add_item(name, quantity, list)\n list[name] = quantity\n p list\n return list\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n p list\nend", "def add_new_items(list, item_name, quantity=1)\n list[item_name] = quantity\n list\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n return list\nend", "def add_item(list, item, qty)\n list[item] = qty\n list\nend", "def add_item(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def add_to_list(list_hash, item, qty)\r\n\tlist_hash[item] = qty\r\n\tlist_hash\t\r\nend", "def add_item(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "def update_item(list, item, quantity)\r\n add_item(list, item, quantity)\r\n# input: Shopping list, item to be updated, new quantity\r\n# steps:\r\n # Use shopping list as input\r\n # Use item to be updated as input\r\n # Use new quantity to be updated as input\r\n # Update the quantity of the item on the list\r\n # list[item] = quantity\r\n# output: shopping list with updated quantity\r\n # printlist(list)\r\nend", "def add_item(list, item, qty)\n list[item] = qty\n p list\nend", "def add_item(list, key, quantity)\n list[\"#{key}\"] = quantity\n list\nend", "def add_item(item, quantity, list)\n\tlist[item] = quantity\n\titem\nend", "def add(list, item, quantity)\r\n\tlist[item] = quantity\r\n\tlist\r\nend", "def add_item(item, quantity=1, hash)\n# get item name and quantity\n# if there's no quantity, set it to 1\n\thash[item] = quantity\n\t# output: return the hash with updated key/value pairs\n\thash\nend", "def add_item(item, list, quantity)\n list[item] = quantity\nend", "def add_item(item,quantity,list)\n\tlist[item] = quantity\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add(input_list, item, quantity)\n input_list[item] = quantity\nend", "def add(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(new_list, item_name, quantity=1)\r\n \r\n new_list[item_name] = quantity\r\n \r\nend", "def add_item(input_hash, item, qty = 0)\n# steps: use input item as key and input quantity as value \n input_hash[item] = qty\n# output: hash data structure of key/value pairs\n return input_hash\nend", "def add_items(list, item_name, quantity=0)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def add(list, item, quantity)\r\n list[item] = quantity\r\n list\r\n\r\nend", "def add_item_to_list(list, new_food, quantity)\n list[new_food] = quantity\n list\nend", "def add_item(shopping_list, item, quantity)\r\n\tshopping_list[item] = quantity\r\n\tshopping_list\r\nend", "def add_item(list, item, quantity)\n #list = item.push\n list[item] = quantity.to_i\n list\nend", "def add_item(list, item, quantity=0)\n list[item] = quantity\n list\nend", "def add_item(hash_of_items, item, quantity=1)\n hash_of_items[item] = quantity\n hash_of_items\nend", "def add_item_to_list(hash, item_to_add, qty)\n hash[item_to_add] = qty\nend", "def add_item(list, item, quantity=1)\n list[item] = quantity\n p list\nend", "def add_item(hash, item, quantity)\r\n\thash.store(item, quantity)\r\n\thash\r\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item, quantity)\n list[item] = quantity\nend", "def add_item(list, item, quantity)\n list[item] = quantity\nend", "def list_add(list, item_name, quantity=1)\n list[item_name] = quantity\n p list\nend", "def add_list(item_name, item_list, quantity = 1)\n item_list[item_name] = quantity\nend", "def add_item(list, item_name, quantity)\n list[item_name.to_sym] = quantity\n list \nend", "def add_item(list, item, quantity=0)\n\tlist[item] = quantity\n\tlist\nend", "def update_quanity(list, item, quantity)\r\n# input: list, item and quantity to be updated to\r\n# steps:\r\n # check if item exists\r\n # update quantity\r\n list[item] = quantity\r\n # print success \"your cart has been updated!\"\r\n puts \"The quantity for #{item.upcase} has been updated in your grocery list!\"\r\n p list\r\n# output: updated list with new quantity\r\nend", "def add_item(list,item_name, qty)\n list[item_name] = qty\nend", "def add_item(list, item, qty=1)\n list[item] = qty\n p \"#{item} : #{list[item]}\"\nend", "def add_item(list, item, quantity=1)\r\n\tlist[item] = quantity\r\n#\tp list\r\nend", "def add (list, item, quantity)\n\tlist[item] = quantity\nend", "def update_quantity(list_name, item, value)\r\n# input: list, item name, new quantity\r\n# steps: find item in the hash and change quantity to new quantity\r\n list_name[item] = value\r\n# output: updated hash with new value for item key\r\n p list_name\r\nend", "def add_change_items(list, item, quantity)\r\n\t#NOTE if changing item make sure to type in 'item' correctly\r\n list[item] = quantity\r\n p list\r\nend", "def list_add(list, item_name, quantity=1)\r\n list[item_name] = quantity\r\n p list\r\nend", "def add_item(item, quantity, list)\n\t# steps: \n\t# if the item is already in the list\n\tif list[item.to_sym] \n\t\t# add to the quantity\n\t\t#list[item.to_sym] = list[item.to_sym] + quantity\n\t\tlist[item.to_sym] += quantity\n\t# otherwise\n\telse\n\t\t# make a new key with the input quantity\n\t\tlist[item.to_sym] = quantity\n\tend\n\t# output:\n\t\t# updated list\n\tlist\nend", "def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend", "def add_item(list, item, quantity = 1)\n list[item] = quantity\n list\nend", "def add_item(list,item,quantity=1)\r\n list[item] = quantity\r\n list\r\nend", "def add_item(list, item_name_string, quantity=1)\r\n\titem_key = item_name_string.to_sym\r\n\tlist[item_key] = quantity\r\n\treturn list\r\nend", "def add_item(hash, item, quantity)\n\t hash[item] = quantity\n\t return hash\nend", "def add_to_list(list,item,quantity)\n\tupdate_item(list,item,quantity)\nend", "def add_item(hash, new_item, qty)\n hash[new_item] = qty\n hash \nend", "def add_item(list_hash, food, quantity = 1)\n list_hash[food] += quantity\n return list_hash\nend", "def add_item(list_hash, food, quantity = 1)\n list_hash[food] += quantity\n return list_hash\nend", "def add_item(list, item_name, quantity=1)\n list[item_name] = quantity\nend", "def add_item(shopping_list, item, quantity=1)\r\n\r\n\tshopping_list[item] = quantity\r\n#\treturn shopping_list\r\nend", "def add_to_list(item,quantity,list)\n list[item]=quantity\nend", "def add_item!(list, item, qty=1)\r\n list[item] = qty\r\n list\r\nend", "def add_item(list, new_item, quantity=1)\n list[new_item] = quantity \nend", "def add_to_list(new_item, quantity)\n #addition = { new_item => quantity }\n addition = Hash.new\n addition[new_item] = quantity\n new_list = addition.merge($old_list.to_h)\n #p new_list\nend", "def add_item_or_update_quantity(hash_of_list, item_name, item_quantity = 1)\n hash_of_list[item_name] = item_quantity\n hash_of_list\nend", "def test_build_line_items_from_hash\n # Create a new order and put just one line item.\n setup_new_order()\n @o.order_line_items << @li\n \n # Now try to feed it with others.\n @o.line_items = {\n items(:red_lightsaber).id => {'quantity' => 2},\n items(:towel).id => {'quantity' => 1},\n items(:blue_lightsaber).id => {'quantity' => \"\"}\n }\n \n assert_equal @o.items.size, 2\n end", "def add_item(list, item_name, quantity = 1)\r\n list[item_name] = quantity\r\nend", "def add_item(list, item, qty = 1)\n list[item] = qty\n\n list\nend", "def add(item, quantity, hash)\n hash[item] = quantity\nend", "def add_item(current_list, item_added, quantity)\n current_list[item_added] = quantity\n current_list\nend", "def add_to_list(list, item, quantity)\n #method to add items\n list[item] = quantity\nend", "def add_item(list, item, qty = 1)\n list[item] = qty\n return list\nend", "def add_item (list, item, quantity = 1)\n\tlist[item] = quantity\n\treturn list\nend", "def add_item(list, new_item, opt_quant)\n list_hash = list\n if opt_quant == nil || opt_quant == 0\n opt_quant = 2\n end\n list_hash[new_item] = opt_quant\n return list_hash\nend", "def update_quantity(list, upd_item, new_quantity)\n# steps:\n # reassign key (item) a new value (quantity)\n list[upd_item] = new_quantity\n # return list\n list\nend", "def add(item, quantity, hash)\n hash[item] = quantity\n puts hash\nend", "def add_item (groceries_list, new_item, quantity)\n\t# add 1 new item to list\n\tgroceries_list.merge!({new_item => quantity})\n\t# return updated list\n\tgroceries_list\n# output: hash\nend", "def create_list(user_list)\n# input: string of items separated by spaces (example: \"carrots apples cereal pizza\")\n# puts \"\"\n# steps:\n # [fill in any steps here]\n list_array = user_list.split(\",\")\n # set default quantity\n quanity = 1\n # print the list to the console [can you use one of your other methods here?]\n p list_array.collect { |item| [item, quanity] }\n $list_hash = Hash[list_array.collect { |item| [item, quanity] } ]\n# output: [what data type goes here, array or hash?] Print result in hash\n p $list_hash\n $list_hash\nend", "def add_list(list,new_item,quantity=1)\n list[new_item] = quantity\n list\nend", "def add_item(hash, new_item, item_quantity)\n hash[new_item] = item_quantity\nend", "def add_item_to_list(string, quantity, hash)\n\thash[string.to_sym] = (hash[string.to_sym] || 0) + quantity\n\tp hash\nend", "def add_item(item,amount=1,the_lists)\r\n\t# steps: accept 2 arguments. Item name and Quantity (with default)\r\n\tif the_lists[item] != nil\r\n\t puts \"Item is already on the List !\"\r\n\t puts \"Added amount to the quantity\"\r\n\t the_lists[item] += amount\r\n\telse\r\n the_lists[item] = amount\r\n\tend\r\n\r\n\tprint_list(the_lists)\r\nend" ]
[ "0.8325434", "0.8278482", "0.8077802", "0.8012966", "0.7872219", "0.78114843", "0.76849246", "0.76555085", "0.7629873", "0.75650144", "0.7531389", "0.7458549", "0.7447121", "0.7419465", "0.73851377", "0.73597777", "0.7353414", "0.73521495", "0.73295164", "0.73235667", "0.7308185", "0.7306128", "0.7303491", "0.7302538", "0.73000854", "0.729949", "0.72712076", "0.72650266", "0.7263055", "0.7259251", "0.7247951", "0.72469974", "0.7240944", "0.723795", "0.723795", "0.7233072", "0.72258383", "0.72170603", "0.7209235", "0.7204678", "0.7198294", "0.71841174", "0.71766675", "0.7164702", "0.71318275", "0.7125136", "0.7122431", "0.71221465", "0.7117785", "0.71167195", "0.7116547", "0.7116547", "0.7115562", "0.7115562", "0.7113006", "0.7109633", "0.7107664", "0.7103637", "0.71034044", "0.7097323", "0.7085408", "0.7081655", "0.7062975", "0.70599353", "0.70590794", "0.70501345", "0.70474315", "0.704659", "0.7037665", "0.7020965", "0.70177346", "0.7008923", "0.7006485", "0.70031327", "0.700048", "0.700048", "0.69889796", "0.69888407", "0.69800407", "0.69778806", "0.6974268", "0.6972204", "0.69618344", "0.6959307", "0.69582206", "0.69539785", "0.6951975", "0.6951771", "0.6948886", "0.694467", "0.6941818", "0.69351107", "0.69346535", "0.69336325", "0.69330525", "0.6906731", "0.69036853", "0.6898532", "0.68864334", "0.6877952" ]
0.7031826
69
Method to remove an item from the list input: modified list and item steps: delete all instances of that key output: modified hash
def remove_item (list, item) list.delete(item) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item(input_hash, item)\n# input: list, item name, and optional quantity\n# steps: use input item to delete key\n input_hash.delete(item)\n# output: hash data structure of key/value pairs\nreturn input_hash\nend", "def remove_item(my_list, item)\r\n# input: an item (something already in the list)\r\n# steps:\r\n my_list.delete(item)\r\n \r\n my_list\r\n# declare hash\r\n# delete method for item\r\n# output: hash with removed item\r\nend", "def remove_item(hash_list, item)\n hash_list.delete(item)\n p hash_list\nend", "def remove_item(list_name, item)\r\n# input: list, item name\r\n# steps: delete item name and value from hash\r\n list_name.delete(item)\r\n# output: updated hash with item removed\r\np list_name\r\nend", "def remove_item(item_to_remove)\n $list_hash.delete_if{|current_item, quantity|item_to_remove==current_item} #goes through entire item in delete if hash if item in hash delete from hash\nend", "def remove_item(list, rm_item)\n# steps:\n # use delete method with key (item) as argument\n list.delete(rm_item)\n # return list\n list\nend", "def remove_item(item, hash)\n hash.delete(item)\n return hash\nend", "def delitem(list, item)\n# input: list and key\n list.delete(item)\n# steps: delete a given key item\nend", "def remove_item(hash_of_items, item)\n hash_of_items.delete(item)\n hash_of_items\nend", "def list_remove(hash_items, item_name)\n hash_items.delete(item_name)\n return hash_items\nend", "def remove_item(item, hash)\n hash.delete(item)\n return hash\nend", "def remove_item(item,the_lists)\r\n\t\t# steps: search the hash for the key that match the item name\r\n the_lists.delete_if{|item_name,item_quantity| item_name == item}\r\n\t\t#then delete the element\r\n\r\n\t\tprint_list(the_lists)\r\nend", "def remove_item(list,item)\r\n list.delete_if {|key,value| key == item}\r\n list\r\nend", "def remove_item(hash, item)\n hash.delete(item)\n return hash\nend", "def remove_item(list, item)\n list_hash = list\n if list_hash.keys.include?(item)\n list_hash.delete(item)\n end\n return list_hash\nend", "def remove_item(hash, item)\r\n\thash.delete(item)\r\n\thash\r\nend", "def remove_item(hash, item)\n hash.delete(item)\n hash\nend", "def remove_item(hash, item)\n hash.delete(item)\n hash\nend", "def remove_item(list, item)\n\t# if list.keys.include?(item)\n\t# \tlist.delete(item)\n\t# end\n\t# list.delete(item) if list.keys.include?(item)\n\tlist.delete_if { |key, value| key == item } \n\t# Destructive method\n\tp list\nend", "def remove(item, hash)\n hash.delete(item)\nend", "def remove_from_list(list_hash, item)\r\n\tlist_hash.delete(item) { |el| \"#{el} not found\" }\r\n\tlist_hash\r\nend", "def remove_item(hash, item)\n hash.delete(item)\nend", "def remove_item(list, item_to_be_removed)\n # if list.has_key? item_to_be_removed\n # list.delete(item_to_be_removed)\n # end\n list.delete(item_to_be_removed) if list.has_key? item_to_be_removed\n list\nend", "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", "def remove_item(list, item)\n if list.has_key?(item)\n list.delete(item)\n else\n puts \"ERROR: Item not in list\"\n end\n return list\nend", "def remove(hash, item)\n hash.delete(item)\nend", "def remove(hash, item)\n hash.delete(item)\nend", "def remove(item, hash)\n hash.delete(item)\n puts hash\nend", "def remove_item_from_list(hash, item_to_remove)\n if hash.has_key?(item_to_remove)\n hash.delete(item_to_remove)\n else\n puts \"It looks like #{item_to_remove} wasn't in the hash after all!\"\n end\nend", "def remove_item(list, name)\r\n# create remove method with name arguments\r\n# check if item is in the hash\r\n if list[name] != nil\r\n# remove item if present\r\n list.delete(name)\r\n end\r\n# output: print \"your item has been deleted from the hash\"\r\n return list\r\nend", "def remove_item(list, item_name)\n # steps:\n # check IF item is included in list\n # delete the item\n # ELSE, print a message to the user\n list.include?(item_name) ? list.delete(item_name) : puts(\"No #{item_name} on the list.\")\n \n # output: return updated hash or the original hash\n list\nend", "def remove(input_list, item)\n input_list.delete(item)\nend", "def removeitem(list, item)\n\n list.delete_if { |iterator| iterator[:item] == item }\nend", "def remove_item(list, key_name)\r\n\tlist.delete(key_name)\r\n\treturn list\r\nend", "def remove_an_item(list_hash,item_name)\n if list_hash[item_name]\n puts \"Deleting item: #{item_name}.\"\n list_hash.delete(item_name)\n else\n puts \"Item does not exist.\"\n end\n\n list_hash\nend", "def remove_from_grocery_list(grocery_list, item_name)\n # steps: remove item from hash\n grocery_list.delete(item_name.to_sym)\n # output: explicit return updated hash\n grocery_list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(hash, item)\n if hash.has_key?(item)\n hash.delete(item)\n end\n return hash\nend", "def delete_item(hash, item)\n\thash.delete(item)\n\treturn hash \nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(hash, item_name)\r\n hash.delete(item_name)\r\n hash\r\nend", "def remove_from_list(item_to_rmv)\n item_to_rmv.to_str\n updated_list = Hash.new\n updated_list = $old_list.to_h\n #updated_list.delete_if {|key, value| key == item_to_rmv}\n if updated_list.include?(item_to_rmv) == true \n #p \"test\"\n #p item_to_rmv\n #p $old_list\n p updated_list.delete(item_to_rmv)\n p updated_list.each {|key, val| p key, val}\n #p updated_list\n else \n p \"that item isn't on the list\"\n end\n #if $old_list.to_h.include?(item_to_rmv) == true\n # updated_list.delete(item_to_rmv)\n # updated_list = $old_list.to_h\n #else\n # p \"that item isn't on the list\"\n #end\n \n \nend", "def remove_item(g_hash,item)\n g_hash.delete(item)\nend", "def remove_item(g_hash,item)\n g_hash.delete(item)\nend", "def remove_item(list, item_name)\n if list.has_key?(item_name)\n list.delete(item_name)\n end\n list\nend", "def remove_item(list, list_item)\n if list.has_key?(list_item)\n list.delete(list_item)\n else\n puts \"Item is not in list\"\n end\n p list\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item (item)\n item_hash[item].delete\nend", "def remove_item(list, item_removed)\n list.delete(item_removed)\nend", "def remove_item(list, item)\r\n# input: shopping list and item to be removed\r\n# steps: \r\n # Use shopping list as input\r\n # Use item to be removed as input\r\n # Remove the item from the list if it exists on the list\r\n list.delete(item)\r\n# output: shopping list with item removed\r\n printlist(list)\r\nend", "def remove_item(item_list, item)\r\n item_list.delete(item)\r\n item_list\r\nend", "def remove_item (item,list)\nlist.delete(item)\nlist\nend", "def remove_item(list,item)\r\n\r\n list.delete(item)\r\n list\r\nend", "def remove_item (item, list)\n list.delete(item)\n return list\nend", "def remove_item(item, list)\n list.delete(item)\n return list\nend", "def remove_item(item, list)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item (list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n\tlist.delete(item)\n\tlist\nend", "def remove(item)\n if @hash.include?(item)\n @hash.delete(item)\n item\n else\n nil\n end\n end", "def delete_hash_item(hash, item)\n [item, hash.delete(item)]\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def remove_item(list, item_name)\r\n\tif list.has_key?(item_name)\r\n\t\tlist.delete(item_name)\r\n\tend\r\n\tlist\r\nend", "def remove_item(hash, key)\n hash.delete(key)\n p hash\nend", "def remove(final_list, item)\r\n final_list.delete(item)\r\n end", "def remove_item(new_list, item)\n \n new_list.delete(item)\n \n new_list\nend", "def remove_item(hash,item)\n\tif hash[\"#{item}\"] == hash[\"#{item}\"]\n\t\thash.delete(\"#{item}\")\n\telse puts\n\t\t\"Invalid item\"\n\tend\n\treturn hash\nend", "def remove_item(list, item)\r\n# input: item to be removed, list\r\n# steps: \r\n # check if item exists\r\n # remove item\r\n list.delete(item)\r\n # print success message of item removed\r\n puts \"#{item.upcase} has been removed to your grocery list!\"\r\n p list\r\n# output: updated list\r\nend", "def remove_item(list, item)\n if list.has_key?(item) == false\n puts \"Nothing to remove\"\n else\n list.delete(item)\n end\n list\nend", "def remove_item!(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(item_to_be_removed)\n $groceryhash.delete(item_to_be_removed)\nend", "def remove_item(list,item)\n\tlist.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\n return list.each {|k,v| puts \"#{k}: #{v}\"}\nend", "def remove_item(list, item)\n\tlist.delete(item)\nend", "def remove_item(updated_hash, food)\n updated_hash.delete(food)\n return updated_hash\nend", "def remove_item(updated_hash, food)\n updated_hash.delete(food)\n return updated_hash\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item_remove)\n list.delete(item_remove)\nend", "def remove_to_list(list, remove_list_key)\r\n list.delete(remove_list_key)\r\n list\r\nend", "def remove(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(list, item)\r\n\tlist.delete(item)\r\n\treturn list\r\nend", "def remove_item(list,item)\n\tlist.delete(item)\n\tp list\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name){|item| list[item] = item_name}\n\tp list\nend", "def del_item(list, item_to_del)\n list.delete(item_to_del)\nend", "def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend", "def remove_item(list,item)\n list.delete(item)\n p list\nend", "def remove_item(list, item_name)\n list.delete(item_name)\n list\nend", "def remove(list, item)\n\tlist.delete(item)\n\tlist\nend", "def remove (list, item)\n\tlist.delete(item)\nend" ]
[ "0.8513027", "0.8449736", "0.82606137", "0.8243336", "0.8191159", "0.79246914", "0.790148", "0.79001886", "0.78839546", "0.7832594", "0.78273636", "0.7810499", "0.77728224", "0.7771637", "0.7771193", "0.77403504", "0.77369833", "0.77369833", "0.77310324", "0.7716798", "0.7655349", "0.76317245", "0.76291144", "0.76231873", "0.7533651", "0.74970794", "0.74970794", "0.74921787", "0.748817", "0.7486118", "0.74711365", "0.7469728", "0.74623185", "0.7459335", "0.7448466", "0.74469906", "0.74363816", "0.7432604", "0.7428796", "0.7418346", "0.7418346", "0.7418346", "0.7418346", "0.74091625", "0.74020076", "0.7401992", "0.73960364", "0.73960364", "0.73888993", "0.7387034", "0.7383186", "0.7383186", "0.73706865", "0.7365583", "0.735133", "0.73463917", "0.7345751", "0.7344297", "0.7342112", "0.73302424", "0.73290294", "0.7326661", "0.7322737", "0.7317255", "0.73170704", "0.73170704", "0.73092026", "0.73054045", "0.7304308", "0.7301647", "0.7296615", "0.72845995", "0.7281256", "0.7277505", "0.726831", "0.726706", "0.72555417", "0.7248915", "0.7247067", "0.7235774", "0.72278607", "0.7226179", "0.72191286", "0.7208501", "0.7208501", "0.719756", "0.719756", "0.71969175", "0.71960664", "0.71869147", "0.7178169", "0.7177344", "0.71763563", "0.7169019", "0.7150877", "0.7150594", "0.7150409", "0.71263564", "0.7118445", "0.711399" ]
0.7411385
43
TEST remove_item(grocery_list, "cereal") Method to update the quantity of an item input: modified list, item, new quantity steps: call hash key directly to modify value with new quantity. overwrites value (qty) for the key (item output: modified key and value added to existing hash
def update (list, item, qty) list[item] = qty end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item(input_hash, item)\n# input: list, item name, and optional quantity\n# steps: use input item to delete key\n input_hash.delete(item)\n# output: hash data structure of key/value pairs\nreturn input_hash\nend", "def update_quantity(list, upd_item, new_quantity)\n# steps:\n # reassign key (item) a new value (quantity)\n list[upd_item] = new_quantity\n # return list\n list\nend", "def update_quantity_in_grocery_list(grocery_list, item_name, quantity)\n # steps: update quantity for item\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def update_quantity(list_name, item, value)\r\n# input: list, item name, new quantity\r\n# steps: find item in the hash and change quantity to new quantity\r\n list_name[item] = value\r\n# output: updated hash with new value for item key\r\n p list_name\r\nend", "def update_quanity(list, item, quantity)\r\n# input: list, item and quantity to be updated to\r\n# steps:\r\n # check if item exists\r\n # update quantity\r\n list[item] = quantity\r\n # print success \"your cart has been updated!\"\r\n puts \"The quantity for #{item.upcase} has been updated in your grocery list!\"\r\n p list\r\n# output: updated list with new quantity\r\nend", "def remove_from_grocery_list(grocery_list, item_name)\n # steps: remove item from hash\n grocery_list.delete(item_name.to_sym)\n # output: explicit return updated hash\n grocery_list\nend", "def remove_item(list_name, item)\r\n# input: list, item name\r\n# steps: delete item name and value from hash\r\n list_name.delete(item)\r\n# output: updated hash with item removed\r\np list_name\r\nend", "def update_quantity(groceries_list, item, new_quantity)\n\t# Change value for inputted key to the desired quantity\n\tgroceries_list [item] = new_quantity\n\tgroceries_list\nend", "def item_remover(hash, item, quantity = 1)\n hash[item] -= quantity\n if hash[item] <= 0\n hash.delete(item) \n end\n hash\nend", "def change_quantity(list, item, new_qty)\n list[item] = new_qty\nend", "def update_qty(list_hash, item, qty)\r\n \tlist_hash[item] = qty\r\n \tlist_hash\r\nend", "def update_quantity(grocery,item_name,new_quantity)\n # input:list, item name, and new_quantity\n # steps: change old value of item_name with the new_quantity\n grocery[item_name] = new_quantity\n # output: display the latest list\n display_list(grocery)\nend", "def update_quantity(grocery_list, item_to_update, qty)\n grocery_list[item_to_update] = qty\n grocery_list\nend", "def change_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def update_item_quantity(hash_of_items, item, quantity)\n hash_of_items[item] = quantity\n hash_of_items\nend", "def update_quantity(grocery_list, item, quantity)\r\n\tgrocery_list[item] = quantity\r\n\tgrocery_list\r\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list\nend", "def update_quantity(grocery_list, item, new_quantity)\n\tif grocery_list.include?(item.to_sym)\n\t\tgrocery_list[item.to_sym] = new_quantity\n\telse\n\t\tputs \"item name invalid\"\n\tend\nend", "def update_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(item, new_quantity, grocery_list)\n grocery_list[item] = new_quantity\nend", "def update_qty(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "def update_qty(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def update_item(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list \nend", "def remove_item(item_to_be_removed)\n $groceryhash.delete(item_to_be_removed)\nend", "def update_quantity_of_items(list, item, quantity)\n list[item] = quantity\nend", "def remove_item(my_list, item)\r\n# input: an item (something already in the list)\r\n# steps:\r\n my_list.delete(item)\r\n \r\n my_list\r\n# declare hash\r\n# delete method for item\r\n# output: hash with removed item\r\nend", "def add_to_grocery_list(grocery_list, item_name, quantity=1)\n # steps: add item to hash and set quantity\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def update_item(list, name, change_in_quantity)\n normalize_string(name)\n if (list[name] + change_in_quantity <= 0)\n remove_item(list, name)\n else\n list[name] += change_in_quantity\n return list\n end\nend", "def update_quantity(grocery_list, item, new_quantity)\n grocery_list[item] = new_quantity\n return grocery_list\nend", "def update_quanity(list, item_name, new_quantity)\n\n\tlist[item_name] = new_quantity\n\tp list\nend", "def update_quantity (grocery_list, item, quantity)\n\tif grocery_list[item] == nil\n\t\tputs \"Item not on list.\"\n\telse\n\t\tadd_item(grocery_list, item, quantity)\n\tend\n\treturn grocery_list\nend", "def delete_item(grocery,item_name)\n # input: list, item name.\n # steps: delete item_name from the hash\n grocery.delete(item_name)\n # output: display the latest list\n display_list(grocery)\nend", "def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend", "def remove_item(item_to_remove)\n $list_hash.delete_if{|current_item, quantity|item_to_remove==current_item} #goes through entire item in delete if hash if item in hash delete from hash\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity.to_i \n grocery_list\nend", "def update_quantity(hash, item, quantity)\n\thash[item] = quantity\n\treturn hash\nend", "def update_item(grocery_hash, grocery, quantity)\n grocery_hash[grocery] = quantity\nend", "def update_quantity(list, item, updated_quantity)\n list[item] = updated_quantity\n list\nend", "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "def update_item(updated_item, updated_item_quantity, grocery_hash) \n grocery_hash[updated_item] = updated_item_quantity\n return grocery_hash\nend", "def update_qty(item, item_qty, grocery_list)\n grocery_list[item] = item_qty\n # print_list(grocery_list)\n grocery_list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(item, grocery_hash={}, quantity)\n\tif grocery_hash.include?(item)\n\t\tgrocery_hash[item] = quantity\n\tend\n\treturn grocery_hash\nend", "def use_item(item_name:, quantity:)\n total_items_quantity[item_name] -= quantity\n end", "def remove_item(remove_item, grocery_hash) \n grocery_hash.delete(remove_item)\n return grocery_hash\nend", "def update_quantity(item, grocery_list, quantity)\n grocery_list[item] = quantity\n return grocery_list\n end", "def update_quantity(item, grocery_list, quantity)\n grocery_list[item] = quantity\n return grocery_list\n end", "def update_quantity (item, quantity)\n item_hash[item] = quantity\nend", "def update_quantity (grocery_list, item, quantity)\n if grocery_list[item] == nil\n \tputs \"Item not on list.\"\n else\n \tadd_item(grocery_list,item,quantity)\n end\n return grocery_list\n print_list(grocery_list)\nend", "def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend", "def remove_item(list, rm_item)\n# steps:\n # use delete method with key (item) as argument\n list.delete(rm_item)\n # return list\n list\nend", "def update_quantity(list, item, quant)\n list[item] = quant\nend", "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend", "def update_item_quantity(hash, item, quantity)\n hash[item] = quantity\n hash\nend", "def update_quantity(list, item_name, qty)\n list[item_name] = qty\nend", "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\n\treturn list\r\nend", "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "def update(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "def update_quantity(item, quantity)\n # puts \"List with updated value of #{quantity} for #{item}:\"\n $grocery_list[item] = quantity\n $grocery_list\nend", "def remove_item(grocery_hash, grocery)\n grocery_hash.delete(grocery)\nend", "def change_quantity(list, item, new_quantity)\n list[item] = new_quantity\n p list\nend", "def update_quantity(item, list, quantity)\n list[item] = quantity\n return list\nend", "def update_item_quantity(list_hash,item_name,quantity)\n if list_hash[item_name]\n puts \"Updated the quantity of #{item_name} to: #{quantity}.\"\n list_hash[item_name] = quantity\n else\n puts \"Item does not exist.\"\n end\n\n list_hash\nend", "def update_quantity(list, item, quant)\n list[item] = quant\nend", "def update_quantity(grocery_list,item,new_quantity)\n # if item on the list\n grocery_list.store(item,new_quantity)\n puts \"When you pick up #{item}, make sure to grab #{new_quantity} instead.\"\nend", "def change_quantity(item_to_be_changed, quantity)\n $groceryhash[item_to_be_changed.to_sym] = quantity\n p $groceryhash\nend", "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "def update_qty(list, item_to_update, new_qty)\n # if list.has_key? item_to_update\n # list[item_to_update] = new_qty\n # end\n list[item_to_update] = new_qty if list.has_key? item_to_update\n list\nend", "def remove_item(list, item)\r\n# input: item to be removed, list\r\n# steps: \r\n # check if item exists\r\n # remove item\r\n list.delete(item)\r\n # print success message of item removed\r\n puts \"#{item.upcase} has been removed to your grocery list!\"\r\n p list\r\n# output: updated list\r\nend", "def update_item(list, item, quantity)\r\n add_item(list, item, quantity)\r\n# input: Shopping list, item to be updated, new quantity\r\n# steps:\r\n # Use shopping list as input\r\n # Use item to be updated as input\r\n # Use new quantity to be updated as input\r\n # Update the quantity of the item on the list\r\n # list[item] = quantity\r\n# output: shopping list with updated quantity\r\n # printlist(list)\r\nend", "def change_qty(list, item, qty)\n if list.has_key?(item) == false\n puts \"Item not found\"\n else\n qty.to_i\n list[item] = qty\n end\n list\nend", "def update_groceries(list, item, qty)\n\tlist[item] = qty\n\tp list\nend", "def update_item(list,item,quantity)\n list[item] = quantity\nend", "def update_item(list,item,quantity)\n list[item] = quantity\nend", "def update_quantity(item, quantity, hash)\n hash[item] = quantity\n return hash\nend", "def update_quantity(list, item, new)\n if list.has_key?(item)\n list[item] = new\n #This is a different way that merges a new hash to update old hash\n # new_list = {key => new_quantity}\n # list.merge!(new_list) {|key, old_quantity, new_quantity| new_quantity}\n # p list\n end\nend", "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend", "def update_item (list,item,quantity)\n\tlist[item] = quantity\nend", "def update_quantity (quantity, item)\n $list.each do |list_item|\n if list_item[:item] == item\n list_item[:quantity] = quantity\n end\n end\nend", "def update_quantity(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend", "def update_quantity(updated_and_removed, food, quantity)\n updated_and_removed[food] = quantity\n return updated_and_removed\nend", "def update_quantity(updated_and_removed, food, quantity)\n updated_and_removed[food] = quantity\n return updated_and_removed\nend", "def update_quantity(list, item_name, quantity)\n # steps:\n # check IF item is included in list\n # update the item’s quantity\n # ELSE, print a message to the user\n list.include?(item_name) ? list[item_name] = quantity : puts(\"No #{item_name} on the list.\")\n\n # output: return the updated hash or the original hash\n list\nend", "def update_quantity(grocery_list, grocery_item, new_quantity)\n if grocery_list.has_key?(grocery_item)\n grocery_list[grocery_item] = new_quantity\n else\n puts \"Sorry, that's not on the list (check your spelling).\"\n end\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def update_quantity(grocery_list,item_name,quantity)\r\n\t \r\n\t grocery_list[item_name] = quantity\r\n\r\nend", "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def update_quantity(hash, item, quantity)\n hash[item] = quantity\n return hash\nend", "def update_quantity(input_hash, item, qty)\n# steps: use input item as key and input quantity as value\n# output: hash \n input_hash[item] = qty\n \nreturn input_hash\nend", "def update_quantity(list, item_name, quantity)\r\n list[item_name] = quantity\r\nend", "def update_quantity(grocery_list, item, quantity)\r\n add_item(grocery_list, item, quantity)\r\n \r\nend" ]
[ "0.7769257", "0.77278125", "0.7676681", "0.757336", "0.7557803", "0.75198805", "0.74278843", "0.74084425", "0.73759836", "0.7366034", "0.73604685", "0.73420167", "0.7340971", "0.732701", "0.7322868", "0.7320516", "0.7283889", "0.728333", "0.72782373", "0.72777706", "0.72746944", "0.7274365", "0.7267673", "0.7264352", "0.72592056", "0.7256435", "0.72551847", "0.7252745", "0.72486943", "0.72450256", "0.7240907", "0.7232973", "0.7228525", "0.7222696", "0.7221034", "0.72187567", "0.7217597", "0.72076494", "0.7198079", "0.71966", "0.71862394", "0.7178519", "0.717767", "0.71771175", "0.7171637", "0.7171637", "0.7168052", "0.7164022", "0.7149903", "0.71472645", "0.71472645", "0.7143708", "0.7140931", "0.71387905", "0.7136498", "0.7135617", "0.7131872", "0.7131872", "0.7128994", "0.71147984", "0.7112293", "0.711043", "0.71101344", "0.7097407", "0.7097339", "0.7096225", "0.70960444", "0.7094932", "0.7093597", "0.70920485", "0.7090671", "0.7087271", "0.70842063", "0.7081452", "0.7081452", "0.70793164", "0.70768684", "0.70753604", "0.70627767", "0.70617574", "0.70595163", "0.70567346", "0.70567346", "0.7056604", "0.7054326", "0.7047462", "0.7045688", "0.70419794", "0.70379156", "0.7031865", "0.7031865", "0.70297605", "0.70237696", "0.702275", "0.7020581", "0.7019414", "0.7019414", "0.7019181", "0.7017834", "0.7017547", "0.7012952" ]
0.0
-1
TEST update(grocery_list, "pizza", 2) Method to print a list and make it look pretty input: modified existing hash steps: print out each key/value pair output: The keys/value pair on a new line.
def print_hash(list) puts "Current grocery list:" puts "---------------------" list.each do |item_name, item_quant| puts " #{item_name}: #{item_quant}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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_list(my_list)\r\n# input: \r\n \r\n# steps:\r\n# print to screen: iterate through hash item - quantity\r\n puts '------'\r\n puts \"Grocery list:\"\r\n my_list.each do |item, qty|\r\n puts \"#{item} - #{qty}\"\r\n end\r\n puts '-------'\r\n# output: each k,v pair printed surrounded by dashes\r\nend", "def pretty_up(list)\n puts \"\\nHere is your grocery list: \"\n list.each do |key, value|\n puts value.to_s + ' ' + key.to_s\n end\nend", "def prettyfie_list(hash)\r\n puts \"This is your current grocery list:\"\r\n puts \"\\n\"\r\n hash.each {|key, value| puts \"#{key} quantity = #{value}\" }\r\n puts \"\\n\"\r\nend", "def pretty_list(hash)\r\n puts \"Grocery List:\"\r\n puts \" \"\r\n hash.each do |item_name, quantity|\r\n puts \"#{item_name}: #{quantity}\"\r\n end\r\nend", "def pretty_list(list)\n puts \"Grocery List:\"\n list.each do |key, value|\n puts \"#{value} #{key}(s)\"\n end\n \nend", "def format_list(list)\n puts \"Your grocery list:\"\n list.each do |key, value|\n puts \"#{key}: #{value}\"\n end\nend", "def print_list(list_name)\r\n# input: hash name\r\n# steps: add dashes and spacing\r\np \"List:\"\r\nlist_name.each do |key, value|\r\n p \"#{key}: #{value}\"\r\nend\r\n# output: pretty hash listed\r\nend", "def print_list(update_items_list)\n update_items_list.each do |key, value|\n p \"I plan to buy #{value} #{key}.\"\n end\nend", "def print_list(item_list)\r\n\t# steps: iterate through each of hash element\r\n\t# print the header\r\n puts \"=========================\"\r\n\tputs \"== Grocery List So Far ==\"\r\n\tputs \"=========================\"\r\n\titem_list.each do |item,quantity|\r\n\t\t# display each element key and the value to make it look pretty\r\n\r\n\t\tputs item.ljust(20)+quantity.to_s\r\n\tend\r\nend", "def print_list(list)\n list_hash = list\n puts \"This is our grocery list: \"\n list_hash.each do |item_key, quant_value|\n puts \"#{item_key}: #{quant_value}\"\n end\nend", "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(grocery_hash={})\n\tputs \"*\" * 40\n\tputs \"Grocery List\"\n\tputs \"*\" * 40\n\tgrocery_hash.each do |food, quantity| puts \"#{food}:\".ljust(30) + \"#{quantity}\".rjust(10)\n\tend\n\tputs \"\"\nend", "def print_list(hash)\n puts \"Grocery list:\"\n hash.each {|item, quantity| puts \"#{item} - #{quantity}\"}\nend", "def print_list\n $old_list.to_h\n p \"Sooooo, you have\"\n $old_list.each {|key, val| p \"#{val} #{key}s\" }\n p \"Wow. It must feel good to be so loaded.\"\nend", "def print_list(grocery_list)\n grocery_list.each do | key, value |\n \tputs \"#{key}: #{value.to_s}\"\n end\nend", "def print_grocery_list(grocery_list) \n\t# create title and line break\n\tputs \"Current grocery list:\"\n\tputs \"----------\"\n\t# iterate through hash\n\tgrocery_list.each do |item, quantity|\n\t\t# print each item with its quantity\n\t\tputs \"#{item}: #{quantity}\"\n\tend\n\t# create line break for readability\n\tputs \"----------\"\nend", "def print_list (grocery_hash)\n puts \"Here is your list:\"\n grocery_hash.each do |key, value|\n puts \"#{key}: #{value}\"\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 pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend", "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "def print_list(grocery_list)\n\tgrocery_list.each do | key, value |\n\t\tputs \"#{key}: #{value.to_s}\"\n\tend\nend", "def print_list(list_hash)\r\n\tlist_hash.each {|key, value| puts \"#{key}; qty: #{value}\" }\r\nend", "def grocery_printed_pretty(groceryhash)\n $groceryhash.map do |food_item, food_quantity|\n puts \"#{food_item.to_s} : #{food_quantity}\"\n end\nend", "def pretty_list(grocery_list)\n puts \"Shopping List\"\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n puts \"Happy Shopping!\"\nend", "def look_pretty(grocery_hash)\n grocery_hash.each do |grocery, quantity|\n puts \"We need #{grocery}: #{quantity}\"\nend\n \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)\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 print_list(list)\n p \"Shopping List:\"\n list.each do |k, v|\n p \"Item: #{k}, Qauntity: #{v}\"\n end\nend", "def print_list(list) \n puts \"Your grocery list includes:\"\n\n list.each do |key, value|\n puts \"#{key} = #{value}\" \n end\nend", "def pretty_print_list(hash)\n\thash.each do |key, value|\n\t\tputs \"You need #{value}, #{key}\"\n\tend\nend", "def print_list(new_list)\r\n\tnew_list.each do |key,value|\r\n\t\tputs \"#{value} #{key}\"\r\n\tend\r\nend", "def print_list()\n $list_hash.each do |current_item, quantity|\n p \"#{current_item.strip}: #{quantity.to_i}\"\n end\nend", "def print_list(hash)\n\tputs \"\" \n hash.each do |item, qty|\n puts \"#{item}: #{qty}\\n\"\n end\nend", "def print_pretty(grocery_list)\r\n\tgrocery_list.each do |item, quantity| \r\n\t\tputs \"you bought #{quantity} #{item}\"\r\n\tend\r\nend", "def print_list(new_list)\n\tnew_list.each do |key,value|\n\t\tputs \"#{value} #{key}\"\n\tend\nend", "def beautify_list(list)\n puts \"Grocery List\"\n puts \" Item: Quantity\"\n list.each do |list_item, item_quantity|\n puts \" #{list_item} : #{item_quantity}\"\n end\nend", "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 list_print(hash_items)\n printf(\"%20s%20s\\n\", '---------------','---------------')\n printf(\"%20s%20s\\n\", 'Item','Quantity')\n printf(\"%20s%20s\\n\", '---------------','---------------')\n\n hash_items.each do |x,y|\n printf(\"%20s%20s\\n\", x.upcase, y)\n end\n\nend", "def hash_printer(hash)\n puts \"Grocery List\"\n hash.each do |key, value|\n puts \"You need #{value} #{key}(s).\"\n end\nend", "def print_list(list)\n puts \"Your shopping list:\"\n list.each do |k, v|\n puts \"#{k} -- #{v}\"\n end\nend", "def print_list(hash)\n width= 50\n puts \"Shopping List\".center(width)\n puts \"\".rjust(50,\"-\")\n print \"Item\".ljust(width/2)\n print \"-\"\n puts \"Quantity\".rjust(width/2)\n puts \"\".rjust(50,\"-\")\n hash.each do |item, quantity|\n puts \"#{item.ljust(width/2)}-#{quantity.to_s.rjust(width/2)}\"\n end\nend", "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(hash)\n puts \"Grocery List\"\n hash.each do |item|\n puts item\nend\nend", "def print_list(input_hash)\n# steps: iterate through the hash and print keys/values\n puts \"Here are the items on your list\"\n input_hash.each do |item, qty|\n p \"For item #{item}, we have #{qty}\" \n end \n# output: nil\nend", "def print_list(grocery_list)\n grocery_list.each { |k, v| puts \"#{v.to_s} #{k}\" }\nend", "def print(list)\r\n\tputs \"Grocery List:\"\r\n\tlist.each do |key,value|\r\n\t\tputs \"#{key} : #{value}\"\r\n\tend\r\nend", "def print_list(hash)\r\n\thash.each do |item, quantity|\r\n\t\tputs \"#{item}, #{quantity}\"\r\n\tend\r\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 print_list(hash)\n hash.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend", "def print_list(hash)\r\n grocery_list=hash\r\n grocery_list.each do |item, quantity|\r\n puts \"You need to get #{quantity} of #{item}\"\r\n end\r\nend", "def print_list(shopping_list)\n puts \"This is your shopping list\"\n shopping_list.each{|k,v| puts \"Item: #{k} Quantity: #{v}\" }\nend", "def pretty_list(list)\n list.each{|food, quantity| puts \"Please get #{quantity} #{food}.\"}\n puts \"Thanks!\"\nend", "def print_list(list_hash)\n list_hash.each do |key,value|\n puts \"The quantity of #{key} is: #{value}\"\n end\nend", "def print_list(grcy_list)\n grcy_list.each do |key, value|\n puts \"You need #{value} #{key}.\"\n end\nend", "def print_list\r\n $grocery_list.keys.each do |item|\r\n puts \"#{item}: #{$grocery_list[item]}\"\r\n end\r\nend", "def print_list\n $list.each {|list_item| puts \"#{list_item[:quantity]} #{list_item[:item]}\"}\nend", "def print_list(complete_list)\n puts \"Here is a list of things of things you need to buy and the amount needed:\"\n complete_list.each {|key, value| puts \"#{value} #{key}\" }\nend", "def print_list(hash)\n hash.each do |x,v|\n puts \"the item is #{x} and the quantity is #{v}.\"\n end\nend", "def print_list(list)\r\n list.each {|key,value| puts \"You need #{value} #{key}(s).\"}\r\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 create_grocery_list(shopping_items)\n # steps:\n # create an empty hash\n grocery_list = {}\n # add items\n # convert input into separate items\n shopping_items = shopping_items.split\n # add items to hash and set default quantity\n shopping_items.each do |item_name|\n grocery_list[item_name.to_sym] = 1\n end\n # print the list to the console [can you use one of your other methods here?]\n print_grocery_list(grocery_list)\n# output: explicit return the hash\n grocery_list\nend", "def pretty_print(list)\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\nend", "def print_list(list)\n puts \"Name \\t\\t Quantity\"\n list.each do |key, value|\n puts \"#{key} \\t\\t #{value}\"\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)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\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 pretty_list(list)\n list.each {|item, quantity| puts \"You need #{quantity} #{item}\"}\nend", "def print_list(new_hash)\n new_hash.each_pair {|key, value| puts \"#{key}: #{value}\"}\nend", "def print_list(new_hash)\n new_hash.each_pair {|key, value| puts \"#{key}: #{value}\"}\nend", "def print_list(hash)\n hash.each do |item, quantity|\n puts item + \" : \" + quantity.to_s\n end\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 lets_go_shopping\r\n\r\n current_list = new_grocery_list\r\n add_new_item(current_list)\r\n remove_an_item(current_list)\r\n update_item_quantity(current_list)\r\n \r\n current_list.each do |key, value|\r\n puts \"Food: #{key}\"\r\n puts \"Qty: #{value}\" \r\n end\r\nend", "def print_list(list)\n grocery_list = \"Grocery List\" + \"\\n\"\n\n list.each do |item, qty|\n grocery_list += \"#{item} : #{qty}\" + \"\\n\"\n end\n\n puts grocery_list\nend", "def print_list(list)\n# input:list\n# steps: iterate through the list\n list.each do |item, number|\n puts \"we have #{number} #{item}\"\n end\n puts \"in our grocery list\"\nend", "def print_list(list)\n puts \"Grocery List\"\n list.each { |item, qty| puts \"#{item}: #{qty}\" }\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(grocery_list)\n grocery_list.each do |item, qty|\n p \"#{item}: #{qty}\"\n end\nend", "def print_list(list)\n puts \"Here's your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "def prettify_list(list)\n\tlist.each do |item, quantity|\n\t\tp \"You have #{quantity} #{item}\"\n\tend\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 pretty(list)\n list.each {|item, quantity| p \"You need to buy #{quantity} of #{item}.\"}\nend", "def print_list(shopping_list)\n puts shopping_list.each {|item, quantity| puts \"#{item}: #{quantity}\"}\nend", "def createlist(items)\n new_items = items.split(\" \")\n list = Hash.new\n new_items.each {|item| list[item] = 1}\n prettylist(list)\n # use print_list method\nend", "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_list(list)\r\n puts \"YOUR LIST:\"\r\n list.each {|key, value| puts \"#{key}: #{value}\"}\r\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(list)\r\n\tputs \"Grocery List\".center(30)\r\n\tlist.each do |item, quantity|\r\n\t\tputs \"#{item} \".ljust(20) + \"#{quantity}\".rjust(10)\r\n\tend\r\nend", "def printhash(hash)\n puts \"-----------------------\"\n hash.each { |item, qty| \n puts \"#{item},\\n qty: #{qty}\"\n puts \"\"\n }\n puts \"-----------------------\"\nend", "def print_list(list)\n\tlist.each do |iterator|\n\tputs \"#{iterator[:item].split.map(&:capitalize).join(' ')} - QTY #{iterator[:qty]}\"\n\tend\n\nend", "def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend", "def pretty(list)\n list = list.map {|k, v| k.capitalize}\n puts \"Grocery list:\" + list\nend", "def print_list(grocery_list)\n\tgrocery_list.each do |item_name, quantity|\n\t\tputs \"#{item_name} => #{quantity}\"\n\tend\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 printed_list(grocery_list)\n grocery_list.each {|item, quantity|\n puts \"#{item}: #{quantity}\" }\nend", "def print_grocery_list(list)\n #print method\n puts \"Here is your grocery list:\"\n #user interface print out\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~\"\n list.each do |key, variable|\n #do loop\n puts \"#{key.capitalize} #{variable}\"\n end\n #ends do loop\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~\"\nend", "def print_list(complete_list)\n\tcomplete_list.each {|key, value| puts \"you want #{value} #{key}\" }\nend", "def print_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{item}, qty: #{quantity}\"\n end\nend" ]
[ "0.79600006", "0.77071047", "0.77007097", "0.7676889", "0.7673049", "0.7530384", "0.7444486", "0.73834115", "0.7252337", "0.7232628", "0.71854717", "0.7148049", "0.71371967", "0.7125083", "0.70946795", "0.70877594", "0.7081908", "0.70806897", "0.70653534", "0.70589316", "0.70549405", "0.70478183", "0.70208997", "0.70138043", "0.7005502", "0.69968694", "0.6993314", "0.69904083", "0.6986204", "0.6986204", "0.6982658", "0.6981372", "0.6978258", "0.69615036", "0.69609284", "0.69566774", "0.69434685", "0.6912422", "0.689936", "0.68952525", "0.6889968", "0.68864536", "0.6885098", "0.68757373", "0.68588006", "0.6851884", "0.684633", "0.6838861", "0.68223107", "0.6811833", "0.6795118", "0.67846125", "0.6738665", "0.6726548", "0.670638", "0.6702621", "0.66894644", "0.6679747", "0.6675842", "0.6667313", "0.666691", "0.66572726", "0.66432965", "0.6639011", "0.662478", "0.66227984", "0.6601816", "0.6601816", "0.6598193", "0.6588756", "0.65822387", "0.65822387", "0.6579057", "0.65764093", "0.65678674", "0.6554642", "0.6549631", "0.65433097", "0.65402037", "0.6535205", "0.65313923", "0.65293485", "0.65254635", "0.65182704", "0.6517424", "0.65057546", "0.6505203", "0.65030646", "0.65026015", "0.64924043", "0.647755", "0.64718103", "0.64657074", "0.64642346", "0.6462412", "0.64603055", "0.6460162", "0.6457652", "0.64471483", "0.64465314" ]
0.73108095
8
Counts the amount of jobs in the (provided) Sidekiq queue(s).
def queue(*queues) queues = queues.flatten.map(&:to_s) queues = ::Sidekiq::Stats.new.queues.map { |name, _| name.to_s } if queues.empty? list = queue_list queues.inject(0) do |memo, name| memo += (list[name.to_s] || 0) memo end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n cnt = 0\n @tasks.each_value { |task| cnt += task.queue_count() }\n cnt\n end", "def queue_count\n @queues.length\n end", "def queue_count()\n @queue.length\n end", "def queue_count()\n cnt = 0\n @flows.each_value { |f| cnt += f.queue_count() }\n cnt\n end", "def queue_count()\n @work_queue.size + super()\n end", "def count\n\t\t@queue.length\n\tend", "def total_count(queue)\n collection.find(conditions(queue)).count\n end", "def sub_queue_count\n sub_queue_obj.count\n end", "def queue_length\n @queues.inject(0) do |length, (_, queue)|\n length + queue.length\n end\n end", "def pending_job_count\n\n @pending_jobs.size\n end", "def queued_messages\n @queue.length\n end", "def queue_length\n @job_queue.length\n end", "def queue_count_key\n \"concurrent.queue_counts\"\n end", "def queued_messages\n @queue.length\n end", "def queue_size(queue)\n Resque.size(queue)\n end", "def work_queue_size()\n @work_queue.size\n end", "def queue_size\n @redis.llen(\"xque:queue:#{@queue_name}\")\n end", "def queued_build_count\n response = get('buildQueue')\n response.count\n end", "def size\n\n @queue.size\n end", "def message_count\n get_queue_message_count(address)\n end", "def message_count(queue)\n connect do |bunny|\n return bunny.queue(queue, :durable => true, :auto_delete => false).message_count\n end\n end", "def queue_length\n @executor.getQueue.size\n end", "def size\n @queue.size\n end", "def size\n @queue.size\n end", "def z_queue_size(queue)\n handle_pipeline(@redis.zcount(redis_key_for_queue(queue), 0, Float::INFINITY), &:to_i)\n end", "def size\n @queue.size\n end", "def ready_count(queue)\n conditions = {:run_at.lte => Time.now.utc}\n conditions[:record_class_name] = queue.class_names unless queue.class_names.empty?\n count(conditions)\n end", "def size\n @mutex.synchronize { @queue.size }\n end", "def size\n @queue.size\n end", "def ready_count(queue)\n conditions = [\"#{connection.quote_column_name('run_at')} <= ?\", Time.now.utc]\n unless queue.class_names.empty?\n conditions.first << \" AND #{connection.quote_column_name('record_class_name')} IN (?)\"\n conditions << queue.class_names\n end\n count(:conditions => conditions)\n end", "def scheduled_messages_count\n with_queue_control do |control|\n control.scheduled_count\n end\n end", "def worker_count()\n @workers.size\n end", "def worker_count()\n @workers.size\n end", "def count\n MsgQ.count(@qid)\n end", "def quantity\n @task_worker_lock.synchronize {@task_workers.size}\n end", "def queue_length\n mutex.synchronize { running? ? @queue.length : 666 }\n end", "def every_job_count\n\n @non_cron_jobs.values.select { |j| j.class == EveryJob }.size\n end", "def size\n # This is a a bit racy - we don't update these two queues atomically\n @queue.size + @active.size\n end", "def at_job_count\n\n @non_cron_jobs.values.select { |j| j.class == AtJob }.size\n end", "def pending_size\n @redis.zcard(\"xque:pending:#{@queue_name}\")\n end", "def jobs_performed\n Resque.redis.get(jobs_performed_key).to_i\n end", "def method()\n @workers.size\n end", "def images_count\r\n images_count = 0\r\n jobs.each do |job|\r\n images_count += job.images_for_jobs.count\r\n end\r\n images_count\r\n end", "def count_messages(filter = nil)\n with_queue_control do |control|\n control.count_messages(filter)\n end\n end", "def waitlist_size\n @queue.size\n end", "def count_jobs\n \tself.bugs.bug_has_closed.count\n end", "def consumer_count\n with_queue_control do |control|\n control.consumer_count\n end\n end", "def num_waiting\n @waiting.size + @queue_wait.size\n end", "def num_waiting\n @waiting.size + @queue_wait.size\n end", "def cron_job_count\n\n @cron_jobs.size\n end", "def length\n @queue.length\n end", "def njobs\n @pool.njobs\n end", "def ready_count(queue)\n collection.find(conditions(queue).merge({\n :attempts => { '$lt' => 5 }, :run_at => { '$lte' => Time.now.utc }, :lock => nil\n })).count\n end", "def length\n @queue.length\n end", "def backlog\n @queues.map{|k,v| [k,v.size]} \n end", "def queue_length\n request_queue.length\n end", "def queue_size\n _get(\"/system/queue-size\") { |json| json }\n end", "def worker_count\n @action == 'run' ? 1 : workers\n end", "def njobs\n @njobs.to_i\n end", "def get_job_count(type='scanner')\n job_count = 0\n framework.jobs.each do |k, j|\n if j.name =~ /#{type}/\n job_count = job_count + 1\n end\n end\n return job_count\n end", "def max_queue_count()\n @max_queue_count\n end", "def num_child_jobs\n @gapi.statistics.num_child_jobs || 0\n end", "def size\n self.queued.inject(0) { |result, data| result + data.last.size }\n end", "def size(name = '.+')\n queues_matching(name).map(&:size).reduce(0, :+)\n end", "def backlog\n @queue.size\n end", "def queue_size(paypal_id)\n queue = @queue_map[paypal_id]\n if(queue.nil?)\n 0\n else\n queue.size\n end\n end", "def get_queue_size\n if @number_of_processes\n @queueSize = @number_of_processes\n else\n @queueSize = DATSauce::PlatformUtils.processor_count * 2\n # get max threads from platform utils\n end\n @queueSize\n end", "def num_waiting\n @queue.num_waiting\n end", "def count(key)\n Sidekiq.redis do |conn|\n conn.llen(namespace_key(key))\n end\n end", "def counters\n {\n files: files_count,\n apps: apps_count,\n workflows: workflows_count,\n jobs: jobs_count,\n members: members_count,\n }\n end", "def total_check_count\r\n check_number = []\r\n self.jobs.each do |job|\r\n if job.parent_job_id.blank?\r\n check_number << job.check_number\r\n end\r\n end\r\n check_number.uniq!\r\n if check_number.nil?\r\n return 0\r\n else\r\n return check_number.size\r\n end\r\n end", "def thread_count\n @worker_threads_count.value\n end", "def sizeof(queue, statistics = nil)\n statistics ||= stats\n\n if queue == :all\n queue_sizes = {}\n available_queues(statistics).each do |queue|\n queue_sizes[queue] = sizeof(queue, statistics)\n end\n return queue_sizes\n end\n\n statistics.inject(0) { |m,(k,v)| m + v[\"queue_#{queue}_items\"].to_i }\n end", "def error_count(queue)\n conditions = {:error.not => nil}\n conditions[:record_class_name] = queue.class_names unless queue.class_names.empty?\n count(conditions)\n end", "def complete_check_count\r\n check_number = []\r\n self.jobs.each do |job|\r\n if job.job_status = JobStatus::COMPLETED\r\n check_number << job.check_number\r\n end\r\n end\r\n check_number.uniq!\r\n if check_number.nil?\r\n return 0\r\n else\r\n return check_number.size\r\n end\r\n end", "def rqcount\n reposts.count + quotes.count\n end", "def size\n if defined?(::Delayed::Backend::Mongoid::Job) && Delayed::Worker.backend == Delayed::Backend::Mongoid::Job\n query = greater_than_priority ? Delayed::Job.gte(priority: priority) : Delayed::Job.lte(priority: priority)\n else\n operator = greater_than_priority ? \">=\" : \"<=\"\n query = Delayed::Job.where(\"priority #{operator} ?\", priority)\n end\n opts = {}\n opts[:queue] = queue if queue\n opts[:locked_at] = nil unless include_locked\n opts[:last_error] = nil unless include_errored\n query.where(opts).count\n end", "def size\n\t\t\t@sequence.size + @queue.size\n\t\tend", "def size\n @que.size\n end", "def sizeof(queue, statistics = nil)\n statistics ||= stats\n\n if queue == :all\n available_queues.inject({}){|h,q| h[q] = sizeof(queue, statistics)}\n else\n IO.popen(\"#{db_stat} -d /tmp/qache/#{queue}\").readlines.\n detect{|line| line =~ /(\\d+)\\tNumber of records in the database\\n/ }\n $1.to_i\n end\n end", "def executions_count\n aj_count = serialized_params.fetch('executions', 0)\n # The execution count within serialized_params is not updated\n # once the underlying execution has been executed.\n if status.in? [:discarded, :succeeded, :running]\n aj_count + 1\n else\n aj_count\n end\n end", "def count_messages\r\n @messages.size\r\n end", "def queue_length\n if system.empty?\n 0\n else\n system.length - 1\n end\n end", "def busy_workers\n if @threadsafe\n 0\n else\n @workers.size - @worker_queue.size\n end\n end", "def applied_count(job)\n job.applied_jobs.where(status: 0).count +\n job.applied_jobs.where(status: 3).count\n end", "def num_queens\n\t\tboard.nil? ? 0 : board.values.select {|a| a == 1}.count\n\tend", "def size\n @q.size\n end", "def tasks_finished_count\n count do |task|\n task.finished?\n end\n end", "def check_queue_size_all\n queue = `#{config[:path]} | /bin/egrep '[0-9]+ Kbytes in [0-9]+ Request\\|Mail queue is empty'`\n queue == 'Mail queue is empty' ? 0 : queue.split(' ')[4].to_i\n end", "def queued_jobs_requesting_gpus_counter(job)\n if is_job_requesting_gpus_and_queued(job)\n #@queued_jobs_requesting_gpus += 1\n return 0\n end\n end", "def tasks_total_count\n tasks.length\n end", "def length\n (@client.redis.multi do\n %w[ locks work scheduled depends ].each do |suffix|\n @client.redis.zcard(\"ql:q:#{@name}-#{suffix}\")\n end\n end).inject(0, :+)\n end", "def task_count()\n @tasks.size\n end", "def gevent_queue_size\r\n return @proc_queue.size\r\n end", "def count\n run.count\n end", "def count\n # nil is for seq_op => it means the all result go directly to one worker for combine\n @count ||= self.map_partitions('lambda{|iterator| iterator.to_a.size }')\n .aggregate(0, nil, 'lambda{|sum, item| sum + item }')\n end", "def count\n with_redis { |redis| redis.scard(@set_key).to_i }\n end", "def tasks_pending_count\n count do |task|\n task.pending?\n end\n end", "def error_count(queue)\n conditions = [\"#{connection.quote_column_name('error')} IS NOT NULL\"]\n unless queue.class_names.empty?\n conditions.first << \" AND #{connection.quote_column_name('record_class_name')} IN (?)\"\n conditions << queue.class_names\n end\n count(:conditions => conditions)\n end", "def num_waiting\n @waiting.size\n end" ]
[ "0.8109058", "0.77909243", "0.76031846", "0.75695056", "0.73891485", "0.7380489", "0.73770404", "0.73154205", "0.7260825", "0.72463125", "0.71987826", "0.7108839", "0.70993125", "0.7090734", "0.70874506", "0.7034426", "0.7032", "0.69567364", "0.6951876", "0.6929466", "0.6925104", "0.68829465", "0.68754405", "0.6864523", "0.6863268", "0.6847021", "0.68107426", "0.68100035", "0.6806193", "0.6804847", "0.6765977", "0.6683185", "0.6683185", "0.6661923", "0.6658122", "0.6651329", "0.6638159", "0.6620597", "0.6602886", "0.6583247", "0.6569788", "0.6558536", "0.65531325", "0.6536515", "0.65287334", "0.6516208", "0.6509162", "0.64959514", "0.64959514", "0.6448251", "0.6435654", "0.6383191", "0.63791865", "0.63789", "0.63782895", "0.6369689", "0.63686967", "0.63334155", "0.6331067", "0.63141066", "0.62969154", "0.6284838", "0.62694377", "0.6247433", "0.6246976", "0.6243104", "0.62178594", "0.62120694", "0.6185511", "0.61693853", "0.61358637", "0.61285657", "0.60963595", "0.60927194", "0.60782295", "0.6076193", "0.6071236", "0.60675853", "0.6050496", "0.60489225", "0.6038879", "0.60187024", "0.6016955", "0.6006559", "0.5987559", "0.5986526", "0.59694123", "0.5951651", "0.5944093", "0.5936965", "0.5930065", "0.5928311", "0.5925644", "0.5911058", "0.59038156", "0.5895236", "0.58861953", "0.5880274", "0.5872677", "0.5870266" ]
0.62735814
62
GET /ambassadorships GET /ambassadorships.json
def index @ambassadorships = Ambassadorship.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end", "def index\n @ships = Ship.all\n end", "def index\n @ships = Ship.all\n end", "def index\n @player_ships = PlayerShip.all\n end", "def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def show\n @clientship = current_user.clientships.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientship }\n end\n end", "def index\n @fleet_ships = FleetShip.all\n end", "def index\n @internships = Internship.all\n @current_user = User.find(current_user.id)\n respond_with(@internships)\n end", "def index\n @ships = Ship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ships }\n end\n end", "def index\n @friendships = Friendship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def index\n @friendships = Friendship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def index\n @manifestships = Manifestship.all\n end", "def index\n @followships = Follower.all\n render json: @followships\n end", "def ambassadors(params = {})\n self.class.get('/ambassador/all', params)\n end", "def index\n # @ships = Ship.paginate(:page => params[:page], :per_page => 5)\n #sorts the ship list by empire and name (remember #sort_by sorts \n #from left to right so you can have multiple criteria)\n ships = Ship.all\n @ships = ships.sort_by { |v| [v[:empire_image], v[:cost]] }\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ships }\n end\n end", "def index\n @shipments = Shipment.all\n render json: @shipments\n end", "def index\n @shipments = Shipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shipments }\n end\n end", "def set_ambassadorship\n @ambassadorship = Ambassadorship.find(params[:id])\n end", "def index\n \n @shipments = Shipment.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shipments }\n end\n end", "def index\n @airplanes = Airplane.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @airplanes }\n end\n end", "def index\n @shipings = Shiping.all\n end", "def show\n @intern = Intern.find(params[:id])\n @internships = Internship.where(intern_id: @intern.id)\n respond_to do |format|\n format.html #show.html.erb\n format.json { render json: @intern }\n end\n end", "def index\n @kinships = Kinship.all\n end", "def index\n @championships = Championship.all\n\n render json: @championships\n end", "def index\n @authorships = Authorship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @authorships }\n end\n end", "def all_followships\n followships = User.find(params[:user_id]).followships\n render :json => followships\n end", "def index\n\t\tboats = Assignment.all\n \trender json: boats, status: 200\n\tend", "def show\n puts @fleet.id\n @ship_hash = @fleet.get_ships\n end", "def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end", "def index\n @job_ships = JobShip.all\n @user = current_user\n end", "def index\r\n @followships = Followship.all\r\n end", "def index\n @followships = Followship.all\n end", "def index\n @ab_reltionships = AbReltionship.all\n end", "def index\n #@shipments = Shipment.all\n @shipments = Shipment.accessible_by(current_ability)\n end", "def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @internship }\n end\n end", "def show\n render json: @onboarding\n end", "def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n end\n end", "def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html \n format.json { render :json => @internship }\n end\n end", "def full_mayorships\n client.user_mayorships(id)\n end", "def index\n if client_signed_in?\n @ships = Refinery::Ships::Ship.includes(:translations, :page_status).where(:client_id=>current_client.id).order('updated_at DESC')\n @all = @ships\n @moderate = @ships.select{|ship| ship.page_status.id == 1}\n @published = @ships.select{|ship| ship.page_status.id == 2}\n if (params[:status]=='1' or params[:status]=='2')\n params[:status]=='1' ? @ships = @moderate : @ships = @published\n end\n else\n redirect_to(root_path)\n end\n end", "def show\n @friendship = @user.friendships.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friendship }\n end\n end", "def index\n @guardianships = Guardianship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guardianships }\n end\n end", "def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.rhtml\n end\n end", "def index\n @airplanes = Airplane.all\n end", "def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend", "def show\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaceship }\n end\n end", "def ambassador(params = {})\n self.class.get('/ambassador/get', params)\n end", "def index\n @onboardings = Onboarding.all\n render json: @onboardings.as_json(:only => [:id, :company_name, :company_uen, :a_corpsecretary, :a_accounting, :a_status, :a_action, :a_date_fye, :a_date_agm, :a_date_renewal, :created_at])\n\n end", "def index\n render json: UserBoards.all\n end", "def index\n @shipfleets = Shipfleet.all\n end", "def friendships_show(options = {})\n @req.get(\"/1.1/friendships/show.json\", options)\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @allocations = Allocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @allocations }\n end\n end", "def index\n @space_stations = SpaceStation.all\n\n render json: @space_stations, include: :astronauts\n\n end", "def index\n @moves = @game.moves.all\n render json: @moves, status: 200\n end", "def index\n\n respond_to do |format|\n format.html { @boards = Board.where network_id: current_user.network_id }\n format.json { @boards = Board.where network_id: current_user.network_id }\n \n end\n end", "def index\n @mentorships = Mentorship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mentorships }\n end\n end", "def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\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 user = User.find(params[:id])\n friendships = user.followers + user.followees\n render json: {user: user, friendships: friendships}\n end", "def index\n @shipments = current_user.shipments\n end", "def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end", "def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end", "def index\n @shipments = Shipment.all\n end", "def index\n @shipments = Shipment.all\n end", "def show\n render json: UserBoards.find(params[\"id\"])\n end", "def index\n @fellowships = Fellowship.all\n end", "def show\n @ship = Ship.find(params[:id])\n \n @ordereditems = ShipItem.find(:all, :conditions => {:ship_id => \"#{@ship.id}\"}, :joins => :item, :order => \"slot\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end", "def index\n @steamshiplines = Steamshipline.all\n end", "def show\n @internship = Internship.find(params[:id])\n @diaries = Diary.where(:internship_id => @internship.id).paginate(:page => params[:page]).order('id DESC')\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @internship }\n end\n end", "def internships\n respond_to do |format|\n format.html # internships.html.erb\n format.xml { render :xml => nil }\n end\n end", "def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end", "def index\n json_response(@board.lists)\n end", "def index\n @ship_weapons = ShipWeapon.all\n end", "def index\n @breeding_pairs = current_user.breeding_pairs.all\n\n respond_to do |format|\n format.json { render json: @breeding_pairs }\n end\n end", "def index\n @cartships = Cartship.all\n end", "def index\n @boards = Board.all\n data = []\n @boards.each do |i|\n data.push({\"name\" => i.name, \"id\" =>i.id.to_s})\n end\n\n render json: data\n #render \"boards/index\"\n end", "def index\n retrieve_and_develop_all_friendships\n end", "def index\n puts @unknown.round(0)\n @shippings = Shipping.all\n end", "def index\n \n @shareables = Shareable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shareables }\n end\n end", "def index\n logger.info(\"-------------->index Friendship session #{session[:login]}\");\n if request.format.json?\n friendships_instance =Friendship.new\n @friendships = friendships_instance.getMyfriends(session[:login]); \n else \n @friendships=Friendship.where(user_id: session[:login])\n end\n\n end", "def index\n #@shipmment_items = ShipmmentItem.all\n @shipmment_items = ShipmmentItem.accessible_by(current_ability)\n\n end", "def show\n render json: @games_leaderboard\n end", "def index\n gateway_alive = GatewayAlive.all\n render json: gateway_alive.to_json(:except => [:id])\n end", "def index\n @ship_groups = ShipGroup.all\n end", "def index\n @hostel_rooms = HostelRoom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hostel_rooms }\n end\n end", "def index\n @ship_armor_slots = ShipArmorSlot.all\n end", "def index\n @flights = Flight.all\n\n respond_to do |format|\n format.html \n format.json { render json: @flights, :include => [:airplane, :reservations, :users, :seats] }\n end\n end", "def index\n airlines = Airline.includes(:airplanes).all.page(page).per(per)\n json_response(PageDecorator.decorate(airlines)\n .as_json(airplanes_details: true), :ok)\n end", "def show\n @internships_user = InternshipsUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internships_user }\n end\n end", "def index\n \n #@sheets = Sheet.include(:game).where(\"user_id = ?\", current_user.id)\n @sheets = current_user.sheets.includes(:game)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sheets }\n end\n end", "def index\n @spaces = Space.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spaces }\n end\n end", "def index\n @bemaps = Bemap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bemaps }\n end\n end", "def index\n @game_codes = GameCode.accessible_by(current_ability)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @game_codes }\n end\n end", "def show\n @flower_ships = FlowerShip.where(flower_order_id: @flower_order.id)\n end", "def index\n @games = Game.all\n render json: @games\n end" ]
[ "0.70189935", "0.6638649", "0.6638649", "0.6504566", "0.64973927", "0.64056635", "0.6387467", "0.63668627", "0.63471466", "0.63451767", "0.63451767", "0.63426745", "0.6336469", "0.6313026", "0.63055575", "0.62719774", "0.615957", "0.6158081", "0.6155434", "0.61181337", "0.61036724", "0.60605454", "0.6043275", "0.6025218", "0.59919816", "0.59821856", "0.59780365", "0.5961778", "0.59553653", "0.5950401", "0.59325665", "0.59299064", "0.587249", "0.58659023", "0.5864096", "0.5857677", "0.5852367", "0.5832649", "0.58303493", "0.5817362", "0.58145833", "0.58104336", "0.5807739", "0.5806326", "0.57903755", "0.57901895", "0.5765961", "0.57634765", "0.5749929", "0.574833", "0.57370764", "0.5731943", "0.57296616", "0.57296616", "0.57296616", "0.57296616", "0.571415", "0.5694726", "0.56877375", "0.5687437", "0.5680313", "0.567255", "0.5669736", "0.5656504", "0.56517196", "0.56439865", "0.56439865", "0.5640544", "0.5640544", "0.5635267", "0.5634492", "0.5631988", "0.56178147", "0.561141", "0.5607986", "0.5604198", "0.5603765", "0.5597356", "0.55956", "0.55927205", "0.5588353", "0.5587188", "0.5586677", "0.55862087", "0.55834705", "0.55816734", "0.55732334", "0.5569471", "0.5557024", "0.55552065", "0.5550247", "0.55471206", "0.55428094", "0.5536516", "0.5532165", "0.55264103", "0.55257314", "0.55220073", "0.5519151", "0.55118924" ]
0.7758714
0
GET /ambassadorships/1 GET /ambassadorships/1.json
def show; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @ambassadorships = Ambassadorship.all\n end", "def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end", "def show\n @clientship = current_user.clientships.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientship }\n end\n end", "def index\n @ships = Ship.all\n end", "def index\n @ships = Ship.all\n end", "def index\n @player_ships = PlayerShip.all\n end", "def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def index\n @manifestships = Manifestship.all\n end", "def index\n @fleet_ships = FleetShip.all\n end", "def show\n puts @fleet.id\n @ship_hash = @fleet.get_ships\n end", "def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n end\n end", "def set_ambassadorship\n @ambassadorship = Ambassadorship.find(params[:id])\n end", "def show\n @intern = Intern.find(params[:id])\n @internships = Internship.where(intern_id: @intern.id)\n respond_to do |format|\n format.html #show.html.erb\n format.json { render json: @intern }\n end\n end", "def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @internship }\n end\n end", "def show\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaceship }\n end\n end", "def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html \n format.json { render :json => @internship }\n end\n end", "def index\n @ships = Ship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ships }\n end\n end", "def show\n @friendship = @user.friendships.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friendship }\n end\n end", "def index\n # @ships = Ship.paginate(:page => params[:page], :per_page => 5)\n #sorts the ship list by empire and name (remember #sort_by sorts \n #from left to right so you can have multiple criteria)\n ships = Ship.all\n @ships = ships.sort_by { |v| [v[:empire_image], v[:cost]] }\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ships }\n end\n end", "def index\n @friendships = Friendship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def index\n @friendships = Friendship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end", "def index\n @internships = Internship.all\n @current_user = User.find(current_user.id)\n respond_with(@internships)\n end", "def index\n @followships = Follower.all\n render json: @followships\n end", "def index\n @shipments = Shipment.all\n render json: @shipments\n end", "def p1ships\n @p1ships\n end", "def show\n @monitorship = Monitorship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monitorship }\n end\n end", "def index\n @shipings = Shiping.all\n end", "def show\n render json: UserBoards.find(params[\"id\"])\n end", "def index\n @airplanes = Airplane.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @airplanes }\n end\n end", "def show\n render json: @onboarding\n end", "def index\n @shipments = Shipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shipments }\n end\n end", "def index\n @championships = Championship.all\n\n render json: @championships\n end", "def index\n @kinships = Kinship.all\n end", "def index\n \n @shipments = Shipment.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shipments }\n end\n end", "def show\n @internships_user = InternshipsUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internships_user }\n end\n end", "def index\n\t\tboats = Assignment.all\n \trender json: boats, status: 200\n\tend", "def show\n @airplane = Airplane.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @airplane }\n end\n end", "def show\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friendship }\n end\n end", "def show\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friendship }\n end\n end", "def show\n @ship = Ship.find(params[:id])\n \n @ordereditems = ShipItem.find(:all, :conditions => {:ship_id => \"#{@ship.id}\"}, :joins => :item, :order => \"slot\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end", "def index\n @followships = Followship.all\n end", "def index\r\n @followships = Followship.all\r\n end", "def show\n @ship_class = ShipClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship_class }\n end\n end", "def index\n if client_signed_in?\n @ships = Refinery::Ships::Ship.includes(:translations, :page_status).where(:client_id=>current_client.id).order('updated_at DESC')\n @all = @ships\n @moderate = @ships.select{|ship| ship.page_status.id == 1}\n @published = @ships.select{|ship| ship.page_status.id == 2}\n if (params[:status]=='1' or params[:status]=='2')\n params[:status]=='1' ? @ships = @moderate : @ships = @published\n end\n else\n redirect_to(root_path)\n end\n end", "def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end", "def show\n @ambush = Ambush.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ambush }\n end\n end", "def show\n @ship = Ship.find(params[:id])\n @weapon = WeaponCard.find_by_ship_id(params[:id])\n @weapon_card = WeaponCard.new\n weapon_names = Weapon.all\n @weapon_names = {}\n weapon_names.each do |name|\n @weapon_names[name.name] = name.id\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n format.js\n end\n end", "def ambassadors(params = {})\n self.class.get('/ambassador/all', params)\n end", "def show\n @internship = Internship.find(params[:id])\n @diaries = Diary.where(:internship_id => @internship.id).paginate(:page => params[:page]).order('id DESC')\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @internship }\n end\n end", "def friendships_show(options = {})\n @req.get(\"/1.1/friendships/show.json\", options)\n end", "def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end", "def all_followships\n followships = User.find(params[:user_id]).followships\n render :json => followships\n end", "def index\n @job_ships = JobShip.all\n @user = current_user\n end", "def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.rhtml\n end\n end", "def index\n @airplanes = Airplane.all\n end", "def show\n @flower_ships = FlowerShip.where(flower_order_id: @flower_order.id)\n end", "def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html { render layout: 'dialog'} # show.html.erb\n format.json { render json: @ship }\n end\n end", "def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend", "def index\n @authorships = Authorship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @authorships }\n end\n end", "def index\n @guardianships = Guardianship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guardianships }\n end\n end", "def index\n\n respond_to do |format|\n format.html { @boards = Board.where network_id: current_user.network_id }\n format.json { @boards = Board.where network_id: current_user.network_id }\n \n end\n end", "def index\n @shipfleets = Shipfleet.all\n end", "def index\n #@shipments = Shipment.all\n @shipments = Shipment.accessible_by(current_ability)\n end", "def show\n @neighborhood = Neighborhood.find(params[:id])\n\n render json: @neighborhood\n end", "def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end", "def show\n @championship = Championship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @championship }\n end\n end", "def index\n @steamshiplines = Steamshipline.all\n end", "def index\n @moves = @game.moves.all\n render json: @moves, status: 200\n end", "def index\n render json: UserBoards.all\n end", "def show\n render json: @championship\n end", "def internships\n respond_to do |format|\n format.html # internships.html.erb\n format.xml { render :xml => nil }\n end\n end", "def full_mayorships\n client.user_mayorships(id)\n end", "def index\n @friendships = Friendship.all\n end", "def show\n @guardianship = Guardianship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guardianship }\n end\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def index\n @friendships = Friendship.all\n end", "def show\n render json: @games_leaderboard\n end", "def index\n puts @unknown.round(0)\n @shippings = Shipping.all\n end", "def index\n @ab_reltionships = AbReltionship.all\n end", "def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end", "def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end", "def index\n @boards = Board.all\n data = []\n @boards.each do |i|\n data.push({\"name\" => i.name, \"id\" =>i.id.to_s})\n end\n\n render json: data\n #render \"boards/index\"\n end", "def show\n @badge = Badge.find(params[:id])\n @users = @badge.users\n respond_with @badge\n end", "def index\n @cartships = Cartship.all\n end", "def index\n @fellowships = Fellowship.all\n end", "def index\n gateway_alive = GatewayAlive.all\n render json: gateway_alive.to_json(:except => [:id])\n end", "def show\n @job_ship = JobShip.find(params[:id])\n end", "def show\n user = User.find(params[:id])\n friendships = user.followers + user.followees\n render json: {user: user, friendships: friendships}\n end", "def index\n \n @shareables = Shareable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shareables }\n end\n end", "def index\n @allocations = Allocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @allocations }\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 @game = Game.find(params[:id])\n @moves = @game.moves\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "def show\n @voivodeship = Voivodeship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voivodeship }\n end\n end", "def show\n @multi_board = MultiBoard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @multi_board }\n end\n end", "def index\n @space_stations = SpaceStation.all\n\n render json: @space_stations, include: :astronauts\n\n end", "def show\n @airport = Airport.find(params[:id])\n @airlines = Aircompany.where(airport_id: params[:id])\n respond_to do |format|\n format.html \n format.json { render json: @airport }\n end\n end", "def index\n @onboardings = Onboarding.all\n render json: @onboardings.as_json(:only => [:id, :company_name, :company_uen, :a_corpsecretary, :a_accounting, :a_status, :a_action, :a_date_fye, :a_date_agm, :a_date_renewal, :created_at])\n\n end", "def ambassador(params = {})\n self.class.get('/ambassador/get', params)\n end", "def index\n @ship_weapons = ShipWeapon.all\n end" ]
[ "0.74249715", "0.69088787", "0.67929137", "0.66098756", "0.66098756", "0.64122766", "0.6376047", "0.6348181", "0.6338665", "0.633301", "0.632581", "0.63221586", "0.6314819", "0.63043183", "0.6255079", "0.62542844", "0.6253122", "0.622468", "0.6199019", "0.61884296", "0.61884296", "0.6129634", "0.6114904", "0.60775447", "0.60316706", "0.60298574", "0.60273826", "0.60186094", "0.6006847", "0.59828806", "0.5966792", "0.59621423", "0.5914952", "0.5883797", "0.588143", "0.58373445", "0.5829026", "0.58265007", "0.58265007", "0.5823585", "0.57959586", "0.5785794", "0.57845473", "0.57832134", "0.5773336", "0.57731605", "0.5765518", "0.57440215", "0.57393366", "0.5721521", "0.5709406", "0.5707355", "0.57063556", "0.56962067", "0.5687072", "0.56766623", "0.56739897", "0.56701803", "0.5670093", "0.5665079", "0.5664969", "0.5654917", "0.5648275", "0.5642203", "0.5638826", "0.56333715", "0.56317633", "0.5630974", "0.56271356", "0.56266236", "0.5621485", "0.5618133", "0.5615453", "0.56136215", "0.56132746", "0.56132746", "0.56132746", "0.56132746", "0.56095946", "0.55892944", "0.55866843", "0.55854326", "0.55854326", "0.5585032", "0.5582533", "0.5573153", "0.5572986", "0.5571781", "0.55680525", "0.55610836", "0.5554581", "0.55510724", "0.5550418", "0.5535273", "0.5531844", "0.55249757", "0.5524331", "0.5512233", "0.5502275", "0.5502158", "0.54977506" ]
0.0
-1
POST /ambassadorships POST /ambassadorships.json
def create respond_to do |format| if @ambassadorship.save format.html { redirect_to @ambassadorship, notice: t('.notice') } format.json { render :show, status: :created, location: @ambassadorship } else format.html { render :new } format.json { render json: @ambassadorship.errors, status: :unprocessable_entity } end format.js { render :create } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_ambassadorship\n @ambassadorship = Ambassadorship.new(ambassadorship_params)\n end", "def index\n @ambassadorships = Ambassadorship.all\n end", "def ambassadorship_params\n params.require(:ambassadorship).permit(:user_id, :area_id)\n end", "def create\n \n @ship = current_user.create_ship(ship_params)\n \n\n respond_to do |format|\n if @ship!=nil\n current_user.activeShip = @ship.id\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render :show, status: :created, location: @ship }\n else\n format.html { render :new }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to ships_path, notice: 'Kauf nicht erfolgreich!' }\n \n end\n end\n end", "def set_ambassadorship\n @ambassadorship = Ambassadorship.find(params[:id])\n end", "def create\n @ship = Ship.new(params[:ship])\n @ship.game_id = @game.id\n @ship.health = @ship.ship_type.length\n @ship.vertical = true\n @ship.player_id = @player.id\n\n respond_to do |format|\n if @ship.save\n format.html { redirect_to [@game, @ship], notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @game = Game.find(params[:game_id])\n @game.authorships.create_from_names(params[:authorship])\n respond_to do |format|\n flash[:notice] = 'Les autheurs sont enregistres'\n format.html { redirect_to game_path(@game) }\n format.xml { head :created, :location => authorship_url(@authorship) }\n end\n end", "def create\n @ship = Ship.new(params[:ship])\n respond_to do |format|\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @friendship = @user.friendships.new(params[:friendship])\n\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to [@game, @user, @friendship], notice: 'Friendship was successfully created.' }\n format.json { render json: [@game, @user, @friendship], status: :created, location: [@game, @user, @friendship] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_shippment(items)\n fill_boxes(items)\n shippment_object\n make_json_object\n end", "def createShips\n for ship in Ship.find(:all, :order => \"id\")\n self.my_ships.build(ship_id: ship.id)\n self.enemy_ships.build(ship_id: ship.id)\n end\n self.save\n end", "def create\n @spaceship = Spaceship.new(params[:spaceship])\n\n respond_to do |format|\n if @spaceship.save\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully created.' }\n format.json { render json: @spaceship, status: :created, location: @spaceship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player_ship = PlayerShip.new(player_ship_params)\n\n respond_to do |format|\n if @player_ship.save\n format.html { redirect_to @player_ship, notice: 'Player ship was successfully created.' }\n format.json { render :show, status: :created, location: @player_ship }\n else\n format.html { render :new }\n format.json { render json: @player_ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def ship_params\n params.require(:ship).permit(:name, :ships_id, :stations_id, :level, :activeShip)\n end", "def add_ship(a_ship)\n\tres = [a_ship]\n\tif(ships.size < 0)\n\t\tships = ships + res\n else\n\t\tset_ships(res)\n\tend\n end", "def create\n @internship = Internship.new(params[:internship])\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, notice: 'Internship was successfully created.' }\n format.json { render json: @internship, status: :created, location: @internship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @clientship = current_user.clientships.build(:client_id => params[:client_id], :fee => params[:fee])\n\n respond_to do |format|\n if @clientship.save\n format.html { redirect_to @clientship, notice: 'Clientship was successfully created.' }\n format.json { render json: @clientship, status: :created, location: @clientship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clientship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @airplane = Airplane.new(airplane_params)\n \n respond_to do |format|\n if @airplane.save\n format.html { redirect_to @airplane, notice: 'Airplane was successfully created.' }\n format.json { render action: 'show', status: :created, location: @airplane }\n else\n format.html { render action: 'new' }\n format.json { render json: @airplane.errors, status: :unprocessable_entity }\n end\n end\n\n # rows_array = (1..@airplane.row.to_i).to_a\n # column_array = (1..@airplane.column.to_i).to_a\n \n\n # rows_array.each do |row_name|\n # column_array.each do |column_name|\n # seat_name = row_name.to_s + \"-\" + column_name.to_s \n # seat = Seat.create(:column_row => seat_name, :flight_id => @airplane.id, :available => true)\n # end\n # end\n\n \n end", "def create\n @fleet_ship = FleetShip.new(fleet_ship_params)\n\n respond_to do |format|\n if @fleet_ship.save\n format.html { redirect_to @fleet_ship, notice: 'Fleet ship was successfully created.' }\n format.json { render :show, status: :created, location: @fleet_ship }\n else\n format.html { render :new }\n format.json { render json: @fleet_ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @friendship = Friendship.new\n @friendship.user1_id = current_user.id\n @friendship.user2_id = @owner.id\n @friendship.approved = false\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to friendships_main_path, flash: { :success => 'Request of friendship was successfully sent.' } }\n format.json { render :index, status: :created, location: @friendship }\n else\n set_index_friendships\n format.html { render :index }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def friendships_create(options = {})\n @req.post(\"/1.1/friendships/create.json\", options)\n end", "def create\n @ab_reltionship = AbReltionship.new(ab_reltionship_params)\n\n respond_to do |format|\n if @ab_reltionship.save\n format.html { redirect_to @ab_reltionship, notice: 'Ab reltionship was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ab_reltionship }\n else\n format.html { render action: 'new' }\n format.json { render json: @ab_reltionship.errors, status: :unprocessable_entity }\n end\n end\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 create\n @user = current_user\n @internship = @user.internships.build(params[:internship])\n #@internship = Internship.new(params[:internship])\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, notice: 'Internship was successfully created.' }\n format.json { render json: @internship, status: :created, location: @internship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @game = Game.new(params[:game])\n respond_to do |format|\n if @game.save\n @game.tag_with params[:tag][:tag_list] if params[:tag] && params[:tag][:tag_list] != \"\"\n flash[:notice] = 'Game was successfully created.'\n @game.authorships.create_from_names(params[:authorship])\n format.html { redirect_to game_path(@game) }\n format.xml { head :created, :location => game_path(@game) }\n else\n format.html do\n @base_games = Game.base_games.find(:all)\n @authorships = []\n 3.times{@authorships << Authorship.new}\n render :action => \"new\"\n end\n format.xml { render :xml => @game.errors.to_xml }\n end\n end\n end", "def create\n @shiping = Shiping.new(shiping_params)\n @user = current_user\n\n respond_to do |format|\n if @shiping.save\n format.html { redirect_to @shiping, notice: 'Shiping was successfully created.' }\n format.json { render :show, status: :created, location: @shiping }\n else\n format.html { render :new }\n format.json { render json: @shiping.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @ships = Ship.all\n end", "def index\n @ships = Ship.all\n end", "def create\n @manifestship = Manifestship.new(manifestship_params)\n\n respond_to do |format|\n if @manifestship.save\n format.html { redirect_to @manifestship, notice: 'Manifestship was successfully created.' }\n format.json { render :show, status: :created, location: @manifestship }\n else\n format.html { render :new }\n format.json { render json: @manifestship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @monitorship = Monitorship.new(params[:monitorship])\n\n respond_to do |format|\n if @monitorship.save\n format.html { redirect_to @monitorship, notice: 'Monitorship was successfully created.' }\n format.json { render json: @monitorship, status: :created, location: @monitorship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @monitorship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @township = Township.new(township_params)\n\n respond_to do |format|\n if @township.save\n format.html { redirect_to @township, notice: 'Township was successfully created.' }\n format.json { render :show, status: :created, location: @township }\n else\n format.html { render :new }\n format.json { render json: @township.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_post_shipments\n test_url = \"https://test.panel.olzalogistic.com/api/v1\"\n test_login = 'your test login'\n test_pwd = 'your test password'\n test_language = 'cs'\n\n data = {payload: {shipmentList: [123456]}} #use real Shipment ID\n\n client = OlzaApi::Client.new(test_login, test_pwd, test_url, test_language)\n response = client.post_shipments(data)\n\n assert_instance_of Hash, response\n end", "def fleet_ship_params\n params.require(:fleet_ship).permit(:ship_id, :fleet_id)\n end", "def ship_params\n params.require(:ship).permit(:name, :crew, :has_astromech, :speed, :armament,\n pilots_attributes: [:id, :_destroy, :first_name, :last_name, :call_sign])\n end", "def create\n @shipfleet = Shipfleet.new(shipfleet_params)\n\n respond_to do |format|\n if @shipfleet.save\n format.html { redirect_to @shipfleet, notice: 'Shipfleet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @shipfleet }\n else\n format.html { render action: 'new' }\n format.json { render json: @shipfleet.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @ambassadorship.destroy\n @ambassadorship = Ambassadorship.new(area: @ambassadorship.area)\n respond_to do |format|\n format.html { redirect_to ambassadorships_url, notice: t('.notice') }\n format.json { head :no_content }\n format.js { render :destroy }\n end\n end", "def index\n @fleet_ships = FleetShip.all\n end", "def build_ships\n 5.times do\n ship = self.ships.build\n ship.populate\n end\n end", "def index\n @player_ships = PlayerShip.all\n end", "def update\n respond_to do |format|\n if @ambassadorship.update(ambassadorship_params)\n format.html { redirect_to @ambassadorship, notice: t('.notice') }\n format.json { render :show, status: :ok, location: @ambassadorship }\n else\n format.html { render :edit }\n format.json { render json: @ambassadorship.errors, status: :unprocessable_entity }\n end\n format.js { render :update }\n end\n end", "def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end", "def create\n # prevent user from adding friends who are already on friends list.\n if @friendship\n render json: { Message: \"You're already friends!\" }, status: :unprocessable_entity\n else\n @friend = current_user.friendships.create(:friend_id => @friend_id)\n render json: @friend, status: 201\n end\n end", "def job_ship_params\n params.require(:ship).permit(:ship_id, :job_id, :user_id)\n end", "def create\n \n @ship = Ship.new(params[:ship])\n @ship.character_id = session[:character_id]\n @ship.port_id = 7\n @ship.save\n \n @ship_attribute = ShipAttribute.new()\n @ship_attribute.ship_id = @ship.id\n @ship_attribute.cargo = 100\n @ship_attribute.weapon_slot = 2\n @ship_attribute.mast_slot = 2\n @ship_attribute.crew_slot = 1\n @ship_attribute.custom_slot = 0\n @ship_attribute.rudder_slot = 1\n @ship_attribute.structure = 50\n @ship.update_attribute(:curr_hp, \"#{@ship_attribute.structure}\")\n \n @ship.create_std_items\n \n respond_to do |format|\n @ship_attribute.save\n session.delete(:registering)\n session[:character_id] = nil\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n end\n end", "def create\n # render json: params\n render json: UserBoards.create(params[\"user_board\"])\n end", "def create\n @ship_placement = ShipPlacement.new(ship_placement_params)\n\n respond_to do |format|\n if @ship_placement.save\n format.html { redirect_to @ship_placement, notice: 'Ship placement was successfully created.' }\n format.json { render :show, status: :created, location: @ship_placement }\n else\n format.html { render :new }\n format.json { render json: @ship_placement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @friendship = Friendship.new(friendship_params)\n\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to @friendship, notice: 'Friendship was successfully created.' }\n format.json { render :show, status: :created, location: @friendship }\n else\n format.html { render :new }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ship = Ship.new(params[:ship])\n\n respond_to do |format|\n if @ship.save\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @internship = Internship.new(params[:internship])\n \n respond_to do |format|\n if @internship.save\n format.html { redirect_to(@internship, :notice => 'Internship was successfully created.') }\n format.xml { render :xml => @internship, :status => :created, :location => @internship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @airplane = Airplane.new(params[:airplane])\n\n respond_to do |format|\n if @airplane.save\n format.html { redirect_to @airplane, :notice => 'Airplane was successfully created.' }\n format.json { render :json => @airplane, :status => :created, :location => @airplane }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @airplane.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @mentorship = Mentorship.new(params[:mentorship])\n\n respond_to do |format|\n if @mentorship.save\n format.html { redirect_to mentorships_url, notice: 'Mentorship was successfully created.' }\n format.json { render json: @mentorship, status: :created, location: @mentorship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mentorship.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @shipments = Shipment.all\n render json: @shipments\n end", "def create\n @discipleship = Discipleship.new(discipleship_params)\n\n respond_to do |format|\n if @discipleship.save\n format.html { redirect_to @discipleship, notice: 'Discipleship was successfully created.' }\n format.json { render action: 'show', status: :created, location: @discipleship }\n else\n format.html { render action: 'new' }\n format.json { render json: @discipleship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @voivodeship = Voivodeship.new(params[:voivodeship])\n\n respond_to do |format|\n if @voivodeship.save\n format.html { redirect_to @voivodeship, notice: 'Voivodeship was successfully created.' }\n format.json { render json: @voivodeship, status: :created, location: @voivodeship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voivodeship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find(current_user.id)\n if @user.internship_authorization\n @internship = Internship.new(params[:internship])\n @internship.user_id = current_user.id if current_user\n @user.internship_authorization = false\n @user.save\n flash[:notice] = \"Internship was successfully created\" if @internship.save\n respond_with(@internship)\n else\n flash[:notice] = \"You cannot create an internship\"\n redirect_to internships_url\n end\n end", "def create\n Friendship.request(@user, @friend)\n @friend = Friendship.find_by_user_id_and_friend_id(@user, @friend)\n render :json => { :success => true, :new_friend => @friend }\n end", "def update_ships\n # A data structure to store the ships in\n\n ships = [\n [\"Brittana\", [\"Brittany P.\", \"Santana L.\"]],\n [\"Faberry\", [\"Quinn F.\", \"Rachel B.\"]],\n [\"Flanamotta\", [\"Rory F.\", \"Sugar\"]],\n [\"Sory\", [\"Rory F.\", \"Sam E.\"]],\n [\"Seblaine\", [\"Sebastian S.\", \"Blaine A.\"]],\n [\"Santofsky\", [\"D. Karofsky\", \"Santana L.\"]],\n [\"Bartie\", [\"Brittany P.\", \"Artie A.\"]],\n [\"Tike\", [\"Mike C.\", \"Tina C.\"]],\n [\"Pezberry\", [\"Santana L.\", \"Rachel B.\"]],\n [\"Pizes\", [\"Lauren Z.\", \"Puck\"]],\n [\"St. Berry\", [\"Jesse sJ.\", \"Rachel B.\"]],\n [\"Kill\", [\"Kurt H.\", \"Will S.\"]],\n [\"Puckurt\", [\"Kurt H.\", \"Puck\"]],\n [\"Artina\", [\"Tina C.\", \"Artie A.\"]],\n [\"Partie\", [\"Puck\", \"Artie A.\"]],\n [\"Blainofskyve\", [\"Blaine A.\", \"D. Karofsky\"]],\n [\"Klaine\", [\"Kurt H.\", \"Blaine A.\"]],\n [\"Hummelberry\", [\"Kurt H.\", \"Rachel B.\"]],\n [\"Furt\", [\"Kurt H.\", \"Finn H.\"]],\n [\"Pinn\", [\"Puck\", \"Finn H.\"]],\n [\"Samcedes\", [\"Sam E.\", \"Mercedes J.\"]],\n [\"Artcedes\", [\"Artie A.\", \"Mercedes J.\"]],\n [\"Finchel\", [\"Finn H.\", \"Rachel B.\"]],\n [\"Puckleberry\", [\"Puck\", \"Rachel B.\"]],\n [\"Wemma\", [\"Will S.\", \"Emma P.\"]]\n ]\n\n ships.each do |ship_data|\n ship = Ship.find_by_name(ship_data[0])\n\n # Make sure the ship doesn't already exist\n if !ship\n\n # create a new ship\n ship = Ship.new()\n ship.name = ship_data[0]\n ship.save\n\n # For each character in the ship\n ship_characters = ship_data[1]\n generate_log(\"Generating New Ship: #{ship_data[0]} between #{ship_data[1]}\")\n ship_characters.each do |ship_character|\n character = generate_character(ship_character)\n # Save the relationship\n relationship = Relationship.new()\n relationship.ship = ship\n relationship.character = character\n relationship.save\n\n end\n else\n ship.update_attributes(:name => ship_data[0])\n ship.save\n generate_log(\"Updating: #{ship_data[0]} between #{ship_data[1]}\")\n\n\n end\n end\nend", "def create\n @ship_methods = ShipMethods.new(params[:ship_methods])\n\n respond_to do |format|\n if @ship_methods.save\n flash[:notice] = 'ShipMethods was successfully created.'\n format.html { redirect_to(@ship_methods) }\n format.xml { render :xml => @ship_methods, :status => :created, :location => @ship_methods }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship_methods.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n eqs = []\n puts params\n params[:boat][:equipments].each do |i|\n eqs << Equipment.find(i)\n end\n params[:boat][:equipments] = eqs\n @boat = Boat.new(params[:boat])\n\n respond_to do |format|\n if @boat.save\n format.html { redirect_to(@boat, :notice => 'Boat was successfully created.') }\n format.xml { render :xml => @boat, :status => :created, :location => @boat }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @boat.errors, :status => :unprocessable_entity }\n end\n end\n end", "def place_ships!\n\t\t[\n\t\t\t['T', 2],\n\t\t\t['D', 3],\n\t\t\t['S', 3],\n\t\t\t['B', 4],\n\t\t\t['C', 5]\n\t\t].each do |ship|\n\t\t\tplace_ship(ship[0], ship[1])\n\t\tend\n\tend", "def create\n @followship = Followship.new(followship_params)\n\n respond_to do |format|\n if @followship.save\n format.html { redirect_to @followship, notice: 'Followship was successfully created.' }\n format.json { render :show, status: :created, location: @followship }\n else\n format.html { render :new }\n format.json { render json: @followship.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_ship(ship)\n status = self.ship_addable?(ship)\n if status == :addable\n ship.coordinates_occupied.each { |coordinate| self.tiles[coordinate].ship = ship }\n self.ships << ship\n :added\n else\n status \n end\n end", "def create\n @shipment = Shipment.new(params[:shipment])\n @barn = @shipment.barn\n @barn.total_pigs += @shipment.total_pigs\n\n respond_to do |format|\n if @shipment.save\n @barn.save\n format.html { redirect_to @shipment, notice: 'Shipment was successfully created.' }\n format.json { render json: @shipment, status: :created, location: @shipment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shipment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_friendship(user = nil, params = {})\n args = [user, params]\n post path_from_args('friendships/create', args), {:follow => true}.merge(params_from_args(args))\n end", "def create\n @game = current_or_guest_user.games.create\n render json: @game, status: 201\n end", "def create\n @friendship = current_person.friendships.build(:granter_id => params[:granter_id], :accepted => params[:accepted])\n\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to people_url, notice: 'A friend request has been sent to ' + Person.find(params[:granter_id]).name }\n format.json { render :show, status: :created, location: @friendship }\n else\n format.html { render :new }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @championship = Championship.new(championship_params.merge(user: current_user))\n\n if @championship.save\n render json: @championship, status: :created, location: @championship\n else\n render json: @championship.errors, status: :unprocessable_entity\n end\n end", "def index\n # @ships = Ship.paginate(:page => params[:page], :per_page => 5)\n #sorts the ship list by empire and name (remember #sort_by sorts \n #from left to right so you can have multiple criteria)\n ships = Ship.all\n @ships = ships.sort_by { |v| [v[:empire_image], v[:cost]] }\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ships }\n end\n end", "def create\n @followship = Followship.create(:follower_id => current_user.id, :following_id => followship_params[:following_id])\n\n respond_to do |format|\n if @followship.save\n format.html { redirect_to @followship, notice: 'Followship was successfully created.' }\n format.json { render :show, status: :created, location: @followship }\n else\n format.html { render :new }\n format.json { render json: @followship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n WasabbiModship.transaction do\n @wasabbi_modship = WasabbiModship.new(params[:wasabbi_modship])\n\n respond_to do |format|\n if @wasabbi_modship.save\n flash[:notice] = 'WasabbiModship was successfully created.'\n format.html { redirect_to(@wasabbi_modship) }\n format.xml { render :xml => @wasabbi_modship, :status => :created, :location => @wasabbi_modship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wasabbi_modship.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def create\n logger.debug('In the create method afterall')\n logger.debug( friend_params )\n current_user.friendships.create!(:friend_id => params[:friend_id]) \n\n redirect_to friendship_index_path\n end", "def shiping_params\n params.require(:shiping).permit(:title, :description, :dizhi, :user_id)\n end", "def create\n\n @service = Service.new(service_params)\n \n params[:service][:shipments_attributes].each do |k,ship|\n ship.each do |k,device|\n if k.to_s[/device_ids.*/]\n device.each{|d| d.blank? ? d:Device.find(d).update(:assigned=>true)}\n end\n end\n end\n\n respond_to do |format|\n if @service.save\n format.html { redirect_to @service, notice: 'Service was successfully created.' }\n format.json { render action: 'show', status: :created, location: @service }\n else\n format.html { render action: 'new' }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shipcount = Shipcount.new(shipcount_params)\n\n respond_to do |format|\n if @shipcount.save\n format.html { redirect_to @shipcount, notice: 'Shipcount was successfully created.' }\n format.json { render action: 'show', status: :created, location: @shipcount }\n else\n format.html { render action: 'new' }\n format.json { render json: @shipcount.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @committees_voivodeship = CommitteesVoivodeship.new(params[:committees_voivodeship])\n\n respond_to do |format|\n if @committees_voivodeship.save\n format.html { redirect_to @committees_voivodeship, notice: 'Committees voivodeship was successfully created.' }\n format.json { render json: @committees_voivodeship, status: :created, location: @committees_voivodeship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @committees_voivodeship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @followship = Followship.new(followship_params)\r\n\r\n respond_to do |format|\r\n if @followship.save\r\n format.html { redirect_to @followship, notice: 'Followship was successfully created.' }\r\n format.json { render :show, status: :created, location: @followship }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @followship.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def ships_sub_params\n params.require(:ships_sub).permit(:name)\n end", "def create\n @championship = Championship.new(championship_params)\n\n if @championship.save\n render :show, status: :created, location: @championship\n else\n render json: @championship.errors, status: :unprocessable_entity\n end\n end", "def create\n @bingo_hall = BingoHall.new(name: bingo_hall_params[:name])\n\n respond_to do |format|\n if @bingo_hall.save\n bingo_board = @bingo_hall.bingo_boards.create\n Player.create(name: bingo_hall_params[:player_name], bingo_board: bingo_board)\n format.html { redirect_to @bingo_hall, notice: \"Bingo hall was successfully created.\" }\n format.json { render :show, status: :created, location: @bingo_hall }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bingo_hall.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @ships = Ship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ships }\n end\n end", "def create\n @society_member_ship = SocietyMemberShip.new(society_member_ship_params)\n\n respond_to do |format|\n if @society_member_ship.save\n format.html { redirect_to @society_member_ship, notice: 'Society member ship was successfully created.' }\n format.json { render :show, status: :created, location: @society_member_ship }\n else\n format.html { render :new }\n format.json { render json: @society_member_ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # TODO: why change from new to create makes it so I can access the @flight.id\n @flight = Flight.create(flight_params)\n\n # when a flight is created, create all the associated seats\n @airplane = Airplane.find @flight.airplane_id\n # find the number of rows/columns that the aeroplane has, create a range from 1 to that number, then split that into an array.\n # this will allow us to loop through and create a seat for each value below\n @rows = (1..@airplane.rows).to_a\n @columns = (1..@airplane.columns).to_a\n # create a seat for each row and column and associate it with this flight.\n @rows.each do |row|\n @columns.each do |col|\n seat = Seat.create :row => row, :column => col, :is_taken => false\n @flight.seats << seat\n end\n end\n\n respond_to do |format|\n if @flight.save\n format.html { redirect_to @flight, notice: 'Flight was successfully created.' }\n format.json { render :show, status: :created, location: @flight }\n else\n format.html { render :new }\n format.json { render json: @flight.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ship_class = ShipClass.new(params[:ship_class])\n\n respond_to do |format|\n if @ship_class.save\n format.html { redirect_to @ship_class, notice: 'Ship class was successfully created.' }\n format.json { render json: @ship_class, status: :created, location: @ship_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship_class.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @flight = Flight.new(flight_params)\n\n respond_to do |format|\n if @flight.save\n format.html { redirect_to @flight, notice: 'Flight was successfully created.' }\n format.json { render action: 'show', status: :created, location: @flight }\n else\n format.html { render action: 'new' }\n format.json { render json: @flight.errors, status: :unprocessable_entity }\n end\n end\n\n airplane = Airplane.find(@flight.airplane_id)\n\n rows_array = (1..airplane.row.to_i).to_a\n column_array = (1..airplane.column.to_i).to_a\n \n\n rows_array.each do |row_name|\n column_array.each do |column_name|\n seat_name = row_name.to_s + \"-\" + column_name.to_s \n seat = Seat.create(:column_row => seat_name, :flight_id => @flight.id, :available => true)\n end\n end\n\n end", "def create\n @memeber_ship = MemeberShip.new(params[:memeber_ship])\n\n respond_to do |format|\n if @memeber_ship.save\n format.html { redirect_to(@memeber_ship, :notice => 'Memeber ship was successfully created.') }\n format.xml { render :xml => @memeber_ship, :status => :created, :location => @memeber_ship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @memeber_ship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def add_ship value\n\t\traise InvalidMoveError if @ships.include?(value)\n\t\t@ships.push(value)\n\tend", "def player_ship_params\n params.require(:player_ship).permit(:captain_id, :ship_id, :name, :fuel_total, :fuel_remaining, :cargo_spaces, :fighters)\n end", "def shipfleet_params\n params.require(:shipfleet).permit(:ship_id, :fleet_id, :amount)\n end", "def create\n @brasseries = Brasserie.new(brasseries_params)\n\n respond_to do |format|\n if @brasseries.save\n format.html { redirect_to @brasseries, notice: 'Brasserie was successfully created.' }\n format.json { render :show, status: :created, location: @brasseries }\n else\n format.html { render :new }\n format.json { render json: @brasseries.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @job_ship = JobShip.new(job_ship_params)\n if @job_ship.save\n redirect_to @job_ship, notice: 'Job ship was successfully created.'\n else\n render 'new'\n end\n end", "def index\n @shipings = Shiping.all\n end", "def create\n @fellowship = Fellowship.new(fellowship_params)\n @fellowship.users << current_user\n\n # Capitalize fellowship name\n @fellowship.fellowship_name = @fellowship.fellowship_name.titleize\n\n respond_to do |format|\n if @fellowship.save\n format.html { redirect_to @fellowship, notice: 'Fellowship was successfully created.' }\n format.json { render :show, status: :created, location: @fellowship }\n else\n format.html { render :new }\n format.json { render json: @fellowship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @internships_user = InternshipsUser.new(params[:internships_user])\n\n respond_to do |format|\n if @internships_user.save\n format.html { redirect_to @internships_user, :notice => 'Internships user was successfully created.' }\n format.json { render :json => @internships_user, :status => :created, :location => @internships_user }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @internships_user.errors, :status => :unprocessable_entity }\n end\n end\n end", "def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end", "def create\n @friendship = Friendship.new(params[:friendship])\n current_user.un_black_ball(@friendship.proposee)\n @user = @friendship.proposee\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to @friendship, notice: \"Your Friend Request was sent\" }\n format.json { render json: @friendship, status: :created, location: @friendship }\n format.js {}\n else\n format.html { render action: \"new\" }\n format.js {}\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shipment = Shipment.new(shipment_params)\n\n if @shipment.save\n render json: @shipment\n else\n render json: @shipment.errors, status: :unprocessable_entity\n end\n end", "def friendship_params\n params.require(:friendship).permit(:user_id, :friend_id, :status)\n end", "def create\n @battle = Battle.new(params[:battle])\n \n @ship1 = Ship.find(@battle.ship1_id)\n @ship2 = Ship.find(@battle.ship2_id)\n @character = Character.find(1)\n @finished = Battle.battle(@ship1,@ship2)\n \n respond_to do |format|\n if @battle.save\n flash[:notice] = 'Battle was successfully created.'\n format.html { redirect_to(@finished) }\n format.xml { render :xml => @battle, :status => :created, :location => @battle }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @battle.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n sheeps = params[:sheeps]\n return if params_are_empty(sheeps)\n \n @activity = Activity.new date: convert_date_to_i(params[:date]), comment: params[:comment], a_type: params[:type_of_a], total_costs:params[:total_costs], location: 'farma'\n sheeps.each do |p|\n @vacination = Vacination.new sheep_id:p[:sheep_id], reason: params[:reason], vaccin_name: params[:vaccin_name]\n @activity.vacinations.push(@vacination)\n end\n \n respond_to do |format|\n if @activity.save\n desrtoy_activity(params[:activity_id])\n format.html { redirect_to '/vacinations/'+ @activity.id.to_s, notice: 'Vacination was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vacination }\n else\n format.html { render action: 'new' }\n format.json { render json: @vacination.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @clientship = Clientship.new\n @users = User.all\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientship }\n end\n end" ]
[ "0.67556465", "0.6519189", "0.6400249", "0.62767327", "0.6252982", "0.62013", "0.6160292", "0.6115367", "0.6046786", "0.5992935", "0.59367615", "0.59199184", "0.5917137", "0.5911482", "0.5907564", "0.5898504", "0.58899087", "0.5880348", "0.5866841", "0.58353525", "0.5824651", "0.5806328", "0.57682025", "0.57358366", "0.57327896", "0.5700477", "0.56906766", "0.56906766", "0.565431", "0.56311864", "0.5606658", "0.5601782", "0.55977577", "0.55953807", "0.5588606", "0.55873036", "0.5561834", "0.55547947", "0.5549072", "0.55490166", "0.5544967", "0.55288494", "0.552505", "0.5508683", "0.5500128", "0.5495429", "0.5476268", "0.5469428", "0.54542494", "0.54428643", "0.54393065", "0.5429528", "0.54289764", "0.5420302", "0.54082006", "0.5397679", "0.53968954", "0.5377817", "0.53766876", "0.5372563", "0.53698766", "0.53604054", "0.5347605", "0.53456795", "0.5343639", "0.5338877", "0.5332629", "0.532913", "0.53269345", "0.5324515", "0.53143716", "0.5314158", "0.5311655", "0.5296218", "0.52959615", "0.5290961", "0.52893704", "0.52886367", "0.5282627", "0.5274875", "0.52688265", "0.5263429", "0.5262332", "0.5262024", "0.5260568", "0.5258836", "0.52516174", "0.52439696", "0.5243555", "0.5242308", "0.5241848", "0.5233071", "0.5231836", "0.5224687", "0.52211946", "0.52034444", "0.5202777", "0.5190453", "0.51864856", "0.5185022" ]
0.65172654
2
PATCH/PUT /ambassadorships/1 PATCH/PUT /ambassadorships/1.json
def update respond_to do |format| if @ambassadorship.update(ambassadorship_params) format.html { redirect_to @ambassadorship, notice: t('.notice') } format.json { render :show, status: :ok, location: @ambassadorship } else format.html { render :edit } format.json { render json: @ambassadorship.errors, status: :unprocessable_entity } end format.js { render :update } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @clientship = current_user.clientships.find(params[:id])\n\n respond_to do |format|\n if @clientship.update_attributes(params[:clientship])\n format.html { redirect_to @clientship, notice: 'Clientship was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ship.update(ship_params)\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship }\n else\n format.html { render :edit }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shipfleet.update(shipfleet_params)\n format.html { redirect_to @shipfleet, notice: 'Shipfleet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shipfleet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @fleet_ship.update(fleet_ship_params)\n format.html { redirect_to @fleet_ship, notice: 'Fleet ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @fleet_ship }\n else\n format.html { render :edit }\n format.json { render json: @fleet_ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_ambassadorship\n @ambassadorship = Ambassadorship.find(params[:id])\n end", "def update\n respond_to do |format|\n if @ab_reltionship.update(ab_reltionship_params)\n format.html { redirect_to @ab_reltionship, notice: 'Ab reltionship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ab_reltionship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n if @spaceship.update_attributes(params[:spaceship])\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @friendship = @user.friendships.find(params[:id])\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { redirect_to [@game, @user, @friendship], notice: 'Friendship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @manifestship.update(manifestship_params)\n format.html { redirect_to @manifestship, notice: 'Manifestship was successfully updated.' }\n format.json { render :show, status: :ok, location: @manifestship }\n else\n format.html { render :edit }\n format.json { render json: @manifestship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n if @internship.update_attributes(params[:internship])\n format.html { redirect_to @internship, notice: 'Internship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n if @internship.update_attributes(params[:internship])\n format.html { redirect_to @internship, notice: 'Internship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n friendship_new = Friendship.new\n friendship_new.user1_id = @friendship.user2_id\n friendship_new.user2_id = @friendship.user1_id\n friendship_new.approved = true\n friendship_new.save!\n @friendship.approved = true\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to back_page, flash: { :success => 'Friendship was approved.' } }\n format.json { render :index, status: :ok, location: @friendship }\n else\n set_index_friendships\n format.html { render :index }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @monitorship = Monitorship.find(params[:id])\n\n respond_to do |format|\n if @monitorship.update_attributes(params[:monitorship])\n format.html { redirect_to @monitorship, notice: 'Monitorship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monitorship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n flash[:notice] = 'Ship was successfully updated.'\n format.html { redirect_to(@ship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n flash[:notice] = 'Ship was successfully updated.'\n format.html { redirect_to(@ship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player_ship.update(player_ship_params)\n format.html { redirect_to @player_ship, notice: 'Player ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @player_ship }\n else\n format.html { render :edit }\n format.json { render json: @player_ship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @discipleship.update(discipleship_params)\n format.html { redirect_to @discipleship, notice: 'Discipleship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @discipleship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: UserBoards.update(params[\"id\"], params[\"user_board\"])\n end", "def update\n respond_to do |format|\n if @airplane.update(airplane_params)\n format.html { redirect_to @airplane, notice: 'Airplane was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @airplane.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shiping.update(shiping_params)\n format.html { redirect_to @shiping, notice: 'Shiping was successfully updated.' }\n format.json { render :show, status: :ok, location: @shiping }\n else\n format.html { render :edit }\n format.json { render json: @shiping.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ship_placement.update(ship_placement_params)\n format.html { redirect_to @ship_placement, notice: 'Ship placement was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship_placement }\n else\n format.html { render :edit }\n format.json { render json: @ship_placement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { redirect_to @friendship, notice: 'Friendship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { redirect_to @friendship, notice: 'Friendship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ship_fitting.update(ship_fitting_params)\n format.html { redirect_to @ship_fitting, notice: 'Ship fitting was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship_fitting }\n else\n format.html { render :edit }\n format.json { render json: @ship_fitting.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shipcount.update(shipcount_params)\n format.html { redirect_to @shipcount, notice: 'Shipcount was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shipcount.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @airplane = Airplane.find(params[:id])\n\n respond_to do |format|\n if @airplane.update_attributes(params[:airplane])\n format.html { redirect_to @airplane, :notice => 'Airplane was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @airplane.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @friendship.update(friendship_params)\n format.html { redirect_to @friendship, notice: 'Friendship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @ship_group.update(ship_group_params)\n format.html { redirect_to @ship_group, notice: 'Ship group was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship_group }\n else\n format.html { render :edit }\n format.json { render json: @ship_group.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def friendships_update(options = {})\n @req.post(\"/1.1/friendships/update.json\", options)\n end", "def update\n @voivodeship = Voivodeship.find(params[:id])\n\n respond_to do |format|\n if @voivodeship.update_attributes(params[:voivodeship])\n format.html { redirect_to @voivodeship, notice: 'Voivodeship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voivodeship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n activo = params[:lab_far][:activo]\n farmacia_id = session[:farmacia_id]\n id = params[:id]\n LabFar.where(laboratorio_id: id, farmacium_id:farmacia_id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n @memeber_ship = MemeberShip.find(params[:id])\n\n respond_to do |format|\n if @memeber_ship.update_attributes(params[:memeber_ship])\n format.html { redirect_to(@memeber_ship, :notice => 'Memeber ship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @memeber_ship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @ship_methods = ShipMethods.find(params[:id])\n\n respond_to do |format|\n if @ship_methods.update_attributes(params[:ship_methods])\n flash[:notice] = 'ShipMethods was successfully updated.'\n format.html { redirect_to(@ship_methods) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship_methods.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @championship = Championship.find(params[:id])\n\n if @championship.update(championship_params.merge(user: current_user))\n head :no_content\n else\n render json: @championship.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @friendship.update(friendship_params)\n format.html { redirect_to @friendship, notice: 'Friendship was successfully updated.' }\n format.json { render :show, status: :ok, location: @friendship }\n else\n format.html { render :edit }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @friendship.update(friendship_params)\n format.html { redirect_to @friendship, notice: 'Friendship was successfully updated.' }\n format.json { render :show, status: :ok, location: @friendship }\n else\n format.html { render :edit }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @friendship = Friendship.find(params[:id])\n\n if (params[:ignore])\n @friendship.ignore = params[:ignore] == \"true\"\n end\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { render @friendship }\n format.json { render json: { success: true } }\n else\n format.html { render action: \"index\" }\n format.json { render json: @friendship.errors, \n status: :unprocessable_entity }\n end\n end\n end", "def update\n @internship = Internship.find(params[:id])\n respond_to do |format|\n if @internship.update_attributes(params[:internship])\n format.html { redirect_to(@internship, :notice => 'Internship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @fellowship.update(fellowship_params)\n format.html { redirect_to @fellowship, notice: 'Fellowship was successfully updated.' }\n format.json { render :show, status: :ok, location: @fellowship }\n else\n format.html { render :edit }\n format.json { render json: @fellowship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ship_class = ShipClass.find(params[:id])\n\n respond_to do |format|\n if @ship_class.update_attributes(params[:ship_class])\n format.html { redirect_to @ship_class, notice: 'Ship class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship_class.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @friendship.update(friendship_params)\n format.html { redirect_to @friendship, notice: 'friendship was successfully updated.' }\n format.json { render :show, status: :ok, location: @friendship }\n else\n format.html { render :edit }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @brasseries.update(brasseries_params)\n format.html { redirect_to @brasseries, notice: 'Brasserie was successfully updated.' }\n format.json { render :show, status: :ok, location: @brasseries }\n else\n format.html { render :edit }\n format.json { render json: @brasseries.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ambush = Ambush.find(params[:id])\n\n respond_to do |format|\n if @ambush.update_attributes(params[:ambush])\n format.html { redirect_to @ambush, :notice => 'Ambush was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @ambush.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @sabio = Sabio.find(params[:id])\n\n respond_to do |format|\n if @sabio.update_attributes(params[:sabio])\n format.html { redirect_to @sabio, notice: 'El Sabio fue actualizado.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sabio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mentorship = Mentorship.find(params[:id])\n\n respond_to do |format|\n if @mentorship.update_attributes(params[:mentorship])\n format.html { redirect_to @mentorship, notice: 'Mentorship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mentorship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ambassador.update(ambassador_params)\n format.html { redirect_to @ambassador, notice: 'Ambassador was successfully updated.' }\n format.json { render :show, status: :ok, location: @ambassador }\n else\n format.html { render :edit }\n format.json { render json: @ambassador.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @followship.update(followship_params)\n format.html { redirect_to @followship, notice: 'Followship was successfully updated.' }\n format.json { render :show, status: :ok, location: @followship }\n else\n format.html { render :edit }\n format.json { render json: @followship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @internships_user = InternshipsUser.find(params[:id])\n\n respond_to do |format|\n if @internships_user.update_attributes(params[:internships_user])\n format.html { redirect_to @internships_user, :notice => 'Internships user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @internships_user.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @request_friendship.update(request_friendship_params)\n format.html { redirect_to @request_friendship, notice: 'La solicitud de amistad se ha actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @request_friendship }\n else\n format.html { render :edit }\n format.json { render json: @request_friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @internship = Internship.find(params[:id])\n\n if @internship.update_attributes(params[:internship])\n flash[:notice] = 'Internship was successfully updated.'\n end\n respond_with(@internship)\n end", "def update\n respond_to do |format|\n if @live_aboard.update(live_aboard_params)\n format.html { redirect_to @live_aboard, notice: 'Live aboard was successfully updated.' }\n format.json { render :show, status: :ok, location: @live_aboard }\n else\n format.html { render :edit }\n format.json { render json: @live_aboard.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end", "def update\n respond_with []\n end", "def update\n @athlete.altered_by = current_user.id\n namesplit = @athlete.name.split(' ')\n @athlete.short_name = \"#{namesplit.first} #{namesplit.last}\" if namesplit.length > 1\n @athlete.short_name = \"#{namesplit.first}\" if namesplit.length == 1\n\n respond_to do |format|\n\n if @athlete.update(athlete_params)\n if params[ :shortform ] or params[ :clubdetail ]\n @club = Club.find( @athlete.club_id )\n format.html { redirect_to club_path(@athlete.club_id), notice: 'Atleta criado com sucesso.' }\n else\n format.html { redirect_to @athlete, notice: 'Atleta actualizado com sucesso.' }\n end\n format.json { head :no_content }\n else\n if params[ :shortform ] or params[ :clubdetail ]\n @club = Club.find( @athlete.club_id )\n flash[:error] = @athlete.errors.full_messages.join(\".<br>\").html_safe\n format.html { redirect_to club_path(@athlete.club_id) }\n else\n format.html { render action: 'edit' }\n end\n format.json { render json: @athlete.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shipmment_item.update(shipmment_item_params)\n format.html { redirect_to @shipmment_item, notice: \"Shipmment item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @shipmment_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @shipmment_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @friendship.update(params.permit(:id, :accepted))\n # now build a friendship in the opposite direction\n @other_friendship = current_person.friendships.build(:granter_id => @friendship.requester_id, :accepted => true)\n @other_friendship.save\n\n format.html { redirect_to people_url, notice: 'You and ' + Person.find(@friendship.requester_id).name + ' are now friends!' }\n format.json { render :show, status: :ok, location: @friendship }\n else\n format.html { render :edit }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "def update\n @before_intership = BeforeIntership.find(params[:id])\n\n respond_to do |format|\n if @before_intership.update_attributes(params[:before_intership])\n format.html { redirect_to @before_intership, notice: 'Before intership was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @before_intership.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @steamshipline.update(steamshipline_params)\n format.html { redirect_to @steamshipline, notice: 'Steamshipline was successfully updated.' }\n format.json { render :show, status: :ok, location: @steamshipline }\n else\n format.html { render :edit }\n format.json { render json: @steamshipline.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @job_ship.update(job_ship_params)\n redirect_to @job_ship, notice: 'Job ship was successfully updated.'\n else\n render 'edit'\n end\n end", "def update\n @osoba = Osoba.find(params[:id])\n\n if @osoba.update(params[:osoba])\n head :no_content\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @freeboard.update(freeboard_params)\n format.html { redirect_to @freeboard, notice: 'Freeboard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @freeboard.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @committees_voivodeship = CommitteesVoivodeship.find(params[:id])\n\n respond_to do |format|\n if @committees_voivodeship.update_attributes(params[:committees_voivodeship])\n format.html { redirect_to @committees_voivodeship, notice: 'Committees voivodeship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @committees_voivodeship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n params[:internship][:field_ids] ||= []\n @internship = Internship.find(params[:id])\n \n respond_to do |format|\n if @internship.owner_hash == cookies[:hash] and\n @internship.update_attributes(params[:internship])\n format.js\n format.html { redirect_to(@internship, :notice => 'Internship was successfully updated.') }\n format.json { head :ok }\n else\n format.json { render :json => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @championship.update(championship_params)\n render :show, status: :ok, location: @championship\n else\n render json: @championship.errors, status: :unprocessable_entity\n end\n end", "def update_ships\n # A data structure to store the ships in\n\n ships = [\n [\"Brittana\", [\"Brittany P.\", \"Santana L.\"]],\n [\"Faberry\", [\"Quinn F.\", \"Rachel B.\"]],\n [\"Flanamotta\", [\"Rory F.\", \"Sugar\"]],\n [\"Sory\", [\"Rory F.\", \"Sam E.\"]],\n [\"Seblaine\", [\"Sebastian S.\", \"Blaine A.\"]],\n [\"Santofsky\", [\"D. Karofsky\", \"Santana L.\"]],\n [\"Bartie\", [\"Brittany P.\", \"Artie A.\"]],\n [\"Tike\", [\"Mike C.\", \"Tina C.\"]],\n [\"Pezberry\", [\"Santana L.\", \"Rachel B.\"]],\n [\"Pizes\", [\"Lauren Z.\", \"Puck\"]],\n [\"St. Berry\", [\"Jesse sJ.\", \"Rachel B.\"]],\n [\"Kill\", [\"Kurt H.\", \"Will S.\"]],\n [\"Puckurt\", [\"Kurt H.\", \"Puck\"]],\n [\"Artina\", [\"Tina C.\", \"Artie A.\"]],\n [\"Partie\", [\"Puck\", \"Artie A.\"]],\n [\"Blainofskyve\", [\"Blaine A.\", \"D. Karofsky\"]],\n [\"Klaine\", [\"Kurt H.\", \"Blaine A.\"]],\n [\"Hummelberry\", [\"Kurt H.\", \"Rachel B.\"]],\n [\"Furt\", [\"Kurt H.\", \"Finn H.\"]],\n [\"Pinn\", [\"Puck\", \"Finn H.\"]],\n [\"Samcedes\", [\"Sam E.\", \"Mercedes J.\"]],\n [\"Artcedes\", [\"Artie A.\", \"Mercedes J.\"]],\n [\"Finchel\", [\"Finn H.\", \"Rachel B.\"]],\n [\"Puckleberry\", [\"Puck\", \"Rachel B.\"]],\n [\"Wemma\", [\"Will S.\", \"Emma P.\"]]\n ]\n\n ships.each do |ship_data|\n ship = Ship.find_by_name(ship_data[0])\n\n # Make sure the ship doesn't already exist\n if !ship\n\n # create a new ship\n ship = Ship.new()\n ship.name = ship_data[0]\n ship.save\n\n # For each character in the ship\n ship_characters = ship_data[1]\n generate_log(\"Generating New Ship: #{ship_data[0]} between #{ship_data[1]}\")\n ship_characters.each do |ship_character|\n character = generate_character(ship_character)\n # Save the relationship\n relationship = Relationship.new()\n relationship.ship = ship\n relationship.character = character\n relationship.save\n\n end\n else\n ship.update_attributes(:name => ship_data[0])\n ship.save\n generate_log(\"Updating: #{ship_data[0]} between #{ship_data[1]}\")\n\n\n end\n end\nend", "def update\n @fleet = Fleet.find(params[:id])\n\n respond_to do |format|\n if @fleet.update_attributes(params[:fleet])\n format.html { redirect_to @fleet, notice: 'Fleet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fleet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @deliverable = Deliverable.find(params[:id])\n\n respond_to do |format|\n if @deliverable.update_attributes(params[:deliverable])\n format.html { redirect_to @deliverable, :notice => 'Deliverable was successfully updated.' }\n format.json { respond_with_bip(@deliverable)}\n else\n format.html { render :action => \"edit\" }\n format.json { respond_with_bip(@deliverable)}\n end\n end\n end", "def update\n @ready_for_shipment_batch = ReadyForShipmentBatch.find(params[:id])\n\n respond_to do |format|\n if @ready_for_shipment_batch.update_attributes(params[:ready_for_shipment_batch])\n format.html { redirect_to @ready_for_shipment_batch, notice: 'Ready for shipment batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ready_for_shipment_batch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @followship.update(followship_params)\r\n format.html { redirect_to @followship, notice: 'Followship was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @followship }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @followship.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @friendship.update_attributes(:accept => params[:accept])\n format.html { redirect_to @friendship, notice: 'Friendship is successfully updated.' }\n format.json { render :show, status: :ok, location: @friendship }\n else\n format.html { render :edit }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ship_armor_slot.update(ship_armor_slot_params)\n format.html { redirect_to @ship_armor_slot, notice: 'Ship armor slot was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship_armor_slot }\n else\n format.html { render :edit }\n format.json { render json: @ship_armor_slot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @repuesto_bolet.update(repuesto_bolet_params)\n format.html { redirect_to @repuesto_bolet, notice: 'Repuesto bolet was successfully updated.' }\n format.json { render :show, status: :ok, location: @repuesto_bolet }\n else\n format.html { render :edit }\n format.json { render json: @repuesto_bolet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n respond_to do |format|\n if @friendship.update(friendship_params)\n format.html { redirect_to @friendship, notice: \"Friend request accepted!\" }\n format.json { render :show, status: :ok, location: @friendship }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @status.update(isshared: params[:isshared])\n format.json { head :no_content }\n else\n format.json {\n render json: @status.errors,\n status: :unprocessable_entity\n }\n end\n end\n end", "def update\n @banana = Banana.find(params[:id])\n\n respond_to do |format|\n if @banana.update_attributes(params[:banana])\n format.html { redirect_to @banana, :notice => 'Banana was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @banana.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @inventorship = Inventorship.find(params[:id])\n\n respond_to do |format|\n if @inventorship.update_attributes(params[:inventorship])\n flash[:notice] = 'Inventorship was successfully updated.'\n format.html { redirect_to(@inventorship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventorship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @blueprint.update(blueprint_params)\n format.html { redirect_to @blueprint, notice: 'Blueprint was successfully updated.' }\n format.json { render :show, status: :ok, location: @blueprint }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @blueprint.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ship_weapon.update(ship_weapon_params)\n format.html { redirect_to @ship_weapon, notice: 'Ship weapon was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship_weapon }\n else\n format.html { render :edit }\n format.json { render json: @ship_weapon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @authorship = Authorship.find(params[:id])\n\n respond_to do |format|\n if @authorship.update(authorship_params)\n flash[:notice] = 'Authorship was successfully updated.'\n format.html { redirect_to(@authorship.book) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @authorship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @township.update(township_params)\n format.html { redirect_to @township, notice: 'Township was successfully updated.' }\n format.json { render :show, status: :ok, location: @township }\n else\n format.html { render :edit }\n format.json { render json: @township.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @barrack = Barrack.find(params[:id])\n\n respond_to do |format|\n if @barrack.update_attributes(params[:barrack])\n format.html { redirect_to @barrack, notice: 'Barrack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @barrack.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @apologetic.update(apologetic_params)\n format.html { redirect_to @apologetic, notice: 'Apologetic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @apologetic.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { redirect_to(@friendship, :notice => 'Friendship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friendship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @game.battling_armies.each do |army|\n army.is_loser = true if army.is_winner == false\n army.save\n end\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cargo = current_scope.find(params[:id])\n\n respond_to do |format|\n if @cargo.update_attributes(params[:cargo])\n format.html { redirect_to admin_cargo_outs_path, notice: 'current_scope was successfully updated.' }\n format.json { head :no_content }\n else\n @shippings = @cargo.shippings.includes(:to_huozhan) + current_user.huozhan.ship_outs.with_status(\"received\").with_to_huozhan(params[:to]).includes(:to_huozhan)\n format.html { render action: \"edit\" }\n format.json { render json: @cargo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # Logic to update a record\n @shipment = Shipment.find(params[:id])\n\n respond_to do |format|\n if @shipment.update_attributes(params[:shipment])\n format.html { redirect_to @shipment, notice: 'Shipment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shipment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n WasabbiModship.transaction do\n @wasabbi_modship = WasabbiModship.find(params[:id])\n\n respond_to do |format|\n if @wasabbi_modship.update_attributes(params[:wasabbi_modship])\n flash[:notice] = 'WasabbiModship was successfully updated.'\n format.html { redirect_to(@wasabbi_modship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wasabbi_modship.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def update\n @authorship = Authorship.find(params[:id])\n\n respond_to do |format|\n if @authorship.update_attributes(params[:authorship])\n flash[:notice] = 'Authorship was successfully updated.'\n format.html { redirect_to authorship_url(@authorship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @authorship.errors.to_xml }\n end\n end\n end", "def update\n respond_to do |format|\n if User.update(current_user.id, :game_id => params[:id])\n format.json { head :no_content }\n end\n end\n end", "def update\n respond_to do |format|\n if @fleet.update(fleet_params)\n format.html { redirect_to @fleet, notice: 'Fleet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fleet.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:presentacion][:activo]\n id = params[:id]\n Presentacion.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n respond_to do |format|\n if @kinship.update(kinship_params)\n format.html { redirect_to @kinship, notice: 'Kinship was successfully updated.' }\n format.json { render :show, status: :ok, location: @kinship }\n else\n format.html { render :edit }\n format.json { render json: @kinship.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def update\n @payable = Payable.find(params[:payable_id])\n @payable_shipment = @payable.payable_shipments.find(params[:id])\n\n respond_to do |format|\n if @payable_shipment.update_attributes(params[:payable_shipment])\n format.html { redirect_to([@payable_shipment.payable, @payable_shipment], :notice => 'Payable shipment was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @payable_shipment.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.6758441", "0.6562153", "0.65591365", "0.6439037", "0.63681656", "0.6357641", "0.626143", "0.6250236", "0.62233746", "0.6206132", "0.61961305", "0.61761284", "0.61761284", "0.6104844", "0.60774344", "0.60728025", "0.60728025", "0.60598695", "0.6029983", "0.60124785", "0.6005494", "0.6001663", "0.59983647", "0.59876406", "0.59876406", "0.59822845", "0.595898", "0.5954694", "0.59439576", "0.5908098", "0.59042096", "0.58921236", "0.5878202", "0.58772725", "0.58466345", "0.58347034", "0.58325166", "0.5826452", "0.5814921", "0.5814921", "0.58092046", "0.58061737", "0.5797113", "0.57805014", "0.5776031", "0.57651484", "0.576397", "0.57613885", "0.57481164", "0.5748003", "0.5736491", "0.5736058", "0.5734512", "0.57311416", "0.5724006", "0.5718744", "0.57174826", "0.5716083", "0.57054436", "0.56997657", "0.56936336", "0.5692599", "0.5688375", "0.5685816", "0.56853217", "0.5685115", "0.5679918", "0.56782854", "0.5675666", "0.56739837", "0.56674767", "0.5667117", "0.5663143", "0.5660292", "0.5658585", "0.56553817", "0.565282", "0.5650737", "0.5649161", "0.5647996", "0.56440175", "0.56425196", "0.56410635", "0.5639549", "0.5638782", "0.5630448", "0.56205463", "0.5617693", "0.56152713", "0.5614573", "0.5613905", "0.56136334", "0.5612567", "0.5610776", "0.5606473", "0.5603343", "0.56026316", "0.55982405", "0.5593374", "0.5587816" ]
0.6813494
0
DELETE /ambassadorships/1 DELETE /ambassadorships/1.json
def destroy @ambassadorship.destroy @ambassadorship = Ambassadorship.new(area: @ambassadorship.area) respond_to do |format| format.html { redirect_to ambassadorships_url, notice: t('.notice') } format.json { head :no_content } format.js { render :destroy } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ab_reltionship.destroy\n respond_to do |format|\n format.html { redirect_to ab_reltionships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @monitorship = Monitorship.find(params[:id])\n @monitorship.destroy\n\n respond_to do |format|\n format.html { redirect_to monitorships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :ok }\n end\n end", "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @discipleship.destroy\n respond_to do |format|\n format.html { redirect_to discipleships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @spaceship = Spaceship.find(params[:id])\n @spaceship.destroy\n\n respond_to do |format|\n format.html { redirect_to spaceships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to(internships_url) }\n format.json { head :ok }\n end\n end", "def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @shipfleet.destroy\n respond_to do |format|\n format.html { redirect_to shipfleets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship.destroy\n respond_to do |format|\n format.html { redirect_to ships_url, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @manifestship.destroy\n respond_to do |format|\n format.html { redirect_to manifestships_url, notice: 'Manifestship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @fleet_ship.destroy\n respond_to do |format|\n format.html { redirect_to fleet_ships_url, notice: 'Fleet ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @voivodeship = Voivodeship.find(params[:id])\n @voivodeship.destroy\n\n respond_to do |format|\n format.html { redirect_to voivodeships_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: UserBoards.delete(params[\"id\"])\n end", "def destroy\n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_url, notice: 'Player ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @friendship = @user.friendships.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to game_user_friendships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shipcount.destroy\n respond_to do |format|\n format.html { redirect_to shipcounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @memeber_ship = MemeberShip.find(params[:id])\n @memeber_ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(memeber_ships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ambush = Ambush.find(params[:id])\n @ambush.destroy\n\n respond_to do |format|\n format.html { redirect_to ambushes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to(internships_url) }\n format.xml { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @mentorship = Mentorship.find(params[:id])\n @mentorship.destroy\n\n respond_to do |format|\n format.html { redirect_to mentorships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(authorships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @inventorship = Inventorship.find(params[:id])\n @inventorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventorships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @township.destroy\n respond_to do |format|\n format.html { redirect_to townships_url, notice: 'Township was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to authorships_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @committees_voivodeship = CommitteesVoivodeship.find(params[:id])\n @committees_voivodeship.destroy\n\n respond_to do |format|\n format.html { redirect_to committees_voivodeships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @championship = Championship.find(params[:id])\n @championship.destroy\n\n respond_to do |format|\n format.html { redirect_to championships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shiping.destroy\n respond_to do |format|\n format.html { redirect_to shipings_url, notice: 'Shiping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kojenadult_adults_whatexamedship = KojenadultAdultsWhatexamedship.find(params[:id])\n @kojenadult_adults_whatexamedship.destroy\n\n respond_to do |format|\n format.html { redirect_to(kojenadult_adults_whatexamedships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship_class = ShipClass.find(params[:id])\n @ship_class.destroy\n\n respond_to do |format|\n format.html { redirect_to ship_classes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @request_friendship.destroy\n respond_to do |format|\n format.html { redirect_to request_friendships_url, notice: 'La solicitud de amistad fue eliminada con éxito.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @followship.destroy\n respond_to do |format|\n format.html { redirect_to followships_url, notice: 'Followship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @replyship = Replyship.find(params[:id])\n @replyship.destroy\n\n respond_to do |format|\n format.html { redirect_to(replyships_url) }\n format.xml { head :ok }\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 @followship.destroy\n respond_to do |format|\n format.html { redirect_to followships_url, notice: 'Followship was successfully unfollowed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @guardianship = Guardianship.find(params[:id])\n @guardianship.destroy\n\n respond_to do |format|\n format.html { redirect_to guardianships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @fellowship.destroy\n respond_to do |format|\n format.html { redirect_to fellowships_url, notice: 'Fellowship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kojenadults_classe_ship = KojenadultsClasseShip.find(params[:id])\n @kojenadults_classe_ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(kojenadults_classe_ships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @steamshipline.destroy\n respond_to do |format|\n format.html { redirect_to steamshiplines_url, notice: 'Steamshipline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @airplane = Airplane.find(params[:id])\n @airplane.destroy\n\n respond_to do |format|\n format.html { redirect_to airplanes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to friendships_url, notice: \"Friens request denied\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @sabio = Sabio.find(params[:id])\n @sabio.destroy\n\n respond_to do |format|\n format.html { redirect_to sabios_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ship_methods = ShipMethods.find(params[:id])\n @ship_methods.destroy\n\n respond_to do |format|\n format.html { redirect_to(ship_methods_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ambassador.destroy\n respond_to do |format|\n format.html { redirect_to ambassadors_url, notice: 'Ambassador was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @internships_user = InternshipsUser.find(params[:id])\n @internships_user.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_users_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship_weapon.destroy\n respond_to do |format|\n format.html { redirect_to ship_weapons_url, notice: 'Ship weapon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @society_member_ship.destroy\n respond_to do |format|\n format.html { redirect_to society_member_ships_url, notice: 'Society member ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mentorship = Mentorship.find(params[:id])\n @mentorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(mentorships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @live_aboard.destroy\n respond_to do |format|\n format.html { redirect_to live_aboards_url, notice: 'Live aboard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @banana = Banana.find(params[:id])\n @banana.destroy\n\n respond_to do |format|\n format.html { redirect_to bananas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n WasabbiModship.transaction do\n @wasabbi_modship = WasabbiModship.find(params[:id])\n @wasabbi_modship.destroy\n\n respond_to do |format|\n format.html { redirect_to(wasabbi_modships_url) }\n format.xml { head :ok }\n end\n end\n end", "def destroy\n @airplane.destroy\n respond_to do |format|\n format.html { redirect_to airplanes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @farmacium.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship_group.destroy\n respond_to do |format|\n format.html { redirect_to ship_groups_url, notice: 'Ship group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_regedship = StudentRegedship.find(params[:id])\n @student_regedship.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_regedships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @status_animal = StatusAnimal.find(params[:id])\n @status_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to status_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shipmment_item.destroy\n respond_to do |format|\n format.html { redirect_to shipmment_items_url, notice: \"Shipmment item was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n logger.info(\"Delete friend_id 33333\")\n logger.info(\"Delete friend_id #{params[:user_id]}\")\n @friendship.destroy\n if request.format.json?\n render text: \"Delete\"\n else\n @friendship.destroy\n redirect_to friendships_url \n end \n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @shipdesign = Shipdesign.find(params[:id])\n @shipdesign.destroy\n\n respond_to do |format|\n format.html { redirect_to shipdesigns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @battle.destroy\n respond_to do |format|\n format.html { redirect_to battles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @battle.destroy\n respond_to do |format|\n format.html { redirect_to battles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stone = Stone.find(params[:id])\n @stone.destroy\n\n respond_to do |format|\n format.html { redirect_to stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship_fitting.destroy\n respond_to do |format|\n format.html { redirect_to ship_fittings_url, notice: 'Ship fitting was successfully destroyed.' }\n format.json { head :no_content }\n end\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 @ambit.destroy\n respond_to do |format|\n format.html { redirect_to ambits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ship_placement.destroy\n respond_to do |format|\n format.html { redirect_to ship_placements_url, notice: 'Ship placement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to(friendships_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n # prevent user from deleting a friendship which cannot be found.\n if !(@friendship)\n render json: {error: \"Friendship not found\"}, status: 404\n else\n @friendship.destroy\n render status: 204\n end\n end", "def destroy\n ship = Sailing.joins(:travelling_parties => :party_registers).find_by(\"party_registers.id\" => params[:id]).cruise_ship_name\n @party_register.destroy\n respond_to do |format|\n format.html { redirect_to user_dashboard_path, notice: \"You have left #{ship} sailing\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @championship.destroy\n\n head :no_content\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 @stash = Stash.find(params[:id])\n @stash.destroy\n\n respond_to do |format|\n format.html { redirect_to stashes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @barrack = Barrack.find(params[:id])\n @barrack.destroy\n\n respond_to do |format|\n format.html { redirect_to barracks_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @ami = Ami.find(params[:id])\n @ami.destroy\n\n respond_to do |format|\n format.html { redirect_to amis_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @battle = Battle.find(params[:id])\n @battle.destroy\n\n respond_to do |format|\n format.html { redirect_to battles_url }\n format.json { head :no_content }\n end\n end", "def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end", "def destroy\n @neighbourhood.destroy\n respond_to do |format|\n format.html { redirect_to neighbourhoods_url, notice: 'Neighbourhood was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gameboard = Gameboard.find(params[:id])\n @gameboard.destroy\n\n respond_to do |format|\n format.html { redirect_to gameboards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Friendship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_banco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_bancos_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to badges_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 @shipment = Shipment.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shipment = Shipment.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7468423", "0.73904705", "0.7234936", "0.7204991", "0.71942276", "0.7180705", "0.7180705", "0.7180705", "0.71706295", "0.7120672", "0.7117969", "0.70641387", "0.70641387", "0.70409733", "0.6977525", "0.69609594", "0.6939803", "0.6919941", "0.68774265", "0.68427783", "0.6840841", "0.68322676", "0.68052983", "0.6802402", "0.6799162", "0.6798868", "0.67495006", "0.6748436", "0.6691083", "0.66818446", "0.6680416", "0.6658628", "0.66575813", "0.6656867", "0.6645785", "0.66422415", "0.6639095", "0.6605397", "0.66012955", "0.6584517", "0.65817386", "0.65729487", "0.6542581", "0.6542549", "0.6534216", "0.6527398", "0.65273416", "0.6517986", "0.6509292", "0.6504631", "0.64938515", "0.64931935", "0.6488453", "0.6477685", "0.6468492", "0.64591765", "0.6458179", "0.6454847", "0.64513266", "0.64494437", "0.64461184", "0.64402854", "0.64361936", "0.64348423", "0.6432954", "0.6428292", "0.6424314", "0.6411251", "0.64097315", "0.6409137", "0.64074814", "0.6399465", "0.6399465", "0.6396213", "0.63933957", "0.63909703", "0.63851535", "0.6383822", "0.6376113", "0.63729656", "0.63698804", "0.6352948", "0.6350228", "0.63480073", "0.6340768", "0.6340167", "0.63395983", "0.63371134", "0.63368315", "0.6330723", "0.6329186", "0.6327083", "0.6325321", "0.6323585", "0.6321179", "0.632095", "0.6316695", "0.6314063", "0.6314046", "0.6314046" ]
0.74057776
1
Only allow for create action
def new_ambassadorship @ambassadorship = Ambassadorship.new(ambassadorship_params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth_create_filter\n if not self.class.allowed_to_create\n false\n else\n true\n end\n end", "def put_can_create?\n false\n end", "def only_create!\n self.operation = :only_create\n end", "def can_create?\n allows_current_user_access_to? :create\n end", "def patch_can_create?\n false\n end", "def _create\n true\n end", "def can_create?(obj)\n false\n end", "def can_create?(obj)\n false\n end", "def create?\n # false # no access\n user.present? # minimum requirement for creating records \n # like posts or comments is that a user exist and be logged in. \n end", "def create_access_check\n permission_check('create')\n end", "def create_access_check\n permission_check('create')\n end", "def create_access_check\n permission_check('create')\n end", "def create?\n false\n end", "def create?\n #everyone who is loggedin can do this action\n true\n end", "def create?\n true\n end", "def create?\n true\n end", "def create?\n true\n end", "def create?\n true\n end", "def create?\n true\n end", "def create?\n true\n end", "def create?\n true\n end", "def can_create\n raise ActionController::RoutingError 'Forbidden' if current_user.nil? || cannot?(:write, :posts)\n true\n end", "def valid?(*args)\n super(:create)\n end", "def create\n #\n # NO-OP\n #\n end", "def create\r\n end", "def canCreate?(user=current_user)\n return false if user.nil?\n true\n end", "def create?\n name == :create\n end", "def create; end", "def create; end", "def create; end", "def create; end", "def creatable_without_user\n false\n end", "def create\n end", "def post_is_create?\n\t\ttrue\n\tend", "def create?\n @current_user.permission('Bid', :clerk)\n end", "def create\n end", "def create\n end", "def create\n end", "def create \n end", "def create \n end", "def create?\n return true\n end", "def create?\n return true\n end", "def create\n\tend", "def create\n\tend", "def create\n\tend", "def create\n\tend", "def create\n\tend", "def create?\n return true\n end", "def create\n #\n end", "def create\n #\n end", "def create\n #\n end", "def authorized_for_create?\n current_user.is_admin\n end", "def valid_by_screen_authorize_create?(action)\n return true unless current_user\n self.class::SENSITIVE_ACTIONS.exclude?(action[:name].to_s) || screen.authorize_create?\n end", "def new?\n\t\tcreate?\n\tend", "def create\n respond_to do |format|\n format.html { render :text => \"You don't have permission to view this\" }\n end\n end", "def create\n raise \"Not supported\"\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n end", "def create\n\n\tend", "def createonly()\n merge(createonly: 'true')\n end", "def create?\n !@current_user.admin?\n end" ]
[ "0.8085444", "0.78276765", "0.7824523", "0.773198", "0.75993186", "0.7487814", "0.7476423", "0.7476423", "0.74034476", "0.73480743", "0.73480743", "0.73480743", "0.7282872", "0.7278761", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.7195469", "0.71845573", "0.71560943", "0.71167064", "0.71078575", "0.708051", "0.7075797", "0.70696646", "0.70696646", "0.70696646", "0.70696646", "0.70412755", "0.7040656", "0.70405465", "0.7037424", "0.7019607", "0.7019607", "0.7019607", "0.70055884", "0.70055884", "0.69853234", "0.69853234", "0.69744146", "0.69744146", "0.69744146", "0.69744146", "0.69744146", "0.6963891", "0.69573075", "0.69573075", "0.69573075", "0.6953126", "0.6929711", "0.6912634", "0.69016993", "0.68840957", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68819773", "0.68805164", "0.6851367", "0.6839576" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_ambassadorship @ambassadorship = Ambassadorship.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 ambassadorship_params params.require(:ambassadorship).permit(:user_id, :area_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def 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 active_code_params\n params[:active_code].permit\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def filter_parameters; end", "def filter_parameters; end", "def list_params\n params.permit(:name)\n 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 admin_social_network_params\n params.require(:social_network).permit!\n end", "def url_whitelist; 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 filter_params\n params.require(:filters).permit(:letters)\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 user_params\n params.permit(:name, :age, :username, :display_photo, :password)\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 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.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.6293856", "0.6290323", "0.62816143", "0.6241851", "0.6241208", "0.622036", "0.62128764", "0.62110275", "0.61966056", "0.61776453", "0.617547", "0.6174961", "0.61654735", "0.6153256", "0.61516005", "0.6149498", "0.6123234", "0.6118653", "0.61077267", "0.61061186", "0.6093616", "0.608318", "0.6074428", "0.60650206", "0.60244286", "0.6020295", "0.60155797", "0.6012826", "0.6010141", "0.6010141", "0.60037106", "0.600298", "0.59979576", "0.5994806", "0.5994283", "0.5993927", "0.5980616", "0.59667075", "0.59614897", "0.59610957", "0.596071", "0.5959614", "0.59554", "0.59542966", "0.5946781", "0.5940262", "0.5940262", "0.59401053", "0.5937168", "0.5932135", "0.59293395", "0.592659", "0.59202623", "0.59112674", "0.59088206", "0.590716", "0.59056735", "0.589997", "0.5899655", "0.5898926", "0.5896042", "0.589589", "0.5895867", "0.58894163", "0.5884936", "0.5879227", "0.58740723", "0.5871364", "0.5870148", "0.5869228", "0.5868196", "0.5867967", "0.5865532", "0.58653617", "0.58644646", "0.58631665", "0.5862611", "0.5857609", "0.58558804", "0.5853729", "0.5853025" ]
0.0
-1
Fetch user projects from Github
def fetch_projects! projects.destroy_all if github? result = YAML.load open("http://github.com/api/v2/yaml/repos/show/#{github}/") result['repositories'].each do |repository| projects.create! :name => repository[:name], :description => repository[:description] end end rescue OpenURI::HTTPError # user not found, ignore end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def github_projects\n Rails.cache.fetch(\"/users/#{self.id}/github_projects\", :expires_in => 1.day) {\n gh = Github.new(authentications.where(:provider => 'github').first.provider_token)\n gh.repos\n }\n end", "def projects\n @projects ||= begin\n http = Net::HTTP.new(API_HOST, API_PORT)\n http.use_ssl = true\n http.ca_file = (Twigg.root + 'files' + 'github.pem').to_s\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n uri = ORG_REPOS_ENDPOINT % Config.github.organization\n headers = { 'Authorization' => \"token #{Config.github.token}\" }\n\n [].tap do |names|\n begin # loop: page through project list\n request = Net::HTTP::Get.new(uri, headers)\n response = http.request(request)\n raise \"Bad response #{response.inspect}\" unless response.is_a?(Net::HTTPOK)\n names.concat JSON[response.body].map { |repo| repo['name'] }\n uri = parse_link(response['Link'])\n end until uri.nil?\n end\n end\n end", "def get_repos\n # using oauth token to increase limit of request to github api to 5000\n client = Octokit::Client.new :access_token => self.github_token\n (client.repositories self.github_name, {:type => 'all'}).map do |repo|\n repo.full_name\n end\n end", "def github_user_and_project(github_url)\n matches = /github\\.com.(.*?)\\/(.*)/.match(github_url)\n matches ? [matches[1], matches[2].sub(/\\.git\\z/, '')] : [nil, nil]\n end", "def user_repos\n @repos = @github.repos.list user: params[:username]\n render json: @repos\n end", "def get_my_repos\n repos = []\n\n (1..get_total_repo_pages_count.to_i).each do |index|\n get_json( \"#{ GITHUB_USER_REPOS_URL }?per_page=100&page=#{ index }\" ).each do |item|\n repos << item[ 'full_name' ]\n end\n end\n\n return repos\nend", "def projects\n @projects ||= begin\n user = api('user')\n api(\"users/#{user['id']}/projects\").sort_by { |p| p['id'] }\n end\nend", "def get_all_user_repos\n user = User.find_by(uuid: params[:uuid])\n\n client = Octokit::Client.new(:access_token => user.password)\n repo_list = []\n client.repositories(:user => user.gh_username).each { |repo|\n repo_list.push(repo.name)\n }\n render :json => {:repos => repo_list}\n end", "def get\n CircleCi.request(conf, '/projects').get\n end", "def projects(params = {})\n make_get_request('/account/projects', params)\n end", "def show\n user= params[:user]\n repo= params[:repo]\n puts user\n puts repo\n url = BASE_URL + \"repos/\" + user + \"/\" + repo + \"/collaborators\"+ \"?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\"\n # url = BASE_URL + \"repos/rails/rails/collaborators\"\n # url = BASE_URL + \"repositories\"\n @repo = JSON.parse(open(url).read)\n @results = []\n\n\n @repo.each do |doc|\n ids = doc['login']\n url_people = BASE_URL + \"users/\" + ids + \"?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\"\n @results << JSON.parse(open(url_people).read)\n end\n\n end", "def get_public_repos(user_name)\n get(\"/users/#{user_name}/repos\")\n end", "def fetch_github_information\n self.associated_commit_shas = []\n self.branch_name = nil\n self.username = nil\n\n return if self.dev_build\n\n GithubService.run(self.project.github_root_url, self.project.github_repo) do |service|\n if self.is_branch_build\n self.associated_commit_shas = service.github_commits(10, self.commit_sha)\n self.branch_name = nil\n self.username = nil\n else\n self.associated_commit_shas = []\n info = service.user_and_branch_for_pull_request(self.pull_request_number)\n self.username = info[:user]\n self.branch_name = info[:branch]\n end\n end\n end", "def acquire_repo_list\n set_auth\n set_github_repo_name\n repo_list = []\n (@github.repos.list org: GITHUB_ORG).each do |l|\n repo_list << l[:name]\n end\n repo_list\nend", "def users_projects(user_id, params = {})\n make_get_request(\"/user/#{user_id}/projects\", params)\n end", "def get_my_pull_requests\n repos_to_get = GITHUB_REPOS.kind_of?( Array ) ? GITHUB_REPOS : get_my_repos\n\n repos_to_get.each do |repo|\n status = []\n pulls_url = \"#{ GITHUB_REPOS_URL }/#{ repo }/pulls?state=open\"\n\n get_json( pulls_url ).each_with_index do |item, index|\n sha = item[ 'head' ][ 'sha' ]\n status_url = \"#{ GITHUB_REPOS_URL }/#{ repo }/commits/#{ sha }/status\"\n\n status << get_json( status_url )\n\n unless item[ 'assignee' ].nil?\n if item[ 'assignee' ][ 'login' ] == ENV[ 'GITHUB_USERNAME' ]\n color = ''\n state = status[ index ][ 'state' ]\n\n unless status[ index ][ 'statuses' ].empty?\n color = \"| color=#{ determine_status_color( state )}\"\n end\n\n puts \"#{ repo }: ##{ item[ 'number' ] } #{ item[ 'title' ] } #{ color } | href=#{ item[ 'html_url' ] }\"\n end\n end\n end\n end\nend", "def find_repositories\n @repos = GithubApi.call :repos\n end", "def projects\n request(method: 'getAllProjects')\n end", "def show\n @repo_cred = @repo.repo_creds.where(created_by_id: current_user.id).first || @repo.repo_creds.new\n @repo_projects = @repo.projects @repo_cred\n logger.debug \"@repo_projects: #{@repo_projects}\"\n end", "def get_repos project_id\n $logger.info \"Getting repos\"\n\n # from the bitbucket api\n rest_endpoint = \"/rest/api/1.0/projects/#{PROJECT_ID}/repos\"\n\n http = Net::HTTP.new(BASE_GIT_URL, BASE_GIT_PORT)\n repos_request = Net::HTTP::Get.new(\"/rest/api/1.0/projects/#{PROJECT_ID}/repos?limit=1000\")\n repos_request.basic_auth GIT_USER, GIT_PASSWORD\n repos_response = http.request(repos_request)\n repos_response.value\n\n # https://confluence.atlassian.com/bitbucket/what-is-a-slug-224395839.html\n repos_body = JSON.parse(repos_response.body)\n repos = repos_body['values'].map { |v| v['slug'] }\n\n $logger.info \"Found repos #{repos}\"\n\n return repos\nend", "def get_repo_users\n repo_users = Array.new\n github = Github.new :oauth_token => github_token\n\n github.repos.list.body.each do |repo|\n repo_users << repo[\"owner\"][\"login\"]\n end\n\n repo_users\n end", "def show_repo_list\n # Synchronize user's id_github with Git Hub (4 days between refreshs)\n @owner.sync_github!(4.days).save!\n \n # Synchronize list of user's projects (4 hours between refreshs)\n if @owner.sync_projects_delay?(4.hours)\n github_projects = @owner.get_github_projects\n \n if github_projects\n @owner.upd_projectlist_at = Time.now\n repos = CacheRepo.where(path: github_projects)\n \n # Drop any projects than no more exist in the user space\n if repos.length > 0\n CacheRepo.where.not(id: repos.map(&:id)).where(owner: @owner).delete_all\n end\n \n # Add any new project to this user\n (github_projects - repos.map(&:path)).each do |github_project_new|\n new_project = CacheRepo.new(path: github_project_new, owner: @owner)\n # Alway be aware of we have multiple workers and possibility concurrent insert\n if !new_project.save\n new_project = CacheRepo.where(path: github_project_new).first\n new_project.owner = @owner\n new_project.save!\n end\n end\n end\n @owner.save!\n end\n \n # Repository information will be refreshed only if the user request it\n # So, this action is more light than #show_repo_details\n @projects = CacheRepo.where(owner: @owner)\n respond_to do |format|\n format.html { render }\n format.json { render :show_repo_list, status: :ok, location: @owner }\n end\n end", "def get_projects\n me = request('/services/v5/me')\n me['projects']\n end", "def get_repo_names github_username , git_token\n\n Rails.cache.fetch(\"#{self.id}/repo_names\", expires_in: 6.hours) do\n repo_names = Array.new\n github = Github.new :oauth_token => git_token\n\n github.repos.list.body.each do |repo|\n if github_username == repo[\"owner\"][\"login\"]\n repo_names << { :user=>github_username ,:repo=>repo[\"name\"]}\n end\n end\n\n orgs_names = Array.new\n github.orgs.list.each do |org|\n orgs_names << org[\"login\"]\n end\n\n orgs_names.each do |oname|\n url = \"orgs/\"+oname+\"/repos\"\n \n github.get_request(url,Github::ParamsHash.new({})).each do |orepo|\n if oname == orepo[\"owner\"][\"login\"]\n repo_names << { :user=>oname ,:repo=>orepo[\"name\"]}\n end\n end\n end\n repo_names\n end\n end", "def users_for_a_project\n uri = \"#{@api_url}/#{@project_id}/users?access_token=#{@access_token}\"\n get uri\n end", "def pull_requests_from_github\n @github.search_issues(\"is:pr state:open user:#{ORGANISATION}\").items\n end", "def projects(params = {})\n fetch_all('projects', 'projects', params)\n end", "def projects\n @projects ||= Harvest::API::Projects.new(credentials)\n end", "def getprojects()\n printRepoHeader\n \n loop do\n # Print each of the new returned repositories\n begin\n get.each do |repo|\n printRepo(repo) if (@slugs.add?(repo['slug']))\n\n # Flush to prevent data loss if we crash\n STDOUT.flush\n end\n rescue Exception => msg\n STDERR.puts \"WARNING: Poll failed at #{Time.now}\"\n STDERR.puts msg\n end\n\n # Poll every 5 minutes\n sleep 300\n end\n end", "def list\n @connection.get('/user/repos').map do |repo_data|\n Rails.logger.info \"listing repos\"\n GitHubApi::Repo.new(self, repo_data)\n end\n end", "def index\n @github_users = GithubUser.all\n end", "def find_all_organizations\n get_url(\"https://api.github.com/users/#{current_user.username}/orgs\")\n end", "def repo_info\n # Extract user and project name from GitHub URL.\n url = git_config['remote.origin.url']\n if url.nil?\n puts \"Error: Not a git repository.\"\n return [nil, nil]\n end\n user, project = github_user_and_project(url)\n # If there are no results yet, look for 'insteadof' substitutions in URL and try again.\n unless user && project\n short, base = github_insteadof_matching(config_hash, url)\n if short and base\n url = url.sub(short, base)\n user, project = github_user_and_project(url)\n end\n end\n [user, project]\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_repos\n begin\n @repos ||= github_api_setup.repos.list\n rescue Exception => e\n logger.error \"Github #get_repos error #{e}\"\n end\n end", "def index\n @git_hub_repos = GitHubRepo.all\n end", "def get_repo_list(token, user)\n query = %{\n query ($user: String!, $cursor: String) {\n user(login: $user) {\n repositories(first: 100, after: $cursor) {\n edges {\n node {\n name\n owner {\n login\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n }\n\n vars = { user: user, cursor: nil }\n\n repos = []\n\n loop do\n result = Github.query(token, query, vars)\n repos += result.dig(\"data\", \"user\", \"repositories\", \"edges\") || []\n break unless result.dig(\"data\", \"user\", \"repositories\", \"pageInfo\", \"hasNextPage\")\n vars[:cursor] = result.dig(\"data\", \"user\", \"repositories\", \"pageInfo\", \"endCursor\")\n end\n\n repos.map { |e| { owner: e.dig(\"node\", \"owner\", \"login\"), name: e.dig(\"node\", \"name\") } }\nend", "def fetch_from_github\n repo, branch, path = Post.parse_github_url self.github\n Environment.github.contents repo, ref: branch, path: path\n end", "def projects\n tmp = client.get @json['user']['links']['projects']\n tmp['projects'].map do |project_meta|\n project_uri = project_meta['project']['links']['self']\n project = client.get project_uri\n client.factory.create(GoodData::Project, project)\n end\n end", "def travis_repos\n x = $travis_conn.get 'owner/ropenscibot/repos'\n x.travis_raise\n return MultiJson.load(x.body)\nend", "def find_repos(user)\n user.repos\n end", "def project_from_github(input)\n Github::ProjectMapper\n .new(Api.config.GITHUB_TOKEN)\n .find(input[:owner_name], input[:project_name])\n rescue StandardError\n raise GH_NOT_FOUND_MSG\n end", "def getProject(projectName)\n data = CLIENT.repository(projectName)\n return data\nend", "def github_client\n p = Project.find(params[:id])\n if p.github_token\n github = Github.new :oauth_token => p.github_token\n else\n github = Github.new :client_id => GITHUB_CLIENT_ID , :client_secret => GITHUB_CLIENT_SECRET\n end\n end", "def index\n if (params[:search]) && (params[:search].empty? == false) \n urlformated = URI.encode(params[:search])\n uri = URI.parse(\"https://api.github.com/legacy/repos/search/#{urlformated}\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = (uri.scheme == 'https')\n \n \n request = Net::HTTP::Get.new(uri.request_uri)\n \n res = http.request(request)\n response = JSON.parse(res.body)\n \n\n repository = response['repositories'].map {|rd|\\\n GithubRepository.new( rd['owner'], rd['name'],\\\n rd['description'], rd['language'], rd['url'])} \n \n @github_repositories = repository\n else\n @github_repositories = nil\n end \n end", "def index\n @repos = @user.repos.includes(:user)\n render json: to_json(@repos)\n end", "def project_from_github(input)\n Github::ProjectMapper\n .new(App.config.GITHUB_TOKEN)\n .find(input[:owner_name], input[:project_name])\n rescue StandardError\n raise GH_NOT_FOUND_MSG\n end", "def projects\n Sifter.\n get(\"/api/projects\").\n parsed_response[\"projects\"].\n map { |p| Sifter::Project.new(p) }\n end", "def repos\n api.repos.map(&:to_hash)\n end", "def index\n @users = User.all\n if current_user.pivitol_tracker_token != nil\n tracker_api = TrackerAPI.new\n @tracker_projects = tracker_api.projects(current_user.pivitol_tracker_token)\n end\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 repos\n client.repos({}, query: { sort: \"asc\" })\n end", "def projects(params = nil)\n params = params.merge({ :current_user => @options[:current_user]})\n params = params.except(:manufacturer_id, :catg_slug, :office_id, :max_matches)\n params[:order] ||= 'recently_active'\n\n @projects_response = ProjectsIndexPresenter.new(params[:current_user], params).response\n projects = @projects_response[:projects] || []\n projects\n end", "def load_json\n uri = URI.parse(\"https://api.github.com/users/#{@login}/repos\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n JSON.parse(response.body)\n end", "def get_user_repos(username) # :yields: JSON\n uri=URI.parse(@@uri_builder.user_repos_url(username,@@app_token))\n http=HttpHandler.initiate_http(uri)\n begin\n response=HttpHandler.get_response(http,uri)\n rescue ArgumentError\n puts \"Request failed with code: #{response.code}\"\n else\n @@responseStatus=true\n return response\n end\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 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 find_repos\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n @client = Octokit::Client.new(:access_token => @current_user.token)\n\n # get user input from API\n user_input_string = request.params[:_json]\n input_arr = user_input_string.gsub(/\\s+/, \"\").split(\",\")\n\n # search repos using user input\n repoids = input_arr.map do |input|\n repo = @client.repository(input)\n \"#{repo.to_hash[:id]}\"\n end\n\n # Save user search input and repos to UserPreference\n @current_user.UserPreference.search_input = user_input_string\n @current_user.UserPreference.repos = repoids.join(\",\")\n @current_user.UserPreference.save\n\n respond_to do |format|\n format.json {\n render json: repoids.to_json, status: 200\n }\n end\n end", "def get_repositories\n get(\"#{url_base}/repositories?#{dc}\")[\"data\"]\n end", "def listprojects\n get('listprojects.json')['projects']\n end", "def project_users(project_id, params = {})\n make_get_request(\"/projects/#{project_id}/users\", params)\n end", "def index\n @user = User.find(current_user.id)\n @projects = @user.projects.all\n end", "def no_user_get_friends_projects(token)\n @token = token\n @users = get_my_friends(token)\n @projects = []\n @users.each do |u|\n proj = u.projects.approved\n if proj.any?\n proj.each {|p| @projects << p }\n end\n end\n return @projects\n end", "def find_all_collabs_for_repo\n puts \"Enter a repo name with *EXACT* spelling and capitalization:\"\n input = gets_user_input\n repo_by_project_name = find_repo_by_project_name(input)\n if repo_by_project_name == nil\n puts \"No repo found\"\n else\n repo_by_project_name.users.each do |user|\n puts user.github_username\n end\n end\n menu\n end", "def user_repos\n @user_repos ||= (\n talk 'user repos'\n client.repos\n )\n end", "def get_repos\n\t\tif current_user.nil?\n\t\t\t@repos = Repo.where(:user_id => nil)\n\t\telse\n\t\t\t@repos = current_user.repos\n\t\tend\n\tend", "def listProjects \n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/1/projects')\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {\n 'Content-Type'=> 'application/json',\n 'X-RunDeck-Auth-Token'=> API_KEY \n}\n r = http.get(uri.path, headers)\n return r.body.force_encoding(\"UTF-8\")\n\nend", "def available_projects_list\n uri = \"#{@api_url}?access_token=#{@access_token}\"\n get uri\n end", "def projects_by_name(name, opts={})\n @projects_cache[name] ||= begin\n user_query = @allowed_users.collect{|user| \"user:#{user}\"}.join(' ')\n repos = Octokit.search_repos \"#{name} in:name language:ruby #{user_query}\"\n repos = repos.items.select do |repo|\n repo.name == name\n end\n\n repos.collect{|repo| Models::RepoCookbook.new(repo.id, repo.full_name, \"metadata.rb\")}\n end\n end", "def update_from_github(auth, cv)\n cv['email'] = auth.info.email if auth.info.email\n cv['password'] = Devise.friendly_token[0,20] if Devise.friendly_token[0,20]\n cv['name'] = auth.info.name if auth.info.name\n cv['image'] = auth.info.image if auth.info.image\n cv['biography'] = auth.extra.raw_info.bio if auth.extra.raw_info.bio\n token = auth.credentials.token if auth.credentials.token\n tmp = Array.new\n\n uri = URI(auth.extra.raw_info.repos_url)\n\n #repos = JSON.parse(open(uri.to_s, 'Authentication' => \"token #{token}\").read)\n\n HTTP.auth(\"token #{token}\")\n repos = JSON.parse(HTTP.get(uri.to_s).body)\n\n repos.each do |gitPr|\n if not gitPr['fork']\n uri = URI(gitPr['languages_url'])\n lang = JSON.parse(HTTP.get(uri.to_s).body)\n lang.each do |key,_|\n tmp << key\n end\n end\n end\n $uriTmp = auth.extra.raw_info.starred_url.to_s\n $realUri = $uriTmp.gsub(/{(.*?)}/,'')\n\n starred = JSON.parse(HTTP.get($realUri).body)\n starred.each do |gitPr|\n uri = URI(gitPr['languages_url'])\n lang = JSON.parse(HTTP.get(uri.to_s).body)\n lang.each do |key,_|\n tmp << key\n end\n end\n cv['it_languages'] = tmp.uniq\n cv['github_auth'] = true\n end", "def repos(show_commits = false)\n response = @github.repos.list(user: 'siakaramalegos', sort: 'updated', direction: 'desc', page: 1, per_page: 10)\n repos = response.body\n\n repos.each_with_index do |repo, index|\n puts '-' * 80\n date_string = repo.updated_at\n date = DateTime.parse(date_string).to_date\n puts \"(#{index + 1}) #{repo.name}: #{repo.description} (updated: #{date.stamp('12/30/99')})\"\n\n if show_commits\n repo_commits = @github.repos.commits.list('siakaramalegos', repo.name, page: 1, per_page: 10).body\n\n repo_commits.each do |c|\n date_string = c.commit.author.date\n date = DateTime.parse(date_string).to_date\n puts \" #{c.commit.message} (#{date.stamp('12/30/99')})\"\n end\n end\n end\n puts '-' * 80\n repos\n end", "def index\n get_logged_in_user\n @projects = Project.all.select {|project| project.user_id == logged_in_user_id }\n end", "def perform\n @project.repo &:fetch\n end", "def repository\n @repository ||= Github::Repository.find user: user, name: name\n end", "def user_repos_url(username,token) # :yields:String\n BASE_URL + USERS + \"#{username}/\" + \"repos?access_token=#{token}\"\n end", "def index\n # @user = User.find(params[:user_id]) \n @projects = current_user.projects\n end", "def index\n\n\n# # Exchange your oauth_token and oauth_token_secret for an AccessToken instance.\n# def prepare_access_token(oauth_token, oauth_token_secret)\n# consumer = OAuth::Consumer.new(\"e24305f14f7f9a67c465\", \"604015f905f6207ec29f3661b952397663d58347\",\n# { :site => \"https://api.github.com/\",\n# :scheme => :header\n# })\n# # now create the access token object from passed values\n# token_hash = { :oauth_token => oauth_token,\n# :oauth_token_secret => oauth_token_secret\n# }\n# access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n# return access_token\n# end\n\n# # Exchange our oauth_token and oauth_token secret for the AccessToken instance.\n# access_token = prepare_access_token(\"abcdefg\", \"hijklmnop\")\n# # use the access token as an agent to get the home timeline\n# @response = access_token.request(:get, \"https://api.github.com/repos/rails/rails/collaborators\")\n\n\n# curl https://api.github.com/repos/rails/rails/collaborators?client_id=e24305f14f7f9a67c465&client_secret=604015f905f6207ec29f3661b952397663d58347\n\n\n # url = \"https://github.com/login/oauth/authorize\"\n\n # @token = JSON.parse(open(url).read)\n\n @repo = Repo.new\n end", "def projects\n if is_deploy_key\n [project]\n else\n user.projects\n end\n end", "def index\n @orgs ||= Github::Org.orgs(\n current_user_github_access_token,\n current_github_username\n )\n end", "def userSpecificProjects\n #@specific_user = User.find(6) #TEMPORARY: REMOVE LATER\n @specific_user = current_user\n @specific_user_groups = @specific_user.groups\n @specific_user_projects = []\n\n @specific_user_groups.find_each(:batch_size => 5000) do |group|\n group.projects.find_each(:batch_size => 5000) do |project|\n @specific_user_projects << project\n end\n end\n end", "def repo_commits(repos)\n repos_commits = []\n repos.each do |repo|\n repos_commits << HTTParty.get(repo[\"commits_url\"].gsub(\"{/sha}\", \"\"))[0]\n end\n repos_commits\nend", "def index\n github = Github.new\n #@repo = github.repos.get(:user => \"rails\", :repo => \"rails\")\n @page = (params[:page].nil?) ? 1 : params[:page]\n @issues = github.issues.list(:user => 'rails', :repo => 'rails', :per_page => 25, :page => @page.to_i)\n\n @paging = {page: @page.to_i, totalpages: @issues.count_pages}\n\n respond_with(@issues, @paging)\n end", "def fetch_refs(repo_user,repo_name)\n uri = URI(API_BASE_URL+ \"/repos/#{repo_user}/#{repo_name}/git/refs\")\n body = response_body(uri)\n \n if body.instance_of? Array\n body\n elsif body.key?('message') && body['message'].downcase == \"not found\"\n raise \"Unable to fetch #{uri}\" \n else\n puts \"WARNING unexpected body = #{body}\"\n [] \n end\n end", "def pull_requests repo\n name = full_name repo\n \n %w[open closed].reduce([]) do |memo, state|\n memo | octokit.pulls(name, state, :per_page=>100)\n end\n end", "def fetch_ref(repo_user,repo_name, ref_name)\n uri = URI(API_BASE_URL+ \"/repos/#{repo_user}/#{repo_name}/git/#{ref_name}\")\n body = response_body(uri)\n if body.instance_of? Array\n body\n elsif body.key?('message') && body['message'].downcase == \"not found\"\n raise \"Unable to fetch #{uri}\" \n else\n puts \"WARNING unexpected body = #{body}\"\n []\n end\n end", "def projects(req_params = {})\n name = 'Projects'\n params = { req: req_params }\n\n data = endpoint(name: name, params: params).do_get\n\n collection name, data\n end", "def fetch_github_data\n self.info = GithubInfoFetcher.new.call(github_path).to_h\n end", "def repositories_with_pull_requests(reponames = [])\n repositories = []\n page = 1\n loop do\n repositories_in_page = load_repos_in_page(page)\n break if repositories_in_page.empty?\n repositories.concat(repositories_in_page)\n page += 1\n end\n repositories.select! { |repo| reponames.include?(repo.name) } unless reponames.empty?\n repositories.select!(&:any_pull_requests?)\n repositories\n end", "def my_projects\n @projects = Project.where(:client_id => current_user.client_id)\n end", "def get_projects_for_user(user_id)\n projects = []\n\n # get the user\n user = User.find_by_id(user_id)\n\n # get their projects\n my_projects = Project.joins(:project_roles).where(\n project_roles: {user_id: user_id})\n\n # read the projects into a hash with all\n # the required details\n if my_projects\n my_projects.each do |project|\n projects.push(get_project_hash(project, user, nil, nil))\n end\n end\n\n # get all the current projects that have\n # been shared with the user\n shares = ProjectShare.where(\n \"user_id = ? and (accepted is \" + \n \"null or accepted = false)\", user_id)\n\n shares.each do |share|\n project = Project.find_by_id(share.project_id)\n if project\n projects.push(\n get_project_hash(project, user, true, share.code))\n end\n end\n\n projects\n end", "def get_projects_of_user\n respond_to do |format|\n format.json {\n #param = params[:payload]\n #@user = User.find_by_id(param[:id])\n @projects = Project.where(:user_id => @current_user.id)\n if @projects\n render :json => @projects\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "def fetch\n return nil if !repo || !user\n if fetched?\n pull\n else\n clone\n end\n end", "def pull_projects_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/projects?updated_since=#{last_updated_time}\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"projects\"]\n end\n end", "def get_users\n if @project\n if ProjectUser.verify_role(current_user.id, @project, 'client')\n render json: @project.project_users, status: 200\n else\n render json: { error: 'You must be a member of a project to see its content' }, status: :unauthorized\n end\n else\n render json: { error: \"no project found with id of #{params[:id]}\" }, status: 404\n end\n end", "def get_commits(username)\n author = username\n year_commit_list = []\n total_commit_count = 0\n\n ### Using 'github_api' gem for fetching names out of GET request to api.github.com\n repos_names = @github.repos.list(user: author).map {|repo| repo[:name]}\n\n repos_names.each_with_index do |repo_name, index|\n ### Using 'github_api' gem for fetching stats, for particular user and repository name, which is taken from 'repos_names' array\n commits = @github.repos.stats.participation(user: author, repo: repo_name)\n owner_commits_count = 0\n if commits[:owner]\n owner_commits_count = commits[:owner].inject(0) {|memo, i| memo + i}\n end\n ### Counting all commits for a year(for current repository) just for owner\n year_commit_list << \"#{index+1})#{repo_name} - #{owner_commits_count}\"\n ### Counting total number of commits for specific user, for all his public repositories withing a year period\n total_commit_count += owner_commits_count\n end\n\n puts \"Owner name: #{author}\"\n puts \"----------------------\"\n year_commit_list.each {|item| puts item}\n puts \"----------------------\"\n puts \"Total for a year: #{total_commit_count} commits\"\n puts \"----------------------\"\nend", "def index\n @user = current_user\n @projects = @user.projects.all\n end", "def index\n if params[:github_name]\n @user = User.find_by_github_name(params[:github_name])\n @issues = @user.issues\n else\n @issues = Issue.all\n end\n end", "def fetch_branches\n refs = @github_client.fetch_refs(@repo_user,@repo_name) \n branch_refs = filter_branch_refs refs \n branch_refs = fetch_and_set_dates(branch_refs)\n branch_refs = sort_by_date(branch_refs) \n branches(branch_refs)\n end", "def user_teams_projects(team_id, project_id = nil)\n project_id.to_i.zero? ? get(\"/user_teams/#{team_id}/projects\") : get(\"/user_teams/#{team_id}/projects/#{project_id}\")\n end", "def index\n @projects = current_user.projects\n end" ]
[ "0.7888363", "0.73321056", "0.70928615", "0.7084315", "0.7065468", "0.7051613", "0.703337", "0.7010018", "0.694997", "0.6905266", "0.68602264", "0.6850607", "0.6822165", "0.6791497", "0.6768402", "0.67608654", "0.6729191", "0.67078304", "0.6693352", "0.668834", "0.66871387", "0.66707087", "0.66678935", "0.66671044", "0.6637766", "0.663353", "0.6631243", "0.65855306", "0.6546714", "0.64855736", "0.64605284", "0.6452168", "0.6446543", "0.644026", "0.6435362", "0.64333075", "0.6426653", "0.64017105", "0.6397517", "0.6389598", "0.6368249", "0.6355578", "0.6349215", "0.63426924", "0.6317683", "0.63109964", "0.62942606", "0.62878597", "0.6271119", "0.62519705", "0.6248362", "0.62368155", "0.62283945", "0.62241745", "0.62202966", "0.6220079", "0.62160474", "0.6207167", "0.6201193", "0.61982983", "0.6195459", "0.61945117", "0.6194365", "0.61797196", "0.6170539", "0.61693", "0.6158059", "0.61546683", "0.6154056", "0.6143542", "0.6142509", "0.6139105", "0.61379", "0.6136214", "0.61350036", "0.6125", "0.61152774", "0.61081225", "0.6102413", "0.609895", "0.6094727", "0.60890174", "0.6088488", "0.6074351", "0.6067469", "0.60562795", "0.60446596", "0.6044311", "0.60435736", "0.60418195", "0.6036882", "0.60318625", "0.6031144", "0.6027314", "0.6021017", "0.6014285", "0.6013629", "0.60044247", "0.60033965", "0.5998848" ]
0.83093596
0
Use callbacks to share common setup or constraints between actions.
def set_hospital_line_item @hospital_line_item = HospitalLineItem.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
Only allow a trusted parameter "white list" through.
def hospital_line_item_params params.fetch(:hospital_line_item, {}) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
Once an ActiveJob is queued, ActiveRecord references get serialized into some internal reserved keys, such as _aj_globalid. The problem is, if this job in turn gets queued back into ActiveJob with these magic reserved keys, ActiveJob will throw up and error. We want to capture these and mutate the keys so we can sanely report it.
def filter_context(context) case context when Array context.map { |arg| filter_context(arg) } when Hash Hash[context.map { |key, value| filter_context_hash(key, value) }] else format_globalid(context) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize\n {\n \"job_class\" => self.class.name,\n \"job_id\" => job_id,\n \"provider_job_id\" => provider_job_id,\n \"queue_name\" => queue_name,\n \"priority\" => priority,\n \"arguments\" => serialize_arguments_if_needed(arguments),\n \"executions\" => executions,\n \"exception_executions\" => exception_executions,\n \"locale\" => I18n.locale.to_s,\n \"timezone\" => timezone,\n \"enqueued_at\" => Time.now.utc.iso8601(9)\n }\n end", "def active_job_message\n {\n 'class' => 'ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper',\n 'wrapped' => @klass,\n 'queue' => @queue_name_with_prefix,\n 'description' => @description,\n 'args' => [{\n 'job_class' => @klass,\n 'job_id' => SecureRandom.uuid,\n 'queue_name' => @queue_name_with_prefix,\n 'arguments' => @args\n }]\n }\n end", "def enqueue(job)\n @jobs ||= {}\n @jobs[job.key] = {}\n\n self.save\n end", "def ignored(job)\n @last_job_id = job.job_id\n end", "def ignored(job)\n @processed_job_ids << job.job_id\n end", "def good_job_concurrency_key\n @good_job_concurrency_key || _good_job_concurrency_key\n end", "def save\n if (not @queued_for_delete.empty?) and @queued_for_write.empty?\n instance_write(:meta, ActiveSupport::Base64.encode64(Marshal.dump({}))) if instance.respond_to?(:\"#{name}_meta=\")\n end\n original_save\n end", "def job_key; Thread.current[:job_key]; end", "def current_job_settings\n job.symbolize_keys.reverse_merge(JOB.dup)\n end", "def push(job)\n super Marshal.load(Marshal.dump(job))\n end", "def encode(job)\n item = {:queue => job.queue, :payload => job.payload}\n Resque.encode(item)\n end", "def enqueue(job_id)\n create_job_record(job_id)\n BEANSTALK_QUEUE.yput(:job_id => job_id)\n @last_queried[job_id] = Time.now\n end", "def enqueue\n # We need to save before passing to perform_later b/c perform_later will need our ID.\n # For this reason, the job_id col can't have a null constraint.\n save! unless persisted?\n job = job_class.constantize.perform_later(self, **job_params)\n update!(job_id: job.job_id, provider_job_id: job.provider_job_id)\n end", "def queued_method_queued_key(method)\n queued_method_key method, 'queued'\n end", "def to_json\n JSON.generate(Serializer::Job.serialize(self))\n end", "def job_uuid=(uuid)\n @raw_data[:job] ||= {}\n @raw_data[:job].update(uuid: uuid)\n end", "def __object_lock_key\n @key ||= \"this.#{object_id}\".to_sym\n end", "def dequeue(job)\n @jobs = @jobs.delete(job.key)\n\n self.save\n end", "def enqueue_job(job, event)\n delayed_job = job.queue\n\n logger.info \"Queued #{event.event_description} as job #{delayed_job.id}\"\n\n {\n 'status' => 'ok',\n 'job_id' => delayed_job.id,\n 'queue' => delayed_job.queue,\n 'priority' => delayed_job.priority,\n 'created_at' => delayed_job.created_at,\n }\n end", "def job(job,params={})\n if (@job[extract_job(job)] && !params[:force])\n return @job[extract_job(job)]\n end\n @job[extract_job(job)] = get_job(job)\n end", "def queue\n pending_duplicate_job || Delayed::Job.enqueue(self)\n end", "def batch_key(_record)\n raise \"Implement in child\"\n end", "def queue_key\n super || default_queue_key\n end", "def after_enqueue_batch(id, *args)\n mutex(id) do |bid|\n redis.rpush(bid, Resque.encode(:class => self.name, :args => args))\n end\n end", "def prepare_job_and_associations\r\n temp_job = @temp_job\r\n payer_group = '--'\r\n @original_job = Job.includes(:images_for_jobs).find(temp_job.job_id)\r\n @micr_record, payer_group = get_micr_and_payer_group if @original_job.micr_applicable?\r\n\r\n job = prepare_job\r\n job.payer_group = payer_group\r\n job.is_correspondence = @original_job.is_correspondence\r\n\r\n check_information = prepare_check\r\n job.check_informations << check_information\r\n check_information.micr_line_information = @micr_record if @micr_record\r\n\r\n Batch.where(:id => @original_job.batch_id).update_all(:associated_entity_updated_at => Time.now)\r\n job\r\n end", "def log_context(worker, job)\n klass = job['wrapped'.freeze] || worker.class.to_s\n \"#{klass} JID-#{job['jid'.freeze]}#{\" BID-#{job['bid'.freeze]}\" if job['bid'.freeze]}\"\n end", "def digestable_hash\n @item.slice(CLASS, QUEUE, LOCK_ARGS, APARTMENT).tap do |hash|\n hash.delete(QUEUE) if unique_across_queues?\n hash.delete(CLASS) if unique_across_workers?\n end\n end", "def queue_job; end", "def serializable_hash(options)\n original_hash = super(options)\n Hash[original_hash.map {|k, v| [self.aliased_fields.invert[k] || k , v] }]\n end", "def enqueue!\n return nil unless persisted?\n \"#{job_type.camelize}Job\".constantize.perform_later(self)\n end", "def delayed_atomic_unsets\n @delayed_atomic_unsets ||= {}\n end", "def enqueue(active_job)\n enqueue_at(active_job, nil)\n end", "def perform(job_serialization, *_extra_options)\n job_executions = job_retries < 1 ? 0 : (job_retries + 1)\n\n job_serialization.merge!(\n 'job_id' => job_id,\n 'queue_name' => job_queue,\n 'provider_job_id' => task_id,\n 'executions' => job_executions,\n 'priority' => nil\n )\n\n Base.execute job_serialization\n end", "def delayed_push(timestamp, item)\n # This line could raise `LockingError` and it should be handled in the\n # `enqueue_at_with_queue` method\n #\n # We can't handle exception here, because of jobs, which raise an error on locking\n # will run after hooks, but its unexpected behavior.\n Resque::Job.new(item[:queue], 'class' => item[:class], 'args' => item[:args])\n .uniqueness\n .try_lock_queueing(timestamp.to_i - Time.now.to_i)\n super\n end", "def job_groups()\n @job_queues.keys.dup\n end", "def rekey_as_needed; end", "def tomqueue_payload\n JSON.dump({\n \"delayed_job_id\" => self.id,\n \"delayed_job_digest\" => tomqueue_digest,\n \"delayed_job_updated_at\" => self.updated_at.iso8601(0)\n })\n end", "def after_perform_increment_jobs_processed(*)\n @registry.hincrby key, 'jobs_processed', 1\n end", "def initialize(...)\n super(...)\n\n # there's no point making a job id on deserialization\n # deserialize creates the instance without assigning anything,\n # https://github.com/rails/rails/blob/58b46e9440f3460e93b8164205614e3ab85784da/activejob/lib/active_job/core.rb#L61\n return if @arguments.nil?\n\n # otherwise we assume we were called by `perform`\n # finally, the magic!\n new_id = create_job_id\n\n # spaces in particular mess with redis\n self.job_id = new_id.gsub(' ', '')\n end", "def display_serialized_params\n serialized_params.merge({\n _good_job: attributes.except('serialized_params', 'locktype', 'owns_advisory_lock'),\n })\n end", "def set_background_job_ref(job)\n return unless respond_to?(:background_job_ref=)\n\n job = \"#{job.provider_job.class.name.ns_underscore}%#{job.provider_job.id}\" if job.respond_to?(:provider_job)\n self.background_job_ref = job\n end", "def id\n active_job_id\n end", "def enqueue_job\n BgJob.enqueue(\n WebhookJob::RecordEvent,\n {\n client_id: @user_kyc_detail.client_id,\n event_source: GlobalConstant::Event.web_source,\n event_name: GlobalConstant::Event.update_ethereum_address_name,\n event_data: {\n user_kyc_detail: @user_kyc_detail.get_hash,\n admin: @admin.get_hash\n },\n event_timestamp: Time.now.to_i\n }\n )\n\n end", "def delayed_atomic_sets\n @delayed_atomic_sets ||= {}\n end", "def persistent_job\n job_id = Thread.current[:persistent_job_id]\n job_id ? BdrbJobQueue.find_by_id(job_id) : nil\n end", "def as_json\n jobs.map do |job|\n {\n \"queue\" => job.queue_name,\n \"name\" => job.job_name,\n \"time\" => job.time,\n \"total_time\" => job.total_time,\n \"exclusive_time\" => job.exclusive_time,\n \"mem_delta\" => job.mem_delta,\n \"allocations\" => job.allocations,\n \"seconds_since_startup\" => job.seconds_since_startup,\n \"hostname\" => job.hostname,\n \"git_sha\" => job.git_sha,\n \"metrics\" => MetricsToJsonSerializer.new(job.metrics).as_json, # New style of metrics\n \"allocation_metrics\" => MetricsToJsonSerializer.new(job.allocation_metrics).as_json, # New style of metrics\n \"context\" => job.context.to_hash,\n \"truncated_metrics\" => job.truncated_metrics,\n\n \"score\" => job.score,\n }\n end\n end", "def scrooge_dump_flag_this\n Thread.current[:scrooge_dumping_objects] ||= []\n Thread.current[:scrooge_dumping_objects] << object_id\n end", "def prepare_serialization!\n # force the group/owner to be translated from uid/gid, if those keys\n # were given on instantiation\n owner\n group\n end", "def args_info(job)\n ::ActiveJob::Arguments.serialize(job.arguments)\n end", "def store_in_background(column, worker=::CarrierWave::Workers::StoreAsset)\n send :after_save, :\"enqueue_#{column}_background_job\"\n \n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n attr_accessor :process_upload\n \n def write_#{column}_identifier\n super() and return if process_upload\n self.#{column}_tmp = _mounter(:#{column}).cache_name\n end\n \n def store_#{column}!\n super() if process_upload\n end\n \n def enqueue_#{column}_background_job\n unless process_upload\n ::Delayed::Job.enqueue #{worker}.new(self.class, id, #{column}.mounted_as)\n end\n end\n RUBY\n end", "def store_processed_sequence(sequence_id, hour, processed_sequence)\n # empty --> this is like an abstract class method\n end", "def job_params=(hash)\n self.job_params_json = hash.to_json\n end", "def job_class\n SingleInstanceQueueJob\n end", "def [](key)\n @timestamps[key][:accessed] = Time.now if @jobs[key]\n @jobs[key]\n end", "def add_to_queue\n if !queue_id.blank? && cancelling?\n # cancelling items already have a valid job payload on the queue - do not add again\n return\n end\n\n payload = AnalysisJobsItem.create_action_payload(analysis_job, audio_recording)\n\n result = nil\n error = nil\n\n begin\n result = BawWorkers::Jobs::Analysis::Job.action_enqueue(payload)\n\n # the assumption here is that result is a unique identifier that we can later use to interrogate the message queue\n self.queue_id = result\n rescue StandardError => e\n # NOTE: exception used to be swallowed. We might need better error handling here later on.\n Rails.logger.error \"An error occurred when enqueuing an analysis job item: #{e}\"\n raise\n end\n\n @enqueue_results = { result: result, error: error }\n end", "def to_key\n [object_id]\n end", "def queue(job_id)\n redis do |conn|\n conn.lpush(key.queued, job_id)\n end\n end", "def job_application_params\n params.require(:job_application).permit(JobApplication.safe_attributes)\n end", "def flaky_jobs\n if !exhausted? && !build_failed_fast?\n raise \"Queue is not yet exhausted\"\n end\n\n requeued = @redis.hkeys(key_requeues)\n\n return [] if requeued.empty?\n\n requeued - @redis.hkeys(key_failures)\n end", "def queue\n # If a Document is associated with this ProcessingJob, determine\n # whether the Document is available to be worked on, and if it's not\n # use ActiveRecord's error system to indicate it's unavailability.\n #if document and document.has_running_jobs?\n # errors.add(:document, \"This document is already being processed\") and (return false)\n #\n # # in future we'll actually lock the document\n # # Lock the document & contact CloudCrowd to start the job\n # #document.update :status => UNAVAILABLE\n #end\n \n begin\n # Note the job id once CloudCrowd has recorded the job.\n @response = RestClient.post(ProcessingJob.endpoint, {:job => CloudCrowdSerializer.new(self).to_json})\n @remote_job = JSON.parse @response.body\n self.cloud_crowd_id = @remote_job['id']\n\n # We've collected all the info we need, so\n save # it and retain the lock on the document.\n rescue Errno::ECONNREFUSED, RestClient::Exception => error\n LifecycleMailer.exception_notification(error).deliver_now\n # In the event of an error while communicating with CloudCrowd, unlock the document.\n self.update_attributes :complete => true\n #document.update :status => AVAILABLE\n raise error\n end\n end", "def dequeue\n self.job.destroy if self.job.present?\n self.job_id = nil\n end", "def record_non_example_error(job, message)\n @redis.hset(key_errors, job, message)\n end", "def getScheduledJobObjName\r\n\t\t return \"mfiforce__Scheduled_Job__c\"\r\n\t\tend", "def to_hash\n {\n name: @name,\n klass: @klass,\n cron: @cron,\n description: @description,\n args: @args.is_a?(String) ? @args : Sidekiq.dump_json(@args || []),\n message: @message.is_a?(String) ? @message : Sidekiq.dump_json(@message || {}),\n status: @status,\n active_job: @active_job,\n queue_name_prefix: @active_job_queue_name_prefix,\n queue_name_delimiter: @active_job_queue_name_delimiter,\n last_enqueue_time: @last_enqueue_timestamp,\n next_enqueue_time: @next_enqueue_timestamp\n }\n end", "def as_json\n jobs.map do |job|\n {\n \"queue\" => job.queue_name,\n \"name\" => job.job_name,\n \"count\" => job.run_count,\n \"errors\" => job.errors,\n \"total_time\" => job.total_time.as_json,\n \"exclusive_time\" => job.exclusive_time.as_json,\n \"metrics\" => MetricsToJsonSerializer.new(job.metrics).as_json, # New style of metrics\n }\n end\n end", "def save\n # if job is invalid return false\n return false unless valid?\n\n # update next_enqueue_timestamp\n @next_enqueue_timestamp = calculate_next_enqueue_time(Time.now.utc).to_i\n\n Sidekiq.redis do |conn|\n # add to set of all jobs\n conn.sadd(self.class.jobs_key, redis_key)\n\n # add informations for this job!\n conn.hmset(redis_key, *hash_to_redis(to_hash))\n end\n\n logger.info { \"CRON JOB: add job with name: #{@name}\" }\n end", "def requeue\n update_attributes(failed: false, failed_at: nil, failure_reason: nil,\n delivered: false, delivered_at: nil)\n queue\n end", "def acknowledge_job(job)\n @redis.multi do\n @redis.hdel(key_queue_running, @worker_id)\n @redis.sadd(key_queue_processed, job)\n end\n end", "def job=(job)\n @job = job\n end", "def jobs_performed_key\n \"stats:jobs:#{self.name}:performed\"\n end", "def queued_jids\n queued.entries\n end", "def flush\n @queued = {}\n end", "def grab_job_uniq\n throw :notimpl\n end", "def serializable_hash\n self.attributes\n end", "def snapshot_key\n # no-op\n end", "def job_id\n async && async.job_id\n end", "def cancel_associated_job!\n return unless respond_to?(:background_job_ref) && background_job_ref.present?\n\n ref_parts = background_job_ref.split('%')\n valid_ref_cns = ['delayed__backend__active_record__job'].freeze\n valid_ref_cn = valid_ref_cns.select { |s| s == ref_parts.first }.first\n return unless valid_ref_cn\n\n job = valid_ref_cn.ns_camelize.constantize.find(ref_parts.last.to_i)\n job&.delete\n end", "def Job(active_job)\n lambda do |object|\n active_job.perform_later(object.id)\n end\n end", "def deredisize_model\n Redisable.enqueue(:deredisize_model_metas, self.model_name.name)\n end", "def _good_job_concurrency_key\n key = self.class.good_job_concurrency_config[:key]\n return if key.blank?\n\n key = instance_exec(&key) if key.respond_to?(:call)\n raise TypeError, \"Concurrency key must be a String; was a #{key.class}\" unless VALID_TYPES.any? { |type| key.is_a?(type) }\n\n key\n end", "def push_pending_job (job)\n\n old = @pending_jobs.find { |j| j.job_id == job.job_id }\n @pending_jobs.delete(old) if old\n #\n # override previous job with same id\n\n if @pending_jobs.length < 1 or job.at >= @pending_jobs.last.at\n @pending_jobs << job\n return\n end\n\n for i in 0...@pending_jobs.length\n if job.at <= @pending_jobs[i].at\n @pending_jobs[i, 0] = job\n return # right place found\n end\n end\n end", "def redisize_json scheme, &block\n primary_key = self.class.primary_key\n key = [\"json\", self.model_name.name, primary_key, self[primary_key].to_s, scheme]\n\n # binding.pry\n Rails.cache.fetch(key, expires_in: 1.week) do\n value = block.call\n\n Redisable.enqueue(:redisize_json_metas, key, value)\n\n value\n end\n end", "def enqueue(job)\n enqueue_at(job, nil)\n end", "def force_primary_key(klass)\n # Automatically add an :oid serializable field if none is\n # defined and no other primary key is defined.\n if klass.primary_key == :oid and !klass.instance_attributes.include?(:oid)\n klass.attr_accessor :oid, Fixnum, :sql => primary_key_type\n end\n end", "def base_redis_key(opts={})\n added = ''\n added = \"_#{self.added_redis_key}\" if self.respond_to? :added_redis_key\n\n on_previous_changes = opts[:after_commit] && self.previous_changes['updated_at']\n updated_at = on_previous_changes ? self.previous_changes['updated_at'].first : self.updated_at\n\n \"#{self.class.to_s.downcase}_#{self.id}_#{updated_at.to_i}#{added}\"\n end", "def hash\n object_id\n end", "def record_job(job_json)\n job = JSON.parse(job_json)\n processing_jobs.create!(\n :account_id => account_id,\n :cloud_crowd_id => job['id'],\n :title => title,\n :remote_job => job\n )\n end", "def jobid_prefix\n @jobid_prefix\n end", "def transient=(_arg0); end", "def application_jobs\n rails_eager_load\n all_jobs = []\n all_jobs << sidekiq_jobs\n all_jobs << active_jobs if defined?(::ActiveJob)\n all_jobs = all_jobs.flatten\n all_jobs.delete_if { |klass| IGNORED_CLASSES.include?(klass.to_s) }\n end", "def update!(**args)\n @backing_custom_job = args[:backing_custom_job] if args.key?(:backing_custom_job)\n end", "def update\n job = Job.find(params[:id])\n\n Job.storage_fields.each do |field|\n job[field.to_sym] = params[field.to_sym]\n end\n\n respond_with job.save\n end", "def enqueue_at(active_job, timestamp)\n good_job = GoodJob::Job.enqueue(\n active_job,\n scheduled_at: timestamp ? Time.zone.at(timestamp) : nil,\n create_with_advisory_lock: execute_inline?\n )\n\n if execute_inline?\n begin\n good_job.perform\n ensure\n good_job.advisory_unlock\n end\n end\n\n executed_locally = execute_async? && @scheduler.create_thread(queue_name: good_job.queue_name)\n Notifier.notify(queue_name: good_job.queue_name) unless executed_locally\n\n good_job\n end", "def lock_redis\n @lock_redis ||= ActiveJobLock::Config.redis\n end", "def prepare_key\n return item_in_use.prepare_key\n end", "def prepare_key\n return item_in_use.prepare_key\n end", "def cache_key(pk)\n raise(Error, 'no primary key for this record') unless pk.is_a?(Array) ? pk.all? : pk\n \"#{cache_key_prefix}:#{Array(pk).join(',')}\"\n end", "def check_for_stuck_jobs\n Job.incomplete.each do |job|\n if job.stuck_chunks?\n job.priority = 50\n job.save!\n job.resend_stuck_chunks \n elsif job.stuck_packing?\n job.send_pack_request\n end\n end\n end", "def job=(job)\n @job = job\n end", "def autoload_unsynced_quickery_attributes!\n model = self.class\n new_values = {}.with_indifferent_access\n\n defined_quickery_attribute_names = model.quickery_builders.keys\n\n defined_quickery_attribute_names.each do |defined_quickery_attribute_name|\n if has_attribute?(:\"#{defined_quickery_attribute_name}_is_synced\") && !send(:\"#{defined_quickery_attribute_name}_is_synced\")\n new_values[defined_quickery_attribute_name] = determine_quickery_value(defined_quickery_attribute_name)\n new_values[:\"#{defined_quickery_attribute_name}_is_synced\"] = true\n end\n end\n\n update_columns(new_values) if new_values.present?\n end", "def encode\n h = {\n :batch => @batch_hash,\n :job_id => @job_id\n }\n h.to_json.to_s\n end" ]
[ "0.58941185", "0.58293444", "0.57308203", "0.5455141", "0.53911585", "0.5358757", "0.535672", "0.53209", "0.52920973", "0.5289223", "0.5248281", "0.52013266", "0.51835877", "0.51483655", "0.5130928", "0.5114305", "0.5111343", "0.51082706", "0.50590307", "0.50407714", "0.5029073", "0.5018255", "0.50151104", "0.4969338", "0.4957458", "0.49550965", "0.4931652", "0.49289897", "0.49260202", "0.4912195", "0.48930436", "0.48825395", "0.4881794", "0.4880531", "0.48722294", "0.4869525", "0.4866735", "0.48399913", "0.48355138", "0.48229018", "0.4809674", "0.4801118", "0.4794648", "0.47920823", "0.4774041", "0.47730318", "0.47645935", "0.47572985", "0.4756466", "0.47466207", "0.4735769", "0.47344288", "0.47214654", "0.47192296", "0.4715898", "0.47158012", "0.47118962", "0.47064567", "0.47052222", "0.47045884", "0.469568", "0.46925843", "0.46902627", "0.46836564", "0.46822378", "0.4676161", "0.46589738", "0.4653159", "0.46513227", "0.46499592", "0.46409813", "0.46406725", "0.4633875", "0.46278617", "0.46241468", "0.4621337", "0.46212766", "0.46205953", "0.4620305", "0.46188617", "0.46166116", "0.46151167", "0.46116436", "0.46087363", "0.4607909", "0.46071243", "0.4603793", "0.46006587", "0.459981", "0.45933366", "0.459024", "0.45899254", "0.45707616", "0.45601168", "0.45593017", "0.45593017", "0.45573208", "0.45571685", "0.4556578", "0.4551626", "0.4550486" ]
0.0
-1
GET /space_cats GET /space_cats.json
def index @space_cats = SpaceCat.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space_cat }\n end\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end", "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def index\n render json: @owner.cats\n end", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "def do_get_cats_data\n message = {country_id: @client.country_code, webapi_key: @client.webapi_key}\n @client.call(:do_get_cats_data, message: message)\n end", "def index\n @cover_cats = CoverCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cover_cats }\n end\n end", "def index\n categories = Category.all\n render json:categories\n end", "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "def new\n @space_cat = SpaceCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @space_cat }\n end\n end", "def index\n @product_cats = ProductCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_cats }\n end\n end", "def all\n render json: Cat.all\n end", "def index\n @cats = Cat.all\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n render json: @category\n end", "def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end", "def categories\n get('venues/categories').categories\n end", "def show\n render json: category\n end", "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "def destroy\n @space_cat.destroy\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def get_item_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_item_categories ...\"\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/categories/\".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_item_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @space_cat = SpaceCat.find(params[:id])\n @space_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def index\n @spaces = Space.all\n\n # Index, downcase, and capitalize the categories\n dot_index = 0\n @spaces.group_by{|s| s.category.downcase}.each do |group|\n dot_color = Space.dot_colors[dot_index]\n group.last.each do |space|\n space.category = group.first.capitalize\n space.dot_color = dot_color\n end\n dot_index += 1\n end\n\n # Don't bother with generating markers for JSON\n respond_to do |format|\n format.html {\n\n @json = @spaces.to_gmaps4rails do |space, marker|\n marker.infowindow render_to_string(:partial => \"/spaces/marker\", :locals => { :space => space})\n marker.picture({\n :picture => \"http://maps.google.com/intl/en_us/mapfiles/ms/micons/#{space.dot_color}-dot.png\",\n :width => 32,\n :height => 32\n })\n marker.title space.name\n marker.json({ :id => space.id })\n end\n }\n format.json #render json\n end\n end", "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cat }\n end\n end", "def demo\n render json: Cat.all\n end", "def categories(args={})\n res = api_request('private.request.getCategories', 'GET')\n res = JSON.parse(res)['category'] rescue []\n\n unless args[:include_deleted] and args[:include_deleted] == true\n res.reject!{|k, v| v['fDeleted'] == '1'} rescue []\n end\n \n return res\n end", "def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end", "def index\n @categs = Categ.all\n end", "def categories_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OtherApi.categories_list ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\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<Category>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OtherApi#categories_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def getcategories\n category_size = RequirementCategory.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n \tif current_offset + direction < category_size && current_offset + direction >= 0\n offset = current_offset + direction\n \t@categories = RequirementCategory.all.offset(offset).take(10) \n \trender :json => @categories\n else\n \trender :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\n\tend", "def index\n @cathegories = Cathegory.all\n end", "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def create\n @space_cat = SpaceCat.new(space_cat_params)\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space_cat }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end", "def getCategories(_, _, _)\n @db.categories\n end", "def index\n render json: Space.all\n end", "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def categories\n parsed_json['data']\n end", "def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend", "def category\n data['category']\n end", "def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend", "def catalog_dcat()\n return uri(\"api/dcat.json\")\n end", "def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render json: @categoria\n end", "def manage\n @cats = Cat.page(params[:page] || 1).per(50)\n breadcrumbs.add \"manage\",manage_cats_url\n breadcrumbs.add \"preview\",preview_cats_url\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cats }\n end\n end", "def catalogs\n path = \"#{api_root}/index/catalogs\"\n process_api_request(:get, path)\n end", "def categories(make, year)\n make_id = get_object_id make\n response = get_url \"Categories/#{make_id}/#{year}\"\n response_obj = JSON.parse response\n response_obj[\"GetCategoriesResult\"].map{|r| Models::Category.from_response_hash(r)}\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CategoriesApi.get_categories ...'\n end\n # resource path\n local_var_path = '/categories'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Category>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @categories = Category.paginate(:page => params[:page], per_page:30)\n @number = Category.count\n\n respond_to do |format|\n format.html\n format.json { render json: Category.all }\n end\n end", "def index\n @q = scope.search(categories_name_eq: params[:category])\n @dishes = @q.result.includes(:categories).order(\"categories.position\")\n\n c = Hash.new {|x,v| x[v] = []}\n @dishes = @dishes.reduce(c) do |h, dishe|\n dishe.categories.each do |c|\n h[c.name] << dishe\n end\n h\n end.reject {|c, d| d.blank? }\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def category\n ts_deals = Deal.filtered_search(\n :category => params[:name] == \"all\" ? nil : params[:name],\n :lat => params[:lat],\n :lon => params[:long],\n :range => params[:range] || Deal::MAX_RANGE,\n :age => Deal::MAX_SEARCH_AGE.days,\n :page => params[:page],\n :limit => 50)\n\n \n @deals = Array.new\n ts_deals.map do |deal|\n if deal.hidden == false\n @deals.push deal\n end\n end\n \n options = { :minimal => true }\n options[:current_user] = current_user if current_user\n render :json => @deals.compact.as_json(options)\n end", "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend", "def index\n @brand_categories = BrandCategory.all\n\n render json: @brand_categories\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def category\n @articles = Article.with_category(params[:category], params[:search] || \"top_requested\")\n respond_with(:articles, template: \"articles/index\")\n end", "def index\n @spaces = Space.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spaces }\n end\n end", "def categories\n # list results from search results piped in from side nav categories\n @experiments = Experiment.find(:status => true)\n respond_to do |format|\n format.html { render :action => \"list\" }\n format.xml { render :xml => @experiments }\n end\n\n end", "def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end", "def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end", "def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end", "def index\n @goods_categories = GoodsCategory.roots\n @goods_category = GoodsCategory.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goods_categories }\n end\n end", "def index\n respond_with Category.all\n end", "def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end", "def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end", "def show\n render json: @accessory_category\n end", "def show\n @home_cat = HomeCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_cat }\n end\n end", "def index\n render json: Category.order('name ASC').all\n end", "def set_space_cat\n @space_cat = SpaceCat.find(params[:id])\n end", "def get_categories\n @categories = Category.all\n end", "def show\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def index\n @taxonomy_categories = TaxonomyCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomy_categories }\n end\n end", "def categories\n expose Metadata.categories(@oauth_token)\n end", "def category\n if params[:city] == \"sf\"\n @city = \"San Francisco\"\n elsif params[:city] == \"ny\"\n @city = \"New York\"\n end\n @listings = Listing.find_all_by_city(@city)\n end", "def categories\n add_to_query restrict_kind: 'category'\n end", "def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end", "def index\n @basic_categories = Category.where(:cat_type => \"Basics\")\n @theme_categories = Category.where(:cat_type => \"Themes\")\n \n # @theme_words = @theme_categories.find_words\n # @basic_words = @basic_categories.find_words\n # respond_to do |format|\n # format.html\n # format.json {render :json => @categories}\n # end\n @categories = {}\n Word.select(:id, :name, :category_id).each do |word|\n @categories[word.category_id] ||= []\n @categories[word.category_id].push word\n end\n end", "def show\n #show all kind categories\n @categories = Category.where(:category_id => params[:id])\n @freds = Fred.where(:category_id => params[:id]).order(\"updated_at DESC\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @equipcats = Equipcat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipcats }\n end\n end", "def index\n @convention_categories = ConventionCategory.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @convention_categories }\n end\n end", "def find_space_category\n @basic = Basic.find(params[:basic_id])\n @space_category = SpaceCategory.find(params[:space_category_id])\n end", "def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end", "def index\n @p_cats = PCat.all\n end", "def get_categories(query_obj=nil)\n uri = URI.parse(@uri + \"/Categories\")\n results = get(uri,query_obj)\n end", "def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end", "def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend", "def index\n @categories = Category.order(\"name ASC\")\n @latest_reviews = Review.limit(3).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end", "def get_stat_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StatsApi.get_stat_categories ...'\n end\n # resource path\n local_var_path = '/stats/categories'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\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<String>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StatsApi#get_stat_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def category\n client.categories.find(data[\"categoryId\"])\n end", "def category\n @services = Service.where(\"category = ?\", params[:category])\n @category = Service.categories.key(params[:category].to_i)\n end", "def index\n @vendor_cats = VendorCat.all\n end", "def index\n @categorias = Categoria.where(ativo: true)\n \t\n render json: @categorias\n end" ]
[ "0.7006992", "0.6792795", "0.67924243", "0.66692597", "0.6621316", "0.65918255", "0.63607717", "0.63496894", "0.6304581", "0.6281507", "0.6270946", "0.6225216", "0.6218042", "0.61899453", "0.61755335", "0.6169439", "0.6123937", "0.6112873", "0.61059767", "0.610256", "0.6086583", "0.60807264", "0.60700804", "0.606641", "0.6056607", "0.60546273", "0.6041251", "0.60246056", "0.5988292", "0.5980371", "0.5976135", "0.5961554", "0.5955728", "0.5942578", "0.59323174", "0.59238607", "0.5917227", "0.59046364", "0.59036154", "0.5901218", "0.5900111", "0.589932", "0.589932", "0.58993196", "0.58965117", "0.58947414", "0.5887758", "0.58843315", "0.58821565", "0.58774924", "0.5877331", "0.585867", "0.5846172", "0.5823436", "0.5820294", "0.5820198", "0.58112174", "0.5801332", "0.57971424", "0.5792601", "0.5787099", "0.57830185", "0.5771829", "0.57701945", "0.57654", "0.57577896", "0.57551396", "0.5751495", "0.5749104", "0.57474506", "0.5747338", "0.5746466", "0.57454354", "0.5743746", "0.5735783", "0.5727143", "0.57242805", "0.57210356", "0.57118136", "0.57082504", "0.56968606", "0.5689788", "0.5689752", "0.56844354", "0.56824094", "0.56745887", "0.56720555", "0.56594163", "0.5657064", "0.5655278", "0.5651847", "0.564224", "0.56421906", "0.5640009", "0.56398827", "0.563372", "0.56320035", "0.56246537", "0.5618661", "0.5615004" ]
0.7184111
0
GET /space_cats/1 GET /space_cats/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space_cat }\n end\n end", "def index\n @space_cats = SpaceCat.all\n end", "def index\n render json: @owner.cats\n end", "def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cat }\n end\n end", "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def index\n @cover_cats = CoverCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cover_cats }\n end\n end", "def new\n @space_cat = SpaceCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @space_cat }\n end\n end", "def show\n render json: @category\n end", "def show\n render json: category\n end", "def index\n @product_cats = ProductCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_cats }\n end\n end", "def index\n categories = Category.all\n render json:categories\n end", "def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def all\n render json: Cat.all\n end", "def index\n @cats = Cat.all\n end", "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "def demo\n render json: Cat.all\n end", "def do_get_cats_data\n message = {country_id: @client.country_code, webapi_key: @client.webapi_key}\n @client.call(:do_get_cats_data, message: message)\n end", "def show\n @home_cat = HomeCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_cat }\n end\n end", "def show\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def destroy\n @space_cat = SpaceCat.find(params[:id])\n @space_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "def show\n #show all kind categories\n @categories = Category.where(:category_id => params[:id])\n @freds = Fred.where(:category_id => params[:id]).order(\"updated_at DESC\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categories }\n end\n end", "def show\n render json: @categoria\n end", "def show\n render json: @accessory_category\n end", "def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end", "def index\n @cathegories = Cathegory.all\n end", "def show\n @cover_cat = CoverCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cover_cat }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def destroy\n @space_cat.destroy\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @kategory = Kategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kategory }\n end\n end", "def index\n @categs = Categ.all\n end", "def get_item_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_item_categories ...\"\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/categories/\".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_item_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @goods_categories = GoodsCategory.roots\n @goods_category = GoodsCategory.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goods_categories }\n end\n end", "def category\n data['category']\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def catalog_dcat()\n return uri(\"api/dcat.json\")\n end", "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "def show\n @product_cat = ProductCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_cat }\n end\n end", "def show\n @taxonomy_category = TaxonomyCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxonomy_category }\n end\n end", "def show\n @convention_category = ConventionCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @convention_category }\n end\n end", "def show\n @pictures_of_cat = PicturesOfCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pictures_of_cat }\n end\n end", "def manage\n @cats = Cat.page(params[:page] || 1).per(50)\n breadcrumbs.add \"manage\",manage_cats_url\n breadcrumbs.add \"preview\",preview_cats_url\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cats }\n end\n end", "def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend", "def create\n @space_cat = SpaceCat.new(space_cat_params)\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space_cat }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n render json: Space.all\n end", "def show\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_category }\n end\n end", "def index\n render json: Category.order('name ASC').all\n end", "def show\n @goods_category = GoodsCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goods_category }\n end\n end", "def show\n @catogory = Catogory.find(params[:id])\n end", "def index\n @brand_categories = BrandCategory.all\n\n render json: @brand_categories\n end", "def index\n @spaces = Space.all\n\n # Index, downcase, and capitalize the categories\n dot_index = 0\n @spaces.group_by{|s| s.category.downcase}.each do |group|\n dot_color = Space.dot_colors[dot_index]\n group.last.each do |space|\n space.category = group.first.capitalize\n space.dot_color = dot_color\n end\n dot_index += 1\n end\n\n # Don't bother with generating markers for JSON\n respond_to do |format|\n format.html {\n\n @json = @spaces.to_gmaps4rails do |space, marker|\n marker.infowindow render_to_string(:partial => \"/spaces/marker\", :locals => { :space => space})\n marker.picture({\n :picture => \"http://maps.google.com/intl/en_us/mapfiles/ms/micons/#{space.dot_color}-dot.png\",\n :width => 32,\n :height => 32\n })\n marker.title space.name\n marker.json({ :id => space.id })\n end\n }\n format.json #render json\n end\n end", "def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @categorias_tipo = CatTipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categorias_tipo }\n end\n end", "def set_space_cat\n @space_cat = SpaceCat.find(params[:id])\n end", "def index\n @categories = Category.paginate(:page => params[:page], per_page:30)\n @number = Category.count\n\n respond_to do |format|\n format.html\n format.json { render json: Category.all }\n end\n end", "def show\n @ocat = Ocat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ocat }\n end\n end", "def show\n respond_to do |format|\n format.json {render :json => @top_category.to_json }\n end\n end", "def index\n @taxonomy_categories = TaxonomyCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomy_categories }\n end\n end", "def index\n @categorias = Categoria.where(ativo: true)\n \t\n render json: @categorias\n end", "def categories_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OtherApi.categories_list ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\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<Category>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OtherApi#categories_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @categories = Category.order(\"name ASC\")\n @latest_reviews = Review.limit(3).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def show\n @mastery_category = MasteryCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mastery_category }\n end\n end", "def getcategories\n category_size = RequirementCategory.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n \tif current_offset + direction < category_size && current_offset + direction >= 0\n offset = current_offset + direction\n \t@categories = RequirementCategory.all.offset(offset).take(10) \n \trender :json => @categories\n else\n \trender :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\n\tend", "def show\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categoria }\n end\n end", "def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end", "def getCategories(_, _, _)\n @db.categories\n end", "def category\n @services = Service.where(\"category = ?\", params[:category])\n @category = Service.categories.key(params[:category].to_i)\n end", "def getCategory( category_id)\n params = Hash.new\n params['category_id'] = category_id\n return doCurl(\"get\",\"/category\",params)\n end", "def category\n client.categories.find(data[\"categoryId\"])\n end", "def index\n @equipcats = Equipcat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipcats }\n end\n end", "def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend", "def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end", "def show\n @category = Category.find(params[:id])\n @jobs = @category.jobs\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n @title = \"Категория: \" << @category.title\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def index\n @q = scope.search(categories_name_eq: params[:category])\n @dishes = @q.result.includes(:categories).order(\"categories.position\")\n\n c = Hash.new {|x,v| x[v] = []}\n @dishes = @dishes.reduce(c) do |h, dishe|\n dishe.categories.each do |c|\n h[c.name] << dishe\n end\n h\n end.reject {|c, d| d.blank? }\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def index\n respond_with Category.all\n end", "def find_cat\n @cat = Cat.find(params[:cat_id])\n end", "def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end", "def index\n @spaces = Space.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spaces }\n end\n end", "def show\n render json: @brand_category\n end", "def index\n @cat2s = Cat2.all\n end", "def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end", "def show\n @consumer_category = ConsumerCategory.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consumer_category }\n end\n end", "def catalogs\n path = \"#{api_root}/index/catalogs\"\n process_api_request(:get, path)\n end" ]
[ "0.7246262", "0.6943989", "0.67936987", "0.6779616", "0.65675044", "0.6553342", "0.646155", "0.64427453", "0.6412308", "0.6398899", "0.6382829", "0.6358546", "0.6329365", "0.63113683", "0.62889105", "0.6277655", "0.6241431", "0.61556053", "0.6152391", "0.6140274", "0.61342514", "0.6118231", "0.6092256", "0.6083236", "0.6068499", "0.60538787", "0.6047723", "0.6039343", "0.60334975", "0.60241985", "0.6022163", "0.6019471", "0.6017848", "0.60131323", "0.60131323", "0.6012939", "0.6005399", "0.6000213", "0.5998605", "0.5995814", "0.5995814", "0.5995814", "0.5995814", "0.5995814", "0.5995814", "0.5995814", "0.59791666", "0.5960883", "0.59543633", "0.5952882", "0.5945401", "0.59070414", "0.5905562", "0.59038454", "0.59002215", "0.589192", "0.58789235", "0.5876502", "0.5874206", "0.5863759", "0.5860276", "0.585554", "0.5854174", "0.58515793", "0.5850788", "0.5850401", "0.584754", "0.58405656", "0.58365744", "0.5835924", "0.5820144", "0.5818601", "0.58166844", "0.58164465", "0.58079994", "0.58020157", "0.58001065", "0.57947534", "0.57919055", "0.5790245", "0.5790222", "0.57825136", "0.5779513", "0.57790756", "0.5772814", "0.5770662", "0.5766166", "0.5760876", "0.57580906", "0.5757134", "0.5750122", "0.57472515", "0.57462925", "0.57424235", "0.57286555", "0.5728578", "0.5724239", "0.57228774", "0.5719996", "0.57174623", "0.5714011" ]
0.0
-1
POST /space_cats POST /space_cats.json
def create @space_cat = SpaceCat.new(space_cat_params) respond_to do |format| if @space_cat.save format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' } format.json { render action: 'show', status: :created, location: @space_cat } else format.html { render action: 'new' } format.json { render json: @space_cat.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def space_cat_params\n params.require(:space_cat).permit(:name)\n end", "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend", "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end", "def addCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.new(name: params[:name])\n status = c.save\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "def create\n json_create(category_params, Category)\n end", "def create\n #...\n params[:cat].permit(...:tag_ids: []) #allow tag_ids and expect it to be an Array\n end", "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render json: @cat, status: :created, location: @cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@cat = Cat.new(cat_params)\n\n\t\tif @cat.save\n\t\t\t# cat_url(@cat) == /cat/{@cat.id}\n\t\t\tredirect_to cat_url(@cat)\n\t\telse\n\t\t\trender :new\n\t\t\t# render json: @cat.errors.full_messages, status: :unprocessable_entity\n\t\tend \n\tend", "def create\n \n category = params[:category]\n category_name = category['name']\n \n write_log(\"category.to_s: #{category.to_s}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n cats = []\n if category_name != nil\n cats = category_name.split(\" \")\n end\n \n write_log(\"cats.size: #{cats.size}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n if cats.size > 1\n \n flag = true\n counter = 0\n \n cats.each do |cat|\n # @category = Category.new(params[:category])\n # @category = Category.new(name=cat)\n @category = Category.new({\"name\"=> cat, \"genre_id\"=> category['genre_id']})\n \n if @category.save\n else\n counter += 1\n end\n end#cats.each do |cat|\n \n respond_to do |format|\n format.html { redirect_to @category, \n notice: \"New categories: Created => #{cats.size - counter}, Failed => #{counter}\" }\n format.json { render json: @category, status: :created, location: @category }\n end\n \n else#if cats.size > 1\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end#if cats.size > 1\n \n \n # @category = Category.new(params[:category])\n# \n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\n @category = Category.new(category_params)\n @category.save\n render json: { params: params, notice: 'Categoria registrada exitosamente' }\n end", "def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end", "def new\n @space_cat = SpaceCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @space_cat }\n end\n end", "def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def create\n @categ = Categ.new(categ_params)\n\n respond_to do |format|\n if @categ.save\n format.html { redirect_to @categ, notice: 'Categ was successfully created.' }\n format.json { render :show, status: :created, location: @categ }\n else\n format.html { render :new }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n _update_topics \n format.html { redirect_to action: \"new\", notice: 'Cat was successfully created.' }\n format.json { render json: @cat, status: :created, location: @cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def create\n @server = Server.new(server_params)\n @server.user_id = current_user.id\n cats = params[:server][:category_id]\n\n respond_to do |format|\n if @server.save\n\n cats.each do |c|\n unless c.empty?\n stc = ServersToCategories.new\n stc.category_id = c\n stc.server_id = @server.id\n\n stc.save\n end\n end\n\n format.html { redirect_to @server, notice: 'Server was successfully created.' }\n format.json { render :show, status: :created, location: @server }\n else\n format.html { render :new }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @space_cat.destroy\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def create\n @cat = Cat.new(cat_params)\n @cat.user = current_user\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render :show, status: :created, location: @cat }\n else\n format.html { redirect_to new_cat_path }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n category = Category.create(category_params)\n\n \n if category\n render json:{\n status: :created,\n category: category}\n else\n render json: { status: 500 }\n end\n end", "def create\n @category = Category.new(category_params)\n authorize! :create, @category\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def create\n @taxonomy_category = TaxonomyCategory.new(params[:taxonomy_category])\n\n respond_to do |format|\n if @taxonomy_category.save\n format.html { redirect_to @taxonomy_category, notice: 'Taxonomy category was successfully created.' }\n format.json { render json: @taxonomy_category, status: :created, location: @taxonomy_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taxonomy_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @space_cats = SpaceCat.all\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cat = Cat.new(catparams)\n if @cat.save\n redirect_to @cat\n else\n render 'new'\n end\n end", "def create\n @mk_categoria = MkCategoria.new(mk_categoria_params)\n\n respond_to do |format|\n if @mk_categoria.save\n format.html { redirect_to @mk_categoria, notice: 'Mk categoria was successfully created.' }\n format.json { render :show, status: :created, location: @mk_categoria }\n else\n format.html { render :new }\n format.json { render json: @mk_categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend", "def create\n category = @current_user.categories.create!(category_params)\n render json: { category: category }\n end", "def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end", "def destroy\n @space_cat = SpaceCat.find(params[:id])\n @space_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n if @incidentcategory.save\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end", "def create\n @category = current_user.categories.new(name: params[:name])\n if @category.save\n render \"create.json.jbuilder\", status: :created\n else\n render json: { errors: @category.errors.full_messages }, status: :unprocessable_entity\n end\n end", "def create\n @kategory = Kategory.new(params[:kategory])\n\n respond_to do |format|\n if @kategory.save\n format.html { redirect_to @kategory, notice: 'Kategory was successfully created.' }\n format.json { render json: @kategory, status: :created, location: @kategory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sys_category = Sys::Category.new(sys_category_params)\n\n respond_to do |format|\n if @sys_category.save\n format.html { redirect_to @sys_category, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sys_category }\n else\n format.html { render action: 'new' }\n format.json { render json: @sys_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_space_cat\n @space_cat = SpaceCat.find(params[:id])\n end", "def create\n @category = Category.new(params[:category])\n @category.format_name = params[:category][:name].gsub(/ /, \"_\").downcase\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_scenic_spots_path, notice: 'Article was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @category = Category.new(category_params)\n @category.category = @category.category.strip\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n \n \n end", "def create_category(cat_name)\n category = Spree::Taxonomy.where(name: 'Categories').first\n category = Spree::Taxonomy.create(name: 'Categories') if category.nil?\n taxon = Spree::Taxon.find_by(name: cat_name, taxonomy_id: category.id)\n if taxon.present?\n spree_taxons.append(taxon)\n else\n taxon = Spree::Taxon.new(name: cat_name, taxonomy_id: category.id, parent_id: category.root.id)\n if taxon.save\n spree_taxons.append(taxon)\n else\n Rails.logger.info \"Error! #{taxon.errors.full_messages}\"\n end\n end\n end", "def create\n @categoria_norma = CategoriaNorma.new(categoria_norma_params)\n\n respond_to do |format|\n if @categoria_norma.save\n format.html { redirect_to @categoria_norma, notice: 'Categoria norma was successfully created.' }\n format.json { render :show, status: :created, location: @categoria_norma }\n else\n format.html { render :new }\n format.json { render json: @categoria_norma.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cat = Category.new(cat_params)\n if @cat.save\n flash[:success] = \"successfully created new category #{@cat.name}.\"\n redirect_to dashboard_path\n else\n flash[:error] = @cat.errors.messages\n render :new, status: :bad_request\n end\n return\n end", "def create\n @categor = Categor.new(categor_params)\n\n respond_to do |format|\n if @categor.save\n format.html { redirect_to @categor, notice: 'Categor was successfully created.' }\n format.json { render :show, status: :created, location: @categor }\n else\n format.html { render :new }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Категория добавлена.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully created.' }\n format.json { render json: @categoria, status: :created, location: @categoria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "def cat_params\n if [\"index\", \"destroy\"].include?(params[:action])\n # Workaround when dealing with JSON:\n params.permit(:cat)\n else\n params.require(:cat).permit(:name, :city, :offset)\n end\n end", "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :created }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n @category.category_group_id ||= params[:category_group_id]\n\n respond_to do |format|\n if @category.save\n save_curated_items(@category)\n format.html { redirect_to(categories_path, notice: 'Category was successfully created.') }\n format.json { render json: @category, status: :created, location: @category }\n else\n set_flash_messages_from_errors(@category)\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to(@cat, :notice => 'Cat was successfully created.') }\n format.xml { render :xml => @cat, :status => :created, :location => @cat }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cat.errors, :status => :unprocessable_entity }\n end\n end\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def create\n @cover_cat = CoverCat.new(params[:cover_cat])\n\n respond_to do |format|\n if @cover_cat.save\n format.html { redirect_to @cover_cat, notice: 'Cover cat was successfully created.' }\n format.json { render json: @cover_cat, status: :created, location: @cover_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cover_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_category_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.create_category ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'category'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#create_category\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_categories(cats=[])\n rescue_extra_data\n cats = cats.to_i\n old_categories = categories.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")\n delete_categories = old_categories - cats\n news_categories = cats - old_categories\n term_relationships.where(\"term_taxonomy_id in (?)\", delete_categories ).destroy_all if delete_categories.present?\n news_categories.each do |key|\n term_relationships.create(:term_taxonomy_id => key)\n end\n update_counters(\"categories\")\n end", "def create\n @charity_category = CharityCategory.new(params[:charity_category])\n\n respond_to do |format|\n if @charity_category.save\n format.html { redirect_to admins_charity_categories_url, notice: 'Charity Category was successfully created.' }\n format.json { render json: @charity_category, status: :created, location: @charity_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @charity_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_category(category_name, options={ })\n self.post('/categories.json',\n options.merge(\n :body => { :category => {\n :name => category_name\n } }.to_json\n )\n )['category']\n end", "def postCategoryMappings( category_id, type, id, name)\n params = Hash.new\n params['category_id'] = category_id\n params['type'] = type\n params['id'] = id\n params['name'] = name\n return doCurl(\"post\",\"/category/mappings\",params)\n end", "def user_category\n # byebug\n @user = User.where(contact: params[:contact]).first\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-data\", data: \"category saved\"}, status: :ok\n end", "def create\n @category = Category.new(params[:category]) \n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:created_category_success)}\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gt_category = GtCategory.new(gt_category_params)\n\n respond_to do |format|\n if @gt_category.save\n format.html { redirect_to @gt_category, notice: 'Gt category was successfully created.' }\n format.json { render :show, status: :created, location: @gt_category }\n else\n format.html { render :new }\n format.json { render json: @gt_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @post_category = Post::Category.new(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n format.html { redirect_to @post_category, notice: 'Category was successfully created.' }\n format.json { render json: @post_category, status: :created, location: @post_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html {\n redirect_to @category, notice: 'Category was successfully created.'\n }\n format.json {\n render json: @category, status: :created, location: @category\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @category.errors, status: :unprocessable_entity\n }\n end\n end\n end", "def create\n if params[:categoria_producto]\n p = Producto.find(params[:producto_id])\n c = Categoria.find(params[:categoria_id])\n\n if p.categorias << c\n render json: c, status: :created\n else\n render json: {:errors => {categoria: [\"No se ha podido agregar categoria\"]}}, status: :unprocessable_entity\n end\n\n else\n @categoria = Categoria.new(parametros_categoria)\n\n if @categoria.save\n render json: @categoria, status: :created\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end\n end", "def create\n @product_cat = ProductCat.new(params[:product_cat])\n\n respond_to do |format|\n if @product_cat.save\n format.html { redirect_to @product_cat, notice: 'Product cat was successfully created.' }\n format.json { render json: @product_cat, status: :created, location: @product_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def cat_params\n params.require(:cat).permit(:user_id, :cat_type_id, :location_id, :name,\n :age, :color, :hyperactivity, :health, :about,\n :image, :gender)\n end", "def create\n @cathegory = Cathegory.new(cathegory_params)\n\n respond_to do |format|\n if @cathegory.save\n format.html { redirect_to @cathegory, notice: 'Cathegory was successfully created.' }\n format.json { render :show, status: :created, location: @cathegory }\n else\n format.html { render :new }\n format.json { render json: @cathegory.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @home_cat = HomeCat.new(params[:home_cat])\n\n respond_to do |format|\n if @home_cat.save\n format.html { redirect_to @home_cat, notice: 'Home cat was successfully created.' }\n format.json { render json: @home_cat, status: :created, location: @home_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @home_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n category = Category.create!(category_params)\n render json: {\n :html => render_to_string(\n :partial => \"setups/category\",\n :layout => false,\n :locals => {:category => category})\n }\n end", "def create\n @articlecat = Articlecat.new(articlecat_params)\n\n respond_to do |format|\n if @articlecat.save\n format.html { redirect_to @articlecat, notice: 'Articlecat was successfully created.' }\n format.json { render :show, status: :created, location: @articlecat }\n else\n format.html { render :new }\n format.json { render json: @articlecat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categories = Category.where(validity: true)\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:category_created) }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_category\n @category = TestCategory.new(params[:category])\n @category.save\n @categories = TestCategory.find(:all)\n redraw 'categories'\n end", "def create\n @men_shop_collection_category = MenShopCollectionCategory.new(men_shop_collection_category_params)\n\n respond_to do |format|\n if @men_shop_collection_category.save\n format.html { redirect_to @men_shop_collection_category, notice: 'Men shop collection category was successfully created.' }\n format.json { render :show, status: :created, location: @men_shop_collection_category }\n else\n format.html { render :new }\n format.json { render json: @men_shop_collection_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created!!' }\n format.json { render json: @category, status: :created, location: @category }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mastery_category = MasteryCategory.new(params[:mastery_category])\n\n respond_to do |format|\n if @mastery_category.save\n format.html { redirect_to @mastery_category, notice: 'Mastery category was successfully created.' }\n format.json { render json: @mastery_category, status: :created, location: @mastery_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mastery_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @catalog_category = CatalogCategory.new(catalog_category_params)\n\n respond_to do |format|\n if @catalog_category.save\n format.html { redirect_to catalog_categories_url }\n format.json { render :show, status: :created, location: @catalog_category }\n else\n format.html { render :new }\n format.json { render json: @catalog_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def category_params\n params.require(:category).permit(:name, :description, :term, :task_ids => [])\n end", "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Категория была успешно создана'}\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n init = params[:category][:name][0]\n division = Division.find_by_name(params[:division_id].upcase)\n category_number = Category.create_number(params)\n @category = Category.new(category_params.merge(:code => (('%03d' % ((Category.last.code.to_i rescue 0)+1)))).merge(:division_id => division.id))\n if @category.save\n flash[:notice] = 'Category was successfully added'\n redirect_to categories_path\n else\n flash[:error] = @category.errors.full_messages\n render \"new\"\n end\n end", "def create\n @equipment_cat = EquipmentCat.new(equipment_cat_params)\n\n respond_to do |format|\n if @equipment_cat.save\n format.html { redirect_to @equipment_cat, notice: 'Equipment cat was successfully created.' }\n format.json { render :show, status: :created, location: @equipment_cat }\n else\n format.html { render :new }\n format.json { render json: @equipment_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mytag = Mytag.new(mytag_params)\n\n respond_to do |format|\n if @mytag.save\n format.html { redirect_to root_path, success: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @mytag }\n else\n format.html { render :new }\n format.json { render json: @mytag.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pcategory = Pcategory.new(params[:pcategory])\n\n respond_to do |format|\n if @pcategory.save\n format.html { redirect_to @pcategory, notice: 'La categoria se creo satisfactoriamente.' }\n format.json { render json: @pcategory, status: :created, location: @pcategory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pcategory.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.71639806", "0.6535278", "0.6386513", "0.63362503", "0.6325344", "0.6247361", "0.6221174", "0.6163169", "0.61283386", "0.6084104", "0.6083778", "0.60169536", "0.60167485", "0.5973172", "0.5937826", "0.59300584", "0.5902818", "0.5894493", "0.58809674", "0.5797", "0.57599175", "0.57376754", "0.5734495", "0.57283014", "0.5719364", "0.56860226", "0.5666416", "0.5665492", "0.5659775", "0.5656246", "0.56551003", "0.565131", "0.5648662", "0.56395936", "0.5632416", "0.56269985", "0.55949634", "0.5590168", "0.55841327", "0.5580582", "0.55776584", "0.55634", "0.55578595", "0.55550534", "0.55468744", "0.5545115", "0.5541327", "0.55386376", "0.5530627", "0.55025315", "0.5500809", "0.55001116", "0.54979736", "0.5496764", "0.54900295", "0.5485764", "0.54840004", "0.54776835", "0.5474271", "0.5471517", "0.5470588", "0.54666984", "0.546586", "0.5463418", "0.5463418", "0.5463418", "0.5463418", "0.5463418", "0.54553735", "0.54525733", "0.5444521", "0.54402333", "0.5439252", "0.54379046", "0.5432994", "0.54243535", "0.5422972", "0.54180217", "0.54179406", "0.5417525", "0.54147065", "0.5410827", "0.5407693", "0.54040235", "0.5402667", "0.54010975", "0.53992575", "0.5394763", "0.5394387", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743", "0.5393743" ]
0.71181846
1
PATCH/PUT /space_cats/1 PATCH/PUT /space_cats/1.json
def update respond_to do |format| if @space_cat.update(space_cat_params) format.html { redirect_to @space_cat, notice: 'Space cat was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @space_cat.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n if @space_cat.update_attributes(params[:space_cat])\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n json_update(category,category_params, Category)\n end", "def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n format.html { redirect_to @cat, notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end", "def editCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.update(name: params[:name])\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n _update_topics \n format.html { redirect_to action: \"edit\", notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n old_name = @space_type.name\n if @space_type.update(space_type_params)\n @space_type.spaces.each { |s| s.touch }\n format.html { redirect_to @space_type, notice: t('.update_ok') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @space_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cat2.update(cat2_params)\n format.html { redirect_to @cat2, notice: 'Cat2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat2 }\n else\n format.html { render :edit }\n format.json { render json: @cat2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cat02.update(cat02_params)\n format.html { redirect_to @cat02, notice: 'Cat02 was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat02 }\n else\n format.html { render :edit }\n format.json { render json: @cat02.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n format.html { redirect_to(@cat, :notice => 'Cat was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cat.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n @category.format_name = params[:category][:name].gsub(/ /, \"_\").downcase\n \n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to admin_scenic_spots_url, notice: 'Article was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @p_cat.update(p_cat_params)\n format.html { redirect_to @p_cat, notice: 'P cat was successfully updated.' }\n format.json { render :show, status: :ok, location: @p_cat }\n else\n format.html { render :edit }\n format.json { render json: @p_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @category.update(category_params)\n render json: @category, status: :ok\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @headline = t(:update_category)\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:updated_category_success) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @fatcat.update(fatcat_params)\n format.html { redirect_to @fatcat, notice: 'Fatcat was successfully updated.' }\n format.json { render :show, status: :ok, location: @fatcat }\n else\n format.html { render :edit }\n format.json { render json: @fatcat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @category.update(params[:category])\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @cathegory.update(cathegory_params)\n format.html { redirect_to @cathegory, notice: 'Cathegory was successfully updated.' }\n format.json { render :show, status: :ok, location: @cathegory }\n else\n format.html { render :edit }\n format.json { render json: @cathegory.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @categ.update(categ_params)\n format.html { redirect_to @categ, notice: 'Categ was successfully updated.' }\n format.json { render :show, status: :ok, location: @categ }\n else\n format.html { render :edit }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @server.update(server_params)\n @server.servers_to_categories.destroy_all\n\n cats = params[:server][:category_id]\n cats.each do |c|\n unless c.empty?\n stc = ServersToCategories.new\n stc.category_id = c\n stc.server_id = @server.id\n\n stc.save\n end\n end\n\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cat = Cat.find(params[:id])\n if @cat.update(catparams)\n redirect_to @cat\n else\n render 'edit'\n end\n end", "def update\n if @categoria.update(categoria_params)\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity \n end\n end", "def update\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category.update_attributes(params[:category])\n respond_with(@category)\n end", "def update\n respond_to do |format|\n if @stylist_category.update(stylist_category_params)\n format.html { redirect_to @stylist_category, notice: 'Stylist category was successfully updated.' }\n format.json { render :show, status: :ok, location: @stylist_category }\n else\n format.html { render :edit }\n format.json { render json: @stylist_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render :show, status: :ok, location: @category }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @catched.update(catched_params)\n format.html { redirect_to @catched, notice: 'Catched was successfully updated.' }\n format.json { render :show, status: :ok, location: @catched }\n else\n format.html { render :edit }\n format.json { render json: @catched.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe = Recipe.find(params[:id])\n\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n @categories=RecipeCategory.all\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @product_cat = ProductCat.find(params[:id])\n\n respond_to do |format|\n if @product_cat.update_attributes(params[:product_cat])\n format.html { redirect_to @product_cat, notice: 'Product cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cover_cat = CoverCat.find(params[:id])\n\n respond_to do |format|\n if @cover_cat.update_attributes(params[:cover_cat])\n format.html { redirect_to @cover_cat, notice: 'Cover cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cover_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ocat = Ocat.find(params[:id])\n\n respond_to do |format|\n if @ocat.update_attributes(params[:ocat])\n format.html { redirect_to @ocat, notice: 'Ocat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ocat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cat_blok.update(cat_blok_params)\n format.html { redirect_to cat_bloks_url, notice: 'Cat blok was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_blok }\n else\n format.html { render :edit }\n format.json { render json: @cat_blok.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #locates the category to be updated\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cog.update(cog_params)\n format.html { redirect_to @cog, notice: 'Cog was successfully updated.' }\n format.json { render :show, status: :ok, location: @cog }\n else\n format.html { render :edit }\n format.json { render json: @cog.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to :back, notice: 'category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sys_category.update(sys_category_params)\n format.html { redirect_to @sys_category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sys_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @cat.update(cat_params)\n redirect_to @cat, notice: 'Cat was successfully updated.'\n else\n render :edit\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @equipment_cat.update(equipment_cat_params)\n format.html { redirect_to @equipment_cat, notice: 'Equipment cat was successfully updated.' }\n format.json { render :show, status: :ok, location: @equipment_cat }\n else\n format.html { render :edit }\n format.json { render json: @equipment_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @schema_category.update(schema_category_params)\n format.html { redirect_to schema_categories_path, notice: 'Schema category was successfully updated.' }\n format.json { render :show, status: :ok, location: @schema_category }\n else\n format.html { render :edit }\n format.json { render json: @schema_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # recipe_params[:ingredient_lists_attributes].each do |list|\n # list.each do |item|\n # item[:ingredient_attributes] = Ingredient.where(name: item[:ingredient_attributes].name).first_or_create\n # end\n # end\n \n # category_ids = params[:recipe][:categories_attributes].map { |k,v| v[:id] }\n # #pry.debugger\n \n # recipe_params.merge({ category_ids: category_ids })\n \n\n respond_to do |format|\n \n if @recipe.update(recipe_params)\n format.html { redirect_to recipes_url, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @space = Space.find(params[:id])\n \n respond_to do |format|\n if @space.update_attributes(params[:space])\n format.html { redirect_to @space, notice: 'Space was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mastery_category = MasteryCategory.find(params[:id])\n\n respond_to do |format|\n if @mastery_category.update_attributes(params[:mastery_category])\n format.html { redirect_to @mastery_category, notice: 'Mastery category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mastery_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:category_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @couch.update(couch_params)\n format.html { redirect_to @couch, notice: 'Couche was successfully updated.' }\n format.json { render :show, status: :ok, location: @couch }\n else\n format.html { render :edit }\n format.json { render json: @couch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kategory = Kategory.find(params[:id])\n\n respond_to do |format|\n if @kategory.update_attributes(params[:kategory])\n format.html { redirect_to @kategory, notice: 'Kategory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @home_cat = HomeCat.find(params[:id])\n\n respond_to do |format|\n if @home_cat.update_attributes(params[:home_cat])\n format.html { redirect_to @home_cat, notice: 'Home cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @home_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_group_category.update(api_v1_group_category_params)\n format.html { redirect_to @api_v1_group_category, notice: 'Group category was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_category }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @specialization_category.update(specialization_category_params)\n format.html { redirect_to @specialization_category, notice: 'Specialization category was successfully updated.' }\n format.json { render :show, status: :ok, location: @specialization_category }\n else\n format.html { render :edit }\n format.json { render json: @specialization_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @catalog_category.update(catalog_category_params)\n format.html { redirect_to catalog_categories_url }\n format.json { render :show, status: :ok, location: @catalog_category }\n else\n format.html { render :edit }\n format.json { render json: @catalog_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @incidentcategory.update(incidentcategory_params)\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end\n end", "def update\n @pictures_of_cat = PicturesOfCat.find(params[:id])\n\n respond_to do |format|\n if @pictures_of_cat.update_attributes(params[:pictures_of_cat])\n format.html { redirect_to @pictures_of_cat, notice: 'Pictures of cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pictures_of_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n unless @category.name == \"ROOT\"\n if @category.update(category_params)\n render 'show', :status => 200, :layout => false, notice: 'Category was successfully created.'\n else\n render :json => {:message => \"Error in updating category\"}, notice: @category.errors, :layout => false, :status => 400\n end\n else\n render :json => {:message => \"Root can't be edited.\"}, :layout => false, :status => 400\n end\n end", "def update\n respond_to do |format|\n if @st_category.update(st_category_params)\n format.html { redirect_to @st_category, notice: 'St category was successfully updated.' }\n format.json { render :show, status: :ok, location: @st_category }\n else\n format.html { render :edit }\n format.json { render json: @st_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n\n intent_request = @api_ai_client.create_intents_request\n response = intent_request.update(@category.intent_id, param_options)\n\n if response.is_a?(Hash) && response[:status][:code].eql?(200)\n\n contexts_templates = { contexts: category_params[:contexts].split(\",\"), templates: category_params[:templates].split(\",\") }\n\n if @category.update(category_params.merge(contexts_templates))\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n else\n @notice = response.message\n\n format.html { render :new }\n format.json { render json: { error: response.message }, status: response.code}\n end\n end\n end", "def update\n respond_to do |format|\n if @small_category.update(small_category_params)\n format.html { redirect_to @small_category, notice: 'Small category was successfully updated.' }\n format.json { render :show, status: :ok, location: @small_category }\n else\n format.html { render :edit }\n format.json { render json: @small_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vcat.update(vcat_params)\n format.html { redirect_to @vcat, notice: 'Vcat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vcat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html {\n redirect_to @category, notice: 'Category was successfully updated.'\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json {\n render json: @category.errors, status: :unprocessable_entity\n }\n end\n end\n end", "def update\n @myspace = Myspace.find(params[:id])\n\n respond_to do |format|\n if @myspace.update_attributes(params[:myspace])\n format.html { redirect_to @myspace, notice: 'Myspace was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @myspace.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @maincat.update(maincat_params)\n format.html { redirect_to @maincat, notice: 'Maincat was successfully updated.' }\n format.json { render :show, status: :ok, location: @maincat }\n else\n format.html { render :edit }\n format.json { render json: @maincat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vendor_cat.update(vendor_cat_params)\n format.html { redirect_to @vendor_cat, notice: 'Vendor cat was successfully updated.' }\n format.json { render :show, status: :ok, location: @vendor_cat }\n else\n format.html { render :edit }\n format.json { render json: @vendor_cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @catmath.update(catmath_params)\n format.html { redirect_to @catmath, notice: 'Catmath was successfully updated.' }\n format.json { render :show, status: :ok, location: @catmath }\n else\n format.html { render :edit }\n format.json { render json: @catmath.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @body_style_categorization = BodyStyleCategorization.find(params[:id])\n\n respond_to do |format|\n if @body_style_categorization.update_attributes(params[:body_style_categorization])\n format.html { redirect_to @body_style_categorization, notice: 'Body style categorization has been updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @body_style_categorization.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n if @recipe_category.update_attributes(params[:recipe_category])\n format.html { redirect_to @recipe_category, notice: 'Recipe category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @taxonomy_category = TaxonomyCategory.find(params[:id])\n\n respond_to do |format|\n if @taxonomy_category.update_attributes(params[:taxonomy_category])\n format.html { redirect_to @taxonomy_category, notice: 'Taxonomy category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taxonomy_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @couch.update(couch_params)\n format.html { redirect_to @couch, notice: 'Couch was successfully updated.' }\n format.json { render :show, status: :ok, location: @couch }\n else\n format.html { render :edit }\n format.json { render json: @couch.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n @trip = Trip.find(params[:id])\n \n \n params[:trip][:category_ids] ||= []\n params[:trip][:type_ids] ||= []\n \n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, :notice => 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cat_poly.update(cat_poly_params)\n format.html { redirect_to @cat_poly, notice: 'Cat poly was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_poly }\n else\n format.html { render :edit }\n format.json { render json: @cat_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @operaziones_cat_colture.update(operaziones_cat_colture_params)\n format.html { redirect_to @operaziones_cat_colture, notice: 'Operaziones cat colture was successfully updated.' }\n format.json { render :show, status: :ok, location: @operaziones_cat_colture }\n else\n format.html { render :edit }\n format.json { render json: @operaziones_cat_colture.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category, location: categories_url)\n end", "def update\n @contract_doc_category = ContractDocCategory.find(params[:id])\n\n respond_to do |format|\n if @contract_doc_category.update_attributes(params[:contract_doc_category])\n format.html { redirect_to @contract_doc_category, notice: 'Contract doc category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract_doc_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_good_categories_url, notice: 'GoodCategory was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cluster = Cluster.find(params[:id])\n\n respond_to do |format|\n if @cluster.update_attributes(params[:cluster])\n format.html { redirect_to @cluster, notice: 'Cluster was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cluster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n category= Category.find(params[:id])\n category.update(category_params)\n \n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: t('update.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cate_item = CateItem.find(params[:id])\n\n respond_to do |format|\n if @cate_item.update_attributes(params[:cate_item])\n format.html { redirect_to @cate_item, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cate_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Категория изменена.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to backend_shop_branch_category_path(@current_shop.slug, @current_branch, @category), notice: t('Category was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n if @kitty.update_attributes(params[:kitty])\n format.html { redirect_to @kitty, notice: 'Kitty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @super_category = SuperCategory.find(params[:id])\n\n respond_to do |format|\n if @super_category.update_attributes(params[:super_category])\n format.html { redirect_to @super_category, notice: 'Super category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @super_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if current_category.category==\"noone\"\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n else\n render :file => \"/public/404.html\",:status => \"404\"\n end\n \n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \tauthorize! :update, @category\n respond_to do |format|\n if @category.update(category_params)\n\t @category.update(icon: session[:icon]) \n\t\tformat.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar a categoria'\n end\n\n # respond_to do |format|\n # if @category.update_attributes(params[:category])\n # format.html { redirect_to categories_path}\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n \n # end\n # end\n end", "def update\n respond_to do |format|\n if @space.update(space_params)\n format.html { redirect_to @space, notice: 'Space was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7052962", "0.67820835", "0.65232986", "0.6351166", "0.63274974", "0.62632525", "0.6228405", "0.6121107", "0.6081268", "0.60692", "0.6057287", "0.6031685", "0.60066086", "0.5997953", "0.59776133", "0.5975814", "0.59701675", "0.59572995", "0.5932737", "0.59149164", "0.5908406", "0.58851266", "0.5880319", "0.5870659", "0.5863886", "0.5858685", "0.585244", "0.58456403", "0.58371747", "0.5835425", "0.58295995", "0.58218896", "0.5817076", "0.5814227", "0.5813045", "0.580856", "0.5800513", "0.5795814", "0.5790516", "0.5789633", "0.5785365", "0.57831115", "0.57663834", "0.576103", "0.5751387", "0.5747101", "0.57457507", "0.5745068", "0.5742511", "0.5739009", "0.5735605", "0.5727209", "0.57222134", "0.5718145", "0.57126766", "0.5706369", "0.5695135", "0.56937456", "0.5692696", "0.5692304", "0.56899285", "0.5689249", "0.5688146", "0.56850815", "0.568495", "0.5684924", "0.5684924", "0.5684924", "0.5684924", "0.5684924", "0.5684924", "0.5684924", "0.5683314", "0.56832755", "0.56793106", "0.5668517", "0.56660277", "0.5663952", "0.5660815", "0.5659797", "0.56579465", "0.5650453", "0.5644035", "0.5644035", "0.5641711", "0.5630079", "0.5629201", "0.5628079", "0.56278163", "0.5626627", "0.5623983", "0.56226426", "0.5622489", "0.562209", "0.5621799", "0.56213826", "0.5620957", "0.5620737", "0.5606123", "0.56054574" ]
0.7046794
1
DELETE /space_cats/1 DELETE /space_cats/1.json
def destroy @space_cat.destroy respond_to do |format| format.html { redirect_to space_cats_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @space_cat = SpaceCat.find(params[:id])\n @space_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cats_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def deleteCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.destroy\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: true, reason: error, data: \"\"}\n end", "def destroy\n @category.destroy\n render json: @category, status: :ok\n end", "def destroy\n @cat.destroy\n respond_to do |format|\n format.html { redirect_to cats_url, notice: 'Cat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couche was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n category = set_category\n if category.destroy\n head :no_content\n else\n render json: { status: 500 }\n end\n \n end", "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat02.destroy\n respond_to do |format|\n format.html { redirect_to cat02s_url, notice: 'Cat02 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category_db.destroy\n respond_to do |format|\n format.html { redirect_to category_dbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to(cats_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @cat2.destroy\n respond_to do |format|\n format.html { redirect_to cat2s_url, notice: 'Cat2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cover_cat = CoverCat.find(params[:id])\n @cover_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cover_cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categ.destroy\n respond_to do |format|\n format.html { redirect_to categs_url, notice: 'Categ was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @myspace = Myspace.find(params[:id])\n @myspace.destroy\n\n respond_to do |format|\n format.html { redirect_to myspaces_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_scenic_spots_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cathegory.destroy\n respond_to do |format|\n format.html { redirect_to cathegories_url, notice: 'Cathegory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @space_type.destroy\n respond_to do |format|\n format.html { redirect_to space_types_url, status: 303 }\n format.json { head :no_content }\n end\n end", "def deleteEntityCategory( 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/category\",params)\n end", "def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mastery_category = MasteryCategory.find(params[:id])\n @mastery_category.destroy\n\n respond_to do |format|\n format.html { redirect_to mastery_categories_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @fatcat.destroy\n respond_to do |format|\n format.html { redirect_to fatcats_url, notice: 'Fatcat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @glo_collection.destroy\n respond_to do |format|\n format.html { redirect_to glo_collections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat_blok.destroy\n respond_to do |format|\n format.html { redirect_to cat_bloks_url, notice: 'Cat blok was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cog.destroy\n respond_to do |format|\n format.html { redirect_to cogs_url, notice: 'Cog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @space = Space.find(params[:id])\n\n @space.destroy\n\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end", "def delete_category(name)\n data_array = JSON.parse(File.read(File_path))\n category_item = find_category(name)\n data_array.delete(category_item)\n File.open(File_path, 'w') { |f| f.write(data_array.to_json) }\nend", "def destroy\n @home_cat = HomeCat.find(params[:id])\n @home_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to home_cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n render json: { notice: 'Categoria eliminada exitosamente' }\n end", "def destroy\n @ocat = Ocat.find(params[:id])\n @ocat.destroy\n\n respond_to do |format|\n format.html { redirect_to ocats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = current_mall.categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_wmall_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sys_category.destroy\n respond_to do |format|\n format.html { redirect_to sys_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cate_item = CateItem.find(params[:id])\n @cate_item.destroy\n\n respond_to do |format|\n format.html { redirect_to '/cate_items' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @cat1 = Cat1.find(params[:id])\r\n @cat1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(cat1s_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "def destroy\n @cetegory.destroy\n respond_to do |format|\n format.html { redirect_to cetegories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @alien_category.destroy\n respond_to do |format|\n format.html { redirect_to alien_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @taxonomy_category = TaxonomyCategory.find(params[:id])\n @taxonomy_category.destroy\n\n respond_to do |format|\n format.html { redirect_to taxonomy_categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n IndicatorCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicator_categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @catagory.destroy\n respond_to do |format|\n format.html { redirect_to back_catagories_url, notice: I18n.t('view.notice.deleted') }\n format.json { head :no_content }\n end\n end", "def destroy\n @p_cat.destroy\n respond_to do |format|\n format.html { redirect_to p_cats_url, notice: 'P cat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vcat.destroy\n respond_to do |format|\n format.html { redirect_to vcats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @catebg = Catebg.find(params[:id])\n @catebg.destroy\n\n respond_to do |format|\n format.html { redirect_to catebgs_url }\n format.json { head :no_content }\n end\n end", "def DeleteCategory id\n \n APICall(path: \"categories/#{id}.json\",method: 'DELETE')\n \n end", "def destroy\n @maincat.destroy\n respond_to do |format|\n format.html { redirect_to maincats_url, notice: 'Maincat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gt_category.destroy\n respond_to do |format|\n format.html { redirect_to gt_categories_url, notice: 'Gt category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @catmath.destroy\n respond_to do |format|\n format.html { redirect_to catmaths_url, notice: 'Catmath was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dish_category.destroy\n respond_to do |format|\n format.html { redirect_to dish_categories_url, notice: 'Категория блюда удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @categoria_norma.destroy\n respond_to do |format|\n format.html { redirect_to categoria_normas_url, notice: 'Categoria norma was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @categorie_droit.destroy\n respond_to do |format|\n format.html { redirect_to categorie_droits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @st_category.destroy\n respond_to do |format|\n format.html { redirect_to st_categories_url, notice: 'St category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @product_cat = ProductCat.find(params[:id])\n @product_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to product_cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = @collection.category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @category = DishCategory.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Категория удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @spacecraft.destroy\n respond_to do |format|\n format.html { redirect_to spacecrafts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @section_category = SectionCategory.find(params[:id])\n @section_category.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @collection.destroy\n\n render json: @collection, status: :ok#, location: @collection\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @goods_category = GoodsCategory.find(params[:id])\n @goods_category.destroy\n\n respond_to do |format|\n format.html { redirect_to goods_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_good_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vendor_cat.destroy\n respond_to do |format|\n format.html { redirect_to vendor_cats_url, notice: 'Vendor cat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat_poly.destroy\n respond_to do |format|\n format.html { redirect_to cat_polies_url, notice: 'Cat poly was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pictures_of_cat = PicturesOfCat.find(params[:id])\n @pictures_of_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to pictures_of_cats_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @kategory = Kategory.find(params[:id])\n @kategory.destroy\n\n respond_to do |format|\n format.html { redirect_to kategories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ranged_lot_category.destroy\n respond_to do |format|\n format.html { redirect_to ranged_lot_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categoria = Categoria.find(params[:id])\n @categoria.destroy\n\n respond_to do |format|\n format.html { redirect_to categoria_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @crossbowtype.destroy\n respond_to do |format|\n format.html { redirect_to crossbowtypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to cm_post_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @section.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_contcategory.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contcategories_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url, notice: \"Space was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end", "def destroy\n @articlecat.destroy\n respond_to do |format|\n format.html { redirect_to articlecats_url, notice: 'Articlecat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n head :no_content\n end", "def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stylist_category.destroy\n respond_to do |format|\n format.html { redirect_to stylist_categories_url, notice: 'Stylist category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url, notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url, notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @space = @basic.spaces.find(params[:id])\n @space.destroy\n respond_to do |format|\n format.html { redirect_to edit_basic_path(@basic), notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @clitem.destroy\n respond_to do |format|\n format.html { redirect_to clitems_url }\n format.json { head :no_content }\n\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 animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @small_category.destroy\n respond_to do |format|\n format.html { redirect_to small_categories_url, notice: 'Small category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @attr.destroy\n respond_to do |format|\n format.html { redirect_to attrs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pic_space = PicSpace.find(params[:id])\n @pic_space.destroy\n\n respond_to do |format|\n format.html { redirect_to pic_spaces_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categor.destroy\n respond_to do |format|\n format.html { redirect_to categors_url, notice: 'Categor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def destroy\n @space.destroy\n head :no_content\n end", "def destroy\n @space.destroy\n head :no_content\n end" ]
[ "0.7420269", "0.68448037", "0.68448037", "0.6783321", "0.67816484", "0.6687884", "0.667114", "0.65857", "0.65779877", "0.6571176", "0.6569351", "0.65614915", "0.6533694", "0.65197694", "0.6504651", "0.6487761", "0.6486724", "0.64756393", "0.64723355", "0.64576125", "0.64574707", "0.64522946", "0.64520675", "0.64358294", "0.64298135", "0.64283776", "0.64207166", "0.6405753", "0.6405404", "0.640455", "0.6395468", "0.63858503", "0.6382536", "0.63815635", "0.63721466", "0.63622916", "0.63588303", "0.6340168", "0.633707", "0.6335139", "0.63332045", "0.6327147", "0.632057", "0.6317557", "0.6310058", "0.6299706", "0.6299224", "0.62982637", "0.629104", "0.6278259", "0.6268464", "0.62632966", "0.6258732", "0.62531936", "0.62472", "0.6245782", "0.6234069", "0.6228903", "0.62273806", "0.62210304", "0.6218743", "0.6203294", "0.6201607", "0.6200566", "0.61990505", "0.6198835", "0.6198731", "0.6196056", "0.61949205", "0.61948633", "0.61946183", "0.6193575", "0.6192445", "0.6184762", "0.6182638", "0.6182181", "0.6179744", "0.6178592", "0.61717236", "0.6169129", "0.61676174", "0.6164609", "0.61635405", "0.616352", "0.6163379", "0.6163379", "0.6162967", "0.61619943", "0.6161637", "0.6161137", "0.6159145", "0.6159145", "0.6159145", "0.61585075", "0.61578757", "0.615702", "0.6155807", "0.61542636", "0.6154155", "0.6154155" ]
0.741151
1
Use callbacks to share common setup or constraints between actions.
def set_space_cat @space_cat = SpaceCat.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 space_cat_params params.require(:space_cat).permit(:name) 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
Never trust parameters from the scary internet, only allow the white list through.
def payment_donation_params params.require(:payment_donation).permit(policy(@donation || Payment::Donation).permitted_attributes) 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 model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def 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 active_code_params\n params[:active_code].permit\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def filter_parameters; end", "def filter_parameters; end", "def list_params\n params.permit(:name)\n 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 admin_social_network_params\n params.require(:social_network).permit!\n end", "def url_whitelist; 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 filter_params\n params.require(:filters).permit(:letters)\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 user_params\n params.permit(:name, :age, :username, :display_photo, :password)\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 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.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.6293856", "0.6290323", "0.62816143", "0.6241851", "0.6241208", "0.622036", "0.62128764", "0.62110275", "0.61966056", "0.61776453", "0.617547", "0.6174961", "0.61654735", "0.6153256", "0.61516005", "0.6149498", "0.6123234", "0.6118653", "0.61077267", "0.61061186", "0.6093616", "0.608318", "0.6074428", "0.60650206", "0.60244286", "0.6020295", "0.60155797", "0.6012826", "0.6010141", "0.6010141", "0.60037106", "0.600298", "0.59979576", "0.5994806", "0.5994283", "0.5993927", "0.5980616", "0.59667075", "0.59614897", "0.59610957", "0.596071", "0.5959614", "0.59554", "0.59542966", "0.5946781", "0.5940262", "0.5940262", "0.59401053", "0.5937168", "0.5932135", "0.59293395", "0.592659", "0.59202623", "0.59112674", "0.59088206", "0.590716", "0.59056735", "0.589997", "0.5899655", "0.5898926", "0.5896042", "0.589589", "0.5895867", "0.58894163", "0.5884936", "0.5879227", "0.58740723", "0.5871364", "0.5870148", "0.5869228", "0.5868196", "0.5867967", "0.5865532", "0.58653617", "0.58644646", "0.58631665", "0.5862611", "0.5857609", "0.58558804", "0.5853729", "0.5853025" ]
0.0
-1
CUSTOM FUNCTIONS Builds a maven command line according to the given goals, project and the current environment
def maven(goals, project) command = 'mvn ' # Goals if !goals.is_a?(Array) goals = [goals] end for goal in goals command += goal+' ' end # Options (from environment) if ENV['offline'] == 'yes' command += '-o ' end if ENV['test'] == 'no' command += '-DskipTests=true ' end # Project location command += '-f ' + project.base_dir + '/pom.xml' # Execute puts command system command puts "", "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maven(*goals)\n Dir.chdir(\"./recipeminer-java\") { |path| system('/usr/bin/mvn', *goals)}\nend", "def process(args, flags, mavenArgs, dirMappings)\n doMavenArgs = true;\n args.each do |arg|\n if(/^-/.match(arg))\n next\n end\n\n if(doMavenArgs)\n setToForIn(false, \"cipt\", mavenArgs)\n setToForIn(true, arg, mavenArgs)\n else\n dirMappings.each{ |it|\n puts dirMappings[it]\n puts it\n }\n if(dirMappings[arg])\n addBuild(dirMappings[arg], mavenArgs, flags)\n else\n regexStr = \"^\"\n arg.gsub(/./){|s| regexStr += s+\"[a-zA-Z]*-\"}\n regexStr = regexStr.chop\n regexStr += \"$\"\n \n regex = Regexp.new(regexStr)\n \n dirEntries = Dir.entries(@config.directory)\n dirEntries.each{|x|\n if (regex.match(x))\n addBuild(x, mavenArgs, flags)\n break \n end\n }\n end\n end\n doMavenArgs = !doMavenArgs\n end\n \n puts \"****************************************************\"\n puts \"Maven Command(s) to execute:\\n\" + @mvnCommand.gsub(\" && \", \" &&\\n\")\n puts \"****************************************************\\n\\n\"\n \n system (@mvnCommand)\nend", "def get_mvn_commandline(options)\n full_path = File.join(@project_path, @mvn_path)\n repo_path = File.join(@project_path, \"kit\", \"m2\")\n config_path = File.join(@project_path, \"kit\", \"m2\", \"settings.xml\")\n\n full_options = [\n \"-Dmaven.repo.local=#{repo_path}\",\n \"--settings #{config_path}\",\n \"--strict-checksums\"\n ] + options\n\n \"#{full_path} #{full_options.join(' ')}\"\n end", "def setup_maven_build_targets(cmp, build_vars)\n cmp_src_path = component_src_path cmp\n cmp_build_bin = component_build_bin cmp\n\n if cmp_build_bin != 'mvn'\n STDERR.puts \"[#{cmp}]: the builder is configured (in the YAML file) as '#{cmp_build_bin}', however it seems to be 'mvn'. Look in the source directory ('#{cmp_src_path}') for more details\"\n end\n\n mvn_versions = lookup_maven_pom(cmp_src_path)\n mvn_versions.each do |mvn_version|\n mvn_filename = 'pom.xml'\n if mvn_version != ''\n mvn_filename = 'pom.hadoop' + mvn_version + '.xml'\n end\n mvn_file = File.join cmp_src_path, mvn_filename\n\n # Store the Maven POM file\n build_vars['BUILDER_FILES'] << mvn_file\n\n # Extract the elements of version from the Maven POM XML file\n (mvn_version, has_hadoop, has_spark) = lookup_version_from_mvn_pom(mvn_filename)\n\n # Store the elements of version\n build_vars['PACKAGE_VERSIONS'][mvn_version] = true\n build_vars['HAS_HADOOP'] = has_hadoop\n build_vars['HAS_SPARK'] = has_spark\n\n # Set up the Maven build command line\n cmp_builder_cmds = \"#{cmp_build_bin} -f #{mvn_file} #{CONF_MVN_ARGS}\"\n build_vars['BUILDER_CMDS'] << \"#{cmp_builder_cmds}\"\n \n # Maven tasks/targets for building, packaing and installing (in the local\n # Maven repository, eg, ~/.m2/repository)\n cmp_builder_tasks = \"compile package install\"\n build_vars['BUILDER_FULL_CMDS'] << \"#{cmp_builder_cmds} #{cmp_builder_tasks}\"\n\n # Set up the Maven test command line\n cmp_test_tasks = \"test\"\n build_vars['TEST_FULL_CMDS'] << \"#{cmp_builder_cmds} #{cmp_test_tasks}\"\n end\nend", "def deploy_maven\n puts '#### Start deploy maven ####'\n # Nexus requires XX.XX.XX.XX version numbers\n compiled_version = get_package_version + '.0'\n output = `mvn -X -B -s isso-settings-clm.xml deploy:deploy-file \\\n -Dpackaging=tar \\\n -Dfile=rule-engine-ui-client.tar \\\n -DgeneratePom=true \\\n -DgroupId=com.capitalone.dsd.ui \\\n -DartifactId=rule-engine-ui-client \\\n -Dversion=#{compiled_version} \\\n -DrepositoryId=nexus \\\n -Durl=https://nexus.kdc.capitalone.com/mother/service/local/staging/deploy/maven2 2>&1`\n puts output\n puts '#### Done deploy maven ####'\nend", "def buildArgument()\n workspace = @configuration.workspace\n scheme = @configuration.scheme\n project = @configuration.project\n \n toBuild = ''\n if workspace.nil?\n toBuild = \" -project '\" + project + \".xcodeproj'\"\n else \n toBuild = \" -workspace '\" + workspace + \".xcworkspace'\"\n end \n \n return toBuild\n end", "def execute\n #require 'erb'\n\n root = Dir.pwd\n\n #has_profile = POM::Profile.find(root)\n has_profile = Dir.glob('profile{,.yml,.yaml,.rb}', File::FNM_CASEFOLD).first\n\n if has_profile and not $FORCE #if POM::Profile.find(root) and not $FORCE\n $stderr << \"PROFILE already exists. Use --force option to allow overwrite.\\n\"\n exit -1\n end\n\n require_rubygems\n\n require 'readme'\n require 'gemdo/gemspec'\n\n #prime = { \n # 'name' => File.basename(root),\n # 'version' => '0.0.0',\n # 'requires' => [],\n # 'summary' => \"FIX brief one line description here\",\n # 'contact' => \"FIX name <email> or uri\",\n # 'authors' => \"FIX names of authors here\",\n # 'repository' => \"FIX master public repo uri\"\n #}\n\n #current = Dir.glob('**/*', File::FNM_DOTMATCH)\n\n #if !File.exist?('.ruby')\n # File.open('.ruby', 'w'){|f| f << `ruby -v`}\n #end\n\n #has_package = Gemdo::Rubyspec.find(root)\n\n #if has_profile && !$FORCE\n # $stderr.puts \"Looks like your project is already built on a gemdo.\"\n # $stderr.puts \"To re-create the metadata files use the --force option.\"\n # return\n #end\n\n #name = File.basename(root)\n\n project = POM::Project.new(root)\n\n #name = project.name || File.basename(root)\n# profile = project.profile\n\n #if !has_package\n # #metadata.new_project\n # metadata.name = File.basename(root)\n # metadata.version = '0.0.0'\n # metadata.codename = 'FIXME A version codename is optional'\n #end\n\n# profile.summary = \"FIXME brief one line description here\"\n# profile.contact = \"FIXME name <#{ENV['EMAIL']}>\"\n# profile.authors << \"FIXME list of author's names here\"\n# profile.homepage = \"FIXME: http://your_website.org\"\n #profile.resources.repository = \"FIXME: master public repo uri\"\n\n if resources.empty?\n resources << Dir.glob('*.gemspec').first\n resources << Dir.glob('README{,.*}').first\n end\n\n resources.compact!\n\n resources.each do |file|\n case file\n when /\\.gemspec$/\n text = File.read(file)\n gemspec = /^---/.match(text) ? YAML.load(text) : Gem::Specification.load(file)\n project.import_gemspec(gemspec)\n when /^README/i\n readme = Readme.load(file)\n project.import_readme(readme)\n else\n text = File.read(file)\n obj = /^---/.match(text) ? YAML.load(text) : text\n case obj\n when ::Gem::Specification\n project.import_gemspec(obj)\n when String\n project.import_readme(obj)\n #when Hash\n #metadata.mesh(obj)\n else\n puts \"Cannot convert #{file} (skipped)\"\n end\n end\n end\n\n #project.root = root\n\n # load any meta entries that may already exist\n #project.reload unless options[:replace]\n\n #profile_file = profile.file ? profile.file : File.join(root,'PROFILE')\n\n #if $TRIAL\n #else\n # #if $FORCE or !(has_package or has_profile)\n # metadata.backup!\n # metadata.save! #(package_file)\n # #end\n #end\n\n text = project.profile.render\n \n if $TRIAL\n puts text\n else\n File.open('Profile', 'w'){ |f| f << text }\n\n puts \"'Profile' has been created or updated. Please review\"\n puts \"this file carefully and edit as needed.\\n\"\n end\n\n\n #diff = Dir.glob('**/*', File::FNM_DOTMATCH) - current\n #diff = diff.select{ |f| File.file?(f) }\n\n #if diff.empty?\n # puts \"Nothing has been done.\"\n #else\n # diff.each do |f|\n # puts \" #{f}\"\n # end\n #end\n end", "def _build_command\n use_pipefail = false # debug option\n _assemble_config\n\n parameters = ''\n environment_vars = ''\n tasks = ''\n\n @parameters.each { |name, value| parameters << \" -#{name} \\\"#{value}\\\"\" }\n @environment_vars.each { |name, value| environment_vars << \" #{name}=#{value}\" }\n\n tasks << ' clean' if @do_clean\n tasks << ' build' if @do_build\n tasks << ' archive' if @do_archive\n tasks << ' test' if @do_test\n\n command = ''\n command << 'set -o pipefail && ' if use_pipefail\n command << 'xcodebuild'\n command << parameters << environment_vars << tasks\n command << \" | tee '#{logfile_path}'\"\n unless Illuminator::HostUtils.which(\"xcpretty\").nil? # use xcpretty if available\n command << \" | xcpretty -c -r junit -o \\\"#{BuildArtifacts.instance.xcpretty_report_file}\\\"\"\n end\n command << ' && exit ${PIPESTATUS[0]}' unless use_pipefail\n\n command\n end", "def to_args\n args = [\n \"--name \\\"#{name}\\\"\",\n \"--version \\\"#{version}\\\"\",\n \"--user \\\"#{user}\\\"\",\n \"--group \\\"#{group}\\\"\",\n \"--iteration \\\"#{iteration}\\\"\",\n \"--homepage \\\"#{homepage}\\\"\",\n \"--home \\\"#{home}\\\"\",\n \"--architecture \\\"#{architecture}\\\"\",\n \"--description \\\"#{description}\\\"\",\n \"--maintainer \\\"#{maintainer}\\\"\",\n \"--vendor \\\"#{vendor}\\\"\"\n ]\n args.push \"--dependencies #{dependencies.map{|d| \"\\\"#{d}\\\"\"}.join}\" unless dependencies.nil? || dependencies.empty?\n args.push \"--build-dependencies #{build_dependencies.map{|d| \"\\\"#{d}\\\"\"}.join}\" unless build_dependencies.nil? || build_dependencies.empty?\n args.push \"--compile-cache-dir \\\"#{compile_cache_dir}\\\"\" unless compile_cache_dir.nil? || compile_cache_dir.empty?\n args.push \"--before-precompile \\\"#{before_precompile}\\\"\" unless before_precompile.nil? || before_precompile.empty?\n args.push \"--after-precompile \\\"#{after_precompile}\\\"\" unless after_precompile.nil? || after_precompile.empty?\n args.push \"--before-install \\\"#{before_install}\\\"\" unless before_install.nil? || before_install.empty?\n args.push \"--after-install \\\"#{after_install}\\\"\" unless after_install.nil? || after_install.empty?\n args.push \"--before-remove \\\"#{before_remove}\\\"\" unless before_remove.nil? || before_remove.empty?\n args.push \"--after-remove \\\"#{after_remove}\\\"\" unless after_remove.nil? || after_remove.empty?\n\n args.push \"--license \\\"#{license}\\\"\" unless license.nil? || license.empty?\n args.push \"--buildpack \\\"#{buildpack}\\\"\" unless buildpack.nil? || buildpack.empty?\n args.push \"--buildpack_list \\\"#{buildpack_list}\\\"\" unless buildpack_list.nil? || buildpack_list.empty?\n args.push \"--force-os \\\"#{force_os}\\\"\" unless force_os.nil? || force_os.empty?\n args.push \"--runner \\\"#{runner}\\\"\" unless runner.nil? || runner.empty?\n args.push \"--logrotate-frequency \\\"#{logrotate_frequency}\\\"\" unless logrotate_frequency.nil? || logrotate_frequency.empty?\n args.push \"--logrotate-backlog \\\"#{logrotate_backlog}\\\"\" unless logrotate_backlog.nil?\n args.push \"--env #{env.variables.map{|v| \"\\\"#{v}\\\"\"}.join(\" \")}\" if env.present?\n args.push \"--auto\" if auto\n args.push \"--verbose\" if verbose\n args.push \"--store-cache\" if store_cache\n args.push \"--debug\" if debug\n args.push \"--verify\" if verify\n args.push \"--no-clean\" if !clean\n args.push \"--no-edge\" if !edge\n args.push \"--tmpdir\" if !tmpdir\n args\n end", "def run_maven\n # Delay till now, in case we were not running on jvm\n require 'rjack-maven'\n\n target = @install_request ? 'install' : 'package'\n\n status = RJack::Maven.launch( [ target ] )\n unless status == 0\n raise \"TARPIT: Maven #{target} failed (exit code: #{status})\"\n end\n\n touch( MVN_STATE_FILE )\n touch( MVN_STATE_FILE_INSTALL ) if @install_request\n end", "def traject_command_line(args = {})\n # Horizon and Solr connection details are looked\n # up by the actual traject config files that we invoke, based on RAILS_ENV.\n # We dont' need to look them up here or include them in command line. \n\n str = \"\"\n if `ruby -v` =~ /jruby/\n puts \"current ruby is jruby, executing with current ruby...\"\n elsif system(\"chruby-exec jruby -- echo\")\n str << \"chruby-exec jruby -- \"\n else\n warn \"No jruby detected, and `chruby-exec jruby` not available either. We need jruby to run traject. Try installing chruby with jruby?\"\n exit 1\n end\n \n str << \" BUNDLE_GEMFILE='./Gemfile' bundle exec \"\n \n str << \"traject -c conf/horizon_source.rb -c conf/horizon_index.rb \"\n\n if args[:mode].to_s == \"solr\"\n str << \" -c conf/solr_connect.rb \"\n else # args[:mode] == marcout\n str << \" -x marcout\"\n\n output_file = args[:output_file] || auto_marcout_filename\n str << \" -o \\\"#{output_file}\\\" \"\n end\n\n # Only it's a normal kind of indexing, do the\n # shelfbrowse side channel index too\n unless ENV['ONLY'] || ENV['FIRST'] || ENV['LAST'] || (args[:mode] != :solr)\n str = \"SHELFBROWSE_TMP_TABLE_SWAP=1 #{str}\"\n str << \" -c conf/shelf_browse_index.rb\"\n end\n\n\n str << \" -s horizon.only_bib=#{ENV['ONLY']} \" if ENV['ONLY']\n str << \" -s horizon.first_bib=#{ENV['FIRST']} \" if ENV['FIRST']\n str << \" -s horizon.last_bib=#{ENV['LAST']} \" if ENV['LAST']\n \n \n return str\nend", "def install\n# Dependency tracking only, uncomment this section only if you know what you\n# are doing!\n#\n# mkdir 'build'\n# cd 'build' do\n# system \"cmake .. #{std_cmake_parameters}\"\n# system \"make package\"\n# end\nend", "def build_cardio()\n CommandProcessor.command(\"VERSION=#{@current_release.version} ./releasinator.sh\", live_output=true)\nend", "def mvn(options)\n run(get_mvn_commandline(options), true)\n end", "def build\n cd_and_sh( pkg_dir, build_commands )\n end", "def build\n if phase.has_key?('build')\n execute(\"build\", phase['build'])\n end\n end", "def script_body(project)\n lines = project.build_script_lines\n\n kit = Tetra::Kit.new(project)\n ant_path = kit.find_executable(\"ant\")\n ant_commandline = Tetra::Ant.commandline(\"$PROJECT_PREFIX\", ant_path)\n\n mvn_path = kit.find_executable(\"mvn\")\n mvn_commandline = Tetra::Mvn.commandline(\"$PROJECT_PREFIX\", mvn_path)\n\n lines.map do |line|\n if line =~ /^ant( .*)?$/\n line.gsub(/^ant/, ant_commandline)\n elsif line =~ /^mvn( .*)?$/\n line.gsub(/^mvn/, \"#{mvn_commandline} -o\")\n else\n line\n end\n end\n end", "def std_cmake_args\n %W[\n -DCMAKE_INSTALL_PREFIX=#{prefix}\n -DCMAKE_BUILD_TYPE=None\n -DCMAKE_FIND_FRAMEWORK=LAST\n -DCMAKE_VERBOSE_MAKEFILE=ON\n -Wno-dev\n ]\n end", "def run_in_build(*args)\n in_build do |source_dir|\n run_command(\"cmake\", \"-G\", select_generator, source_dir) unless File.exist?(\"CMakeCache.txt\")\n args.push(\"cmake\", \"--build\", \".\") if args.empty?\n args.push(\"--target\", $target) if $target\n args.push(\"--config\", $config) if $config\n run_command(*args)\n end\nend", "def build_command_line(tool_config, extra_params, *args)\n @tool_name = tool_config[:name]\n @executable = tool_config[:executable]\n\n command = {}\n\n # basic premise is to iterate top to bottom through arguments using '$' as\n # a string replacement indicator to expand globals or inline yaml arrays\n # into command line arguments via substitution strings\n # executable must be quoted if it includes spaces (common on windows)\n executable = @tool_executor_helper.osify_path_separators( expandify_element(@executable, *args) )\n executable = \"\\\"#{executable}\\\"\" if executable.include?(' ')\n command[:line] = [\n executable,\n extra_params.join(' ').strip,\n build_arguments(tool_config[:arguments], *args),\n ].reject{|s| s.nil? || s.empty?}.join(' ').strip\n\n command[:options] = {\n :stderr_redirect => @tool_executor_helper.stderr_redirection(tool_config, @configurator.project_logging),\n :background_exec => tool_config[:background_exec]\n }\n\n return command\n end", "def build_command(build_type = config.build_type)\n \"ant -f #{project_dir}/#{build_file} #{build_type}\"\n end", "def std_cmake_parameters\n # The None part makes cmake use the environment's CFLAGS etc. settings\n \"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None\"\n end", "def build\n new_resource.exclude_jars.each do |jar|\n exclude_jar(jar, ::File.join(new_resource.path, 'webapp', 'WEB-INF', 'lib'))\n end\n\n execute \"Building JIRA #{new_resource.version} in #{new_resource.path}\" do\n cwd new_resource.path\n command \"./build.sh #{new_resource.targets}\"\n creates new_resource.file\n only_if { node['jira']['build']['enable'] }\n end\nend", "def build_command_line(name, *args)\n executable = (ZTK::Locator.find('bin', name) rescue \"/usr/bin/env #{name}\")\n [executable, args].flatten.compact.join(' ')\n end", "def doit\n # Now call ant task with our selected artifact and options\n classpath = requires.map(&:artifact).map(&:to_s).join(File::PATH_SEPARATOR)\n lambda { ant('thing') { |ant| ant.classpath classpath, :math => options[:math] } }\n\n # We are not a Project instance, hence we have no artifact_ns\n lambda { artifact_ns }.should raise_error(NameError)\n\n # Extension authors may NOT rely project's namespaces.\n # However the ruby-way gives you power and at the same time\n # makes you dangerous, (think open-modules, monkey-patching)\n # Given that buildr is pure ruby, consider it a sharp-edged sword.\n # Having said that, you may actually inspect a project's\n # namespace, but don't write on it without letting your users\n # know you will.\n # This example obtains the current project namespace to make\n # some assertions.\n\n # To obtain a project's namespace we need either\n # 1) a reference to the project, and call artifact_ns on it\n # project.artifact_ns # the namespace for project\n # 2) know the project name\n # Buildr.artifact_ns('the:project')\n # 3) Use :current to reference the currently running project\n # Buildr.artifact_ns(:current)\n name = Buildr.artifact_ns(:current).name\n case name\n when 'foo:bar'\n options[:math].should == :pi\n requires.xmlbeans.version.should == '3.1415'\n requires.stax_api.version.should == '1.0.1'\n when 'foo:baz'\n options[:math].should == :golden\n requires.xmlbeans.version.should == '2.3.0'\n requires.stax_api.version.should == '1.6180'\n else\n fail \"This example expects foo:bar or foo:baz projects not #{name.inspect}\"\n end\n end", "def post_build\n puts '### gulp package ###'\n # tar up the files.\n puts `gulp package 2>&1`\n puts '### gulp package done ###'\n deploy_maven\nend", "def build_site_command(destination=nil, staging_url='')\n config = '_config.staging.yml'\n generate_staging_config(staging_url, config) unless staging_url.empty?\n\n args = []\n args.concat ['--destination', destination] unless destination.nil?\n\n if File.exists? config\n args.concat ['--config', \"_config.yml,#{config}\"]\n end\n\n ['bundle', 'exec', 'jekyll', 'build', *args]\nend", "def cmake(*args)\n env = args.pop if args.last.is_a?(Hash)\n env ||= {}\n\n args += env.map { |k, v| \"#{k}=#{v}\" }\n args.map!(&:to_s)\n\n safesystem 'cmake', *args\n end", "def project(options)\n ARGV << '--help' if ARGV.length == 0\n begin\n OptionParser.new do |opts|\n opts.banner = 'Usage: tm -p PROVIDER [options] project [project_options]'\n opts.separator ''\n opts.separator 'Options:'\n \n opts.on('-C', '--create ATTRIBUTES', 'Create a new project') do |attribute|\n options[:project_attributes] = {attribute => ARGV.shift}.merge(attributes_hash(ARGV))\n options[:subcommand] = 'create'\n end\n \n opts.on('-R', '--read [PROJECT]', 'Read out project and its attributes') do |id|\n options[:project] = id if id\n options[:subcommand] = 'read'\n end\n \n opts.on('-U', '--update ATTRIBUTES', 'Update project information') do |attribute|\n options[:project_attributes] = {attribute => ARGV.shift}.merge(attributes_hash(ARGV))\n options[:subcommand] = 'update'\n end\n \n opts.on('-D', '--destroy [PROJECT]', 'Destroy the project. Not reversible!') do |id|\n options[:project] = id if id\n options[:subcommand] = 'destroy'\n end\n \n opts.on('-I', '--info [PROJECT_ID]', 'Get project info. Same as --read. ') do |id|\n options[:project] = id if id\n options[:subcommand] = 'read'\n end\n \n opts.on('-S', '--search [ATTRIBUTES]', 'Search for a project based on attributes') do |attribute|\n options[:project_attributes] = attribute ? {attribute => ARGV.shift}.merge(attributes_hash(ARGV)) : {}\n options[:subcommand] = 'search'\n end\n \n opts.on('-L', '--list-all', 'List all projects. Same as --search without any parameters') do\n options[:project_attributes] = {}\n options[:subcommand] = 'search'\n end\n \n opts.on('-P', '--project [PROJECT_ID]', 'Set the project id') do |id|\n options[:project] = id\n end\n \n opts.separator ''\n opts.separator 'Other options:'\n \n opts.on_tail('-h', '--help', 'Show this message') do\n puts opts\n exit\n end\n end.order!\n rescue OptionParser::MissingArgument => exception\n puts \"tm #{options[:original_argv].join(' ')}\\n\\n\"\n puts \"Error: An option was called that requires an argument, but was not given one\"\n puts exception.message\n end\n parse_config!(options)\n begin\n require 'ticketmaster'\n require \"ticketmaster-#{options[:provider]}\"\n rescue\n require options[:provider]\n end\n send(options[:subcommand], options)\nend", "def build_files_command\n \"middleman build\"\n end", "def postscript(ant, build_environment, product_directory, *args)\n if repo = config_source[MAVEN_REPO_CONFIG_KEY]\n maven = MavenDeploy.new(:repository_url => repo,\n :repository_id => config_source[MAVEN_REPO_ID_CONFIG_KEY],\n :snapshot => config_source[MAVEN_SNAPSHOT_CONFIG_KEY])\n args.each do |arg|\n next unless arg\n if arg['file']\n file = FilePath.new(product_directory, interpolate(arg['file'])).to_s\n else\n file = FilePath.new(arg['srcfile']).to_s\n end\n\n artifact = arg['artifact']\n version = arg[MAVEN_VERSION_CONFIG_KEY] || config_source[MAVEN_VERSION_CONFIG_KEY] ||\n config_source['version'] || build_environment.version\n maven.deploy_file(file, artifact, version, arg['pom'])\n end\n end\n end", "def command(arguments, options = nil)\n force = (options&.force == true)\n\n project_name = Array(arguments).first\n raise 'missing project argument' unless project_name\n\n project = Project.new(project: project_name)\n folder = ProjectFolder.new project\n folder.ensure_exists\n\n summary = ask 'Project summary? '\n # TODO: This method of setting a default doesn't work in the unit tests, yet we do this elsewhere. Investigate.\n # summary = Settings.console.ask 'Project summary?' do |answer|\n # answer.default = 'undefined'\n # end\n\n npc_parameters = NpcParameters.new(folder, force, summary)\n generate_log_file(npc_parameters)\n end", "def my_post_build_step\n puts 'post-build step!'\nend", "def build_css_and_js_for_drupal\n puts '- Building CSS and JS for Drupal...'\n\n run_npm_command('npm install',\"Failed to run 'npm install'. Do you have npm installed?\")\n run_npm_command('$(npm bin)/gulp', 'Failed to run Gulp to build CSS and JS for Drupal')\n\n puts '- Successfully built CSS and JS for Drupal'\nend", "def cabal(arg)\n arg.with_defaults(:dev => 'dev')\n if arg[:dev] == 'prod'\n 'cabal'\n else\n 'cabal-dev'\n end\n end", "def compile_project\n debug_msg \" compiling #{@project_name}\"\n system(HHC_PATH, @project_name)\n end", "def build_e2e_test_execution_cmd(test_configuration)\n run_tests_command = ''\n # bind environment variable for base url to be used in e2e base config.\n Kernel.abort('Please specify a base url. For example --base-url=http://foo.com') if test_configuration[:base_url].nil?\n bind_environment_variable('RHD_BASE_URL', test_configuration[:base_url])\n bind_environment_variable('RHD_TEST_CONFIG', 'docker') if test_configuration[:docker]\n bind_environment_variable('RHD_TEST_CONFIG', 'browserstack') if test_configuration[:browserstack]\n bind_environment_variable('RHD_TEST_PROFILE', test_configuration[:profile]) if test_configuration[:profile]\n bind_environment_variable('RHD_CHIMP_TAGS', test_configuration[:cucumber_tags]) if test_configuration[:cucumber_tags]\n\n run_tests_command += \"--baseUrl=#{test_configuration[:base_url]}\"\n if test_configuration[:docker]\n # for running tests inside of docker\n test_configuration[:browser_count] = 1 if test_configuration[:browser_count].nil?\n test_configuration[:run_tests_command] = \"npm test -- #{run_tests_command}\"\n else\n # run tests via a local browser\n test_configuration[:run_tests_command] = \"cd #{@test_dir}/e2e && npm test -- #{run_tests_command}\"\n end\n end", "def autorun_cmd(repo_name)\n [\"cp -Rf #{STARTDIR}/components/autogen/#{repo_name}/* .\",\n \"touch Makefile\"]\nend", "def build_site_command(destination=nil)\n staging_config_file = '_config.staging.yml'\n args = []\n args.concat ['--destination', destination] unless destination.nil?\n\n if File.exists? staging_config_file\n args.concat ['--config', \"_config.yml,#{staging_config_file}\"]\n end\n\n ['bundle', 'exec', 'jekyll', 'build', *args]\nend", "def build_snapshot\n build_dependency\n puts '### dev build ###'\n puts `gulp 2>&1`\n puts '### dev build done ###'\n post_build\nend", "def install\n system \"cmake\", \"-S\", \".\", \"-B\", \"build\", *std_cmake_args\n system \"cmake\", \"--build\", \"build\"\n system \"cmake\", \"--install\", \"build\"\n end", "def build_command(version, prerelease = false, download_path = nil)\n command = \"curl -sL #{OMNITRUCK} | sudo bash\"\n\n if prerelease || version != :latest || download_path != nil\n command << \" -s --\"\n end\n\n if prerelease\n command << \" -p\"\n end\n\n if version != :latest\n command << \" -v \\\"#{version}\\\"\"\n end\n\n if download_path\n command << \" -d \\\"#{download_path}\\\"\"\n end\n\n command\n end", "def project=(_arg0); end", "def maven_repository_path\n command = \"#{package_management_command} help:evaluate -Dexpression=settings.localRepository -q -DforceStdout\"\n command += \" #{@maven_options}\" unless @maven_options.nil?\n stdout, stderr, status = Dir.chdir(project_path) { Cmd.run(command) }\n raise \"Command '#{command}' failed to execute: #{stderr}\" unless status.success?\n\n Pathname(stdout)\n end", "def create_project(args)\n system %{#{bin} create #{args.join(' ')}}\n end", "def run_build(workspace, scheme, destination)\n # build using xcpretty as otherwise it's very verbose when running tests\n return system(\"xcodebuild -workspace #{workspace} -scheme '#{scheme}' -destination '#{destination}' build | xcpretty; exit ${PIPESTATUS[0]}\")\nend", "def method_missing(m)\n\n case m\n when :createproj\n @args[:projectdir] = @options[m]\n @args[m] = true\n \n when :quickpkg\n # raise BoilerMakerErr.new(\"Option -Q: This option is unimplemented.\") \n @args[m] = @options[:quickpkg]\n \n when :projectdir\n unless @options[:createproj] or @options[:tconvert] or @options[:fetch] or @options[:package] or @options[:boil] or @options[:rollup]\n raise BoilerMakerErr.new(\"Option --#{m}: This flag is only useful when combined with: -C, -t, -f or -p\") \n end\n @args[m] = File.expand_path(@options[m])\n unless @options[:createproj]\n raise BoilerMakerErr.new(\"No such file or dir: #{@args[m]}\") unless File.exists?(@args[m])\n end\n \n when :ktcheck\n if @options[:createproj] or @options[:projectdir] or @options[:tconvert] or @options[:fetch]\n raise BoilerMakerErr.new(\"Option --#{m}: This flag is only useful when combined with: -c, -h or -w\") \n end\n raise BoilerMakerErr.new(\"Option --#{m}: Use the -h to specify a Radmind server host\") unless @options[:radhost]\n @args[m] = @options[m]\n \n when :tconvert\n @args[m] = File.expand_path(@options[m])\n raise BoilerMakerErr.new(\"No such file or dir: #{@args[m]}\") unless File.exists?(@args[m])\n \n when :fetch\n raise BoilerMakerErr.new(\"Option --#{m}: Use the -h to specify a Radmind server host\") unless @options[:radhost]\n @args[m] = File.expand_path(@options[m])\n raise BoilerMakerErr.new(\"No such file or dir: #{@args[m]}\") unless File.exists?(@args[m])\n \n when :radhost\n unless @options[:ktcheck] or @options[:fetch]\n raise BoilerMakerErr.new(\"Option --#{m}: This flag is only useful when combined with: -K or -f\") \n end\n @args[m] = @options[m]\n\n when :boil\n @args[m] = @options[m]\n \n when :package\n @args[m] = @options[m]\n\n when :rollup\n @args[m] = @options[m]\n \n when :secure\n unless @options[:ktcheck] or @options[:fetch]\n raise BoilerMakerErr.new(\"Option --#{m}: This flag is only useful when combined with: -K or -f\")\n end\n @args[m] = @options[m]\n\n when :cksum\n unless @options[:ktcheck] or @options[:fetch]\n raise BoilerMakerErr.new(\"Option --#{m}: This flag is only useful when combined with: -K or -f\")\n end\n @args[m] = @options[m]\n \n end\n \n end", "def build_release\n build_dependency\n puts '### release build ###'\n `gulp release`\n puts '### release build done ###'\n post_build\nend", "def define_maven_tasks\n from_assembly = ( spec.maven_strategy == :jars_from_assembly )\n do_maven = from_assembly || spec.jars.size > 0\n\n define_maven_package_task if do_maven\n\n if do_maven || spec.generated_files\n define_manifest_task\n task( :manifest => [ MVN_STATE_FILE ] ) if from_assembly\n end\n\n define_post_maven_tasks if do_maven\n end", "def run_project(options={}, *package_names)\n options = {\n 'ssh_config_file' => ssh_config_file,\n 'project_dir' => method_dir,\n 'remote_dir' => remote_dir,\n 'quiet' => true,\n }.merge(options)\n \n linecook('run', options, *package_names)\n end", "def mvn\n ret = @uri.mvn\n render plain: ret[:message], status: ret[:status]\n end", "def build(rakeTask)\n\t\tprintAndCall(@cmd)\n\tend", "def strip bash_script\n @notfound = [] # collecting poms not found\n script = File.open(bash_script, \"w+\")\n raise \"Can't open #{bash_script}\" unless script\n # for each .jar in @m2dir do\n # check if .pom exists\n # read .pom\n # find corresponding entry in maven universe\n # write entry to bash scrip\n # done\n puts \"Looking in #{@m2dir}\" if @verbose\n script.puts \"mkdir -p kit\"\n script.puts \"cd kit\"\n kitdir = File.dirname @m2dir\n # find ant\n # find maven\n # find gradle\n Dir.foreach(kitdir) do |name|\n case name\n when /apache-ant-(\\d+\\.\\d+.\\d+)/\n version = $1\n STDERR.puts \"ant version #{version}\"\n script.puts \"wget https://archive.apache.org/dist/ant/binaries/apache-ant-#{version}-bin.tar.bz2\"\n script.puts \"tar xf apache-ant-#{version}-bin.tar.bz2\"\n script.puts \"rm -f apache-ant-#{version}-bin.tar.bz2\"\n when /apache-maven-(\\d+\\.\\d+.\\d+)/\n version = $1\n STDERR.puts \"maven version #{version}\"\n script.puts \"wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/#{version}/apache-maven-#{version}-bin.tar.gz\"\n script.puts \"tar xf apache-maven-#{version}-bin.tar.gz\"\n script.puts \"rm -f apache-maven-#{version}-bin.tar.gz\"\n when \"jars\", \"m2\", \".\", \"..\", \".keep\"\n # skip\n else\n STDERR.puts \"\\e[33mUnknown #{kitdir}/#{name}\\e[0m\"\n end\n end\n script.puts \"mkdir -p m2\"\n script.puts \"cd m2\"\n been_there = []\n Dir.chdir(@m2dir) do |d|\n Dir.glob(\"**/*.{jar,pom,signature}\") do |f|\n dir = File.dirname(f)\n# puts \"found #{f} in #{dir}\"\n next if been_there.include? dir\n handle_dir dir, f, script\n been_there << dir\n end\n end\n script.puts \"cd ..\"\n script.puts \"cd ..\"\n @notfound.each do |pom|\n STDERR.puts \"*** Pom not found: #{pom}\"\n end\n end", "def create_project( project_dir, git_enabled )\n if !File.directory? project_dir\n print \"Creating project dir...\"\n Dir.mkdir project_dir\n Dir.chdir project_dir\n File.open( 'README', 'w' ) do |file|\n file.puts \"README for the #{project_dir} project.\"\n file.puts ''\n file.puts \"This is just a place holder. Add your own content here.\"\n end\n print \"Done\"\n else\n puts \"Directory for #{project_name} already exists!\"\n end\n\n puts ''\n\n if git_enabled == '--git'\n puts \"Creating Git repo...\"\n if !File.directory? '.git'\n system( 'git init && git add . && git commit -m \"first commit\" -a' )\n end\n puts \"Done\"\n end\n\n puts ''\n \n puts \"Finished setting up your project!\"\nend", "def add_standard_buildr_tasks\n add_standard_bundler_tasks\n desc 'Download all artifacts application if buildfile'\n command(:buildr_artifacts) do\n if File.exist?('buildfile')\n begin\n rbenv_exec('buildr artifacts:sources artifacts clean')\n rescue\n # ignored\n end\n end\n end\n\n desc 'Propose an update to dependency for all downstream projects in a automerge branch. Specify parameters DEPENDENCIES and VERSION'\n command(:propose_dependency_update, :in_app_dir => false) do |app|\n dependencies = Zim::Config.parameter_by_name('DEPENDENCIES').split(',')\n target_version = Zim::Config.parameter_by_name('VERSION')\n branch_key = Zim::Config.parameters['BRANCH_KEY'] || ''\n\n run(:real_clean, app)\n in_app_dir(app) do\n branches = (Zim.current_suite.application_by_name(app).tag_value('zim:branches') || current_default_branch).split(',')\n branches.each do |branch|\n git_checkout(branch)\n propose_dependency_update(app, branch_key, dependencies, target_version, branch)\n end\n end\n end\n end", "def build_blc_test_execution_cmd(test_configuration)\n run_tests_command = ''\n run_tests_command += \" -c #{test_configuration[:config]}\" if test_configuration[:config]\n run_tests_command += \" -u #{test_configuration[:base_url]}\" if test_configuration[:base_url]\n run_tests_command += \" -s #{test_configuration[:single_url]}\" if test_configuration[:single_url]\n run_tests_command += ' --ignore-internal' if test_configuration[:ignore_internal]\n run_tests_command += ' --ignore-external' if test_configuration[:ignore_external]\n run_tests_command += ' --ignore-ssl' if test_configuration[:ignore_ssl]\n run_tests_command += ' -v' if test_configuration[:verbose]\n test_configuration[:run_tests_command] = \"bundle exec blinkr#{run_tests_command}\"\n end", "def build_blc_test_execution_cmd(test_configuration)\n run_tests_command = ''\n run_tests_command += \" -c #{test_configuration[:config]}\" if test_configuration[:config]\n run_tests_command += \" -u #{test_configuration[:base_url]}\" if test_configuration[:base_url]\n run_tests_command += \" -s #{test_configuration[:single_url]}\" if test_configuration[:single_url]\n run_tests_command += ' --ignore-internal' if test_configuration[:ignore_internal]\n run_tests_command += ' --ignore-external' if test_configuration[:ignore_external]\n run_tests_command += ' --ignore-ssl' if test_configuration[:ignore_ssl]\n run_tests_command += ' -v' if test_configuration[:verbose]\n test_configuration[:run_tests_command] = \"bundle exec blinkr#{run_tests_command}\"\n end", "def install\n args = std_cmake_args\n system \"cmake\", \".\", *args\n system \"make install\"\n end", "def create_project(invocation_path, arg_app_name, quiet = false, gem_path = nil)\n root_path = File.join(invocation_path, arg_app_name)\n FileUtils.mkpath(root_path)\n puts \"(in #{invocation_path})\" unless quiet\n puts \" created directory: #{arg_app_name}\" unless quiet\n create_app_structure(root_path, arg_app_name, quiet, gem_path)\n puts '' unless quiet\n puts 'Done!' unless quiet\n\n root_path\n end", "def locs_cmd\n author = `git config user.name`.strip\n if author != ''\n author_modifier = \"--author '#{author}'\"\n end\n \n project = `echo $(find . -name *.xcworkspace)`.strip\n if project != ''\n project = project.split('/')[1].split('.').first\n project_modifier = \"--project '#{project}'\"\n end\n \n cmd = \"./scripts/locs #{author_modifier} #{project_modifier}\"\nend", "def custom\n Athenry::build.target(\"install_pkgmgr\", \"update_everything\", \"rebuild\", \"update_configs\", \"install_overlays\", \"install_sets\", \"rebuild\")\n end", "def run(argv)\n # parse and analyze the command line\n options = Trollop::with_standard_exception_handling @args_parser do\n opts = @args_parser.parse(argv)\n\n raise Trollop::CommandlineError.new \"Too many arguments\" if argv.length > 1\n \n opts\n end\n \n path = (argv.shift or '.')\n \n Dir.chdir(path) do\n #include CRake\n load(options.input)\n end\n \n code = gen_cmake_code\n \n puts code # tem for debugging\n \n write_cmake_lists\n \n puts 'Calling CMake...'\n call_cmake\n end", "def build_dcp_test_execution_cmd(test_configuration)\n run_tests_command = ''\n run_tests_command += \" --config #{test_configuration[:config]}\" if test_configuration[:config]\n run_tests_command += \" --base-url=#{test_configuration[:base_url]}\" if test_configuration[:base_url]\n test_configuration[:run_tests_command] = \"bundle exec dcp-checker#{run_tests_command}\"\n end", "def build(scheme, sdk, destination, action)\n puts <<-ANNOUNCE\n =============================\n | Action: #{action} \n | Scheme: \"#{scheme}\"\n | #{destination}\n =============================\n\n ANNOUNCE\n\n cmd = %W(\n xcodebuild\n -project OHHTTPStubs/OHHTTPStubs.xcodeproj\n -scheme \"#{scheme}\"\n -sdk #{sdk}\n -configuration Release\n ONLY_ACTIVE_ARCH=NO\n -destination '#{destination}'\n #{action}\n )\n\n sh \"set -o pipefail && #{cmd.join(' ')} | xcpretty -c\"\nend", "def base_commands(dir, env = {})\n artifact_cache_dir = File.join(@job.project.repository.repo_cache_dir, \"artifacts\")\n FileUtils.mkdir_p(artifact_cache_dir)\n env[:CACHE_DIR] = artifact_cache_dir\n\n commands = env.map do |key, value|\n \"export #{key}=#{value.to_s.shellescape}\"\n end\n\n [\"cd #{dir}\"].concat commands\n end", "def install_command_vars_for_bourne\n flags = %w{latest true nightlies}.include?(version) ? \"\" : \"-v #{CGI.escape(version)}\"\n flags << \" \" << \"-n\" if nightlies\n flags << \" \" << \"-p\" if prerelease\n flags << \" \" << install_flags if install_flags\n\n [\n shell_var(\"chef_omnibus_root\", root),\n shell_var(\"chef_omnibus_url\", omnibus_url),\n shell_var(\"install_flags\", flags.strip),\n shell_var(\"pretty_version\", Util.pretty_version(version)),\n shell_var(\"sudo_sh\", sudo(\"sh\")),\n shell_var(\"version\", version),\n ].join(\"\\n\")\n end", "def run(options)\n raise ArgumentError, 'Please give a name to the project.' unless options[:name]\n\n case options[:command]\n when 'new'\n project_details = define_project(options)\n\n project_command = Mvnizer::Command::ProjectFactory.create(project_details.type)\n project_command.run(project_details)\n out.puts(\"Project #{project_details.artifact_id} created successfully.\")\n when 'search'\n search_command = Command::SearchArtefact.new\n search_command.run(options)\n when 'add'\n add_command = Command::AddDependency.new\n add_command.run(options)\n else\n raise ArgumentError, \"#{options[:command]} is not a valid command.\"\n end\n end", "def build_gem; end", "def process_arguments(args)\n begin\n args.keys.sort.each do |k,v|\n case k\n when :quickpkg\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotdevtools?\n raise BoilerMakerErr.new(MSG_NO_DEVTOOLS)\n exit $!\n end\n unless Boilermaker.gothdiutil? \n raise BoilerMakerErr.new(MSG_NO_HDIUTIL)\n exit $!\n end\n project = QuickPkg.new(args)\n # pp project.vars\n project.prep(args)\n project.build(args)\n when :createproj\n project = PkgProj.new(args)\n project.prep\n when :ktcheck\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotradmind? \n raise BoilerMakerErr.new(MSG_NO_RADMIND)\n exit $!\n end\n Radmind.updateK(args)\n when :tconvert\n Radmind.convert(args)\n when :fetch\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotradmind? \n raise BoilerMakerErr.new(MSG_NO_RADMIND)\n exit $!\n end \n Radmind.fetch(args)\n when :boil\n project = PkgProj.new(args)\n project.boil\n when :rollup\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gothdiutil? \n raise BoilerMakerErr.new(MSG_NO_HDIUTIL)\n exit $!\n end\n project = PkgProj.new(args)\n project.rollup\n when :package\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotdevtools?\n raise BoilerMakerErr.new(MSG_NO_DEVTOOLS)\n exit $!\n end\n project = PkgProj.new(args)\n project.package(args)\n end\n end\n rescue => error\n puts error.message + \"\\n\"\n exit 1\n end\n \n end", "def install\n system \"cmake\", \".\", *std_cmake_args\n system \"make\", \"install\"\n end", "def build()\n workspace = @configuration.workspace\n scheme = @configuration.scheme\n target = @configuration.target\n project = @configuration.project\n xctool = @configuration.xctool_path\n \n building = workspace\n building = project if workspace.nil?\n \n GALogger.log(\"Building \" + building + \" with scheme \" + scheme + \"...\")\n \n toBuild = buildArgument()\n buildSucceeded = system(\"xcodebuild\" + toBuild + \n ' -scheme ' + scheme +\n ' -sdk iphonesimulator' +\n ' test | xcpretty -tc', out: $stdout, err: :out)\n \n if buildSucceeded\n GALogger.log('Tests are fine. Start coding :)', :Success)\n else\n GALogger.log('Tests failed. Fix them before you start iterating.', :Error)\n end\n end", "def create\n name = shift_argument\n unless name\n error(\"Usage: mortar projects:create PROJECTNAME\\nMust specify PROJECTNAME\")\n end\n\n args = [name,]\n is_public = false \n if options[:public]\n is_public= true\n ask_public(is_public)\n end \n validate_project_name(name)\n project_id = register_api_call(name,is_public) \n Mortar::Command::run(\"generate:project\", [name])\n FileUtils.cd(name)\n is_embedded = false\n if options[:embedded]\n is_embedded = true\n register_do(name, is_public, is_embedded, project_id)\n else\n git.git_init\n git.git(\"add .\")\n git.git(\"commit -m \\\"Mortar project scaffolding\\\"\") \n register_do(name, is_public, is_embedded, project_id)\n display \"NOTE: You'll need to change to the new directory to use your project:\\n cd #{name}\\n\\n\"\n end\n end", "def globalSetup()\n # Build\n run(\"cd '#{Embedding::CODE_PATH}' && make clean && make\")\nend", "def build_source(source, target, echo, custom)\n verbose(VERBOSE)\n flags = \"\"\n cc = \"\"\n own_include = \"\"\n\n if LANGUAGE == \"c\" then\n flags = CFLAGS\n cc = CC\n else\n flags = CXXFLAGS\n cc = CXX\n end\n\n path = File.dirname(target)\n if not File.exists? path then\n cmd \"mkdir -p #{path}\"\n end\n\n if echo\n if ENV['silent'] != \"true\" and DRYRUN != true then\n msg \"src #{C_NORMAL}#{source}\"\n end\n end\n\n if defined? ADD_OWN_INCLUDE and ADD_OWN_INCLUDE == true then\n own_include = \"-Iinclude\"\n end\n\n cc_command = \"#{COMPILER} -c #{flags.join(\" \")} #{custom} #{DEFINE.map {|d| \"-D\" + d}.join(\" \")} #{own_include} #{INCLUDE.map {|i| \"-I\" + corto_replace(i)}.join(\" \")} #{source} -o #{target}\"\n begin\n cmd cc_command\n rescue\n STDERR.puts \"\\033[1;31mcorto:\\033[0;49mcorto: command failed: #{cc_command}\"\n abort\n end\nend", "def generate\n $VERBOSE = !options[:verbose].nil?\n name = shift_argument || generate_app_name\n project_dir = \"#{CURR_DIR}/#{name}\"\n overwrite = !options[:overwrite].nil?\n if File.directory? project_dir\n if overwrite\n FileUtils.rm_r project_dir\n else\n if confirm \"Project #{name} already exists. Should I replace it?\"\n if confirm \"This will delete ALL existing files. Are you ABSOLUTELY sure?\"\n FileUtils.rm_r project_dir\n else \n return\n end\n else\n return\n end\n end\n end\n version = options[:version]\n version = DEF_OBD_VERSION if version == nil\n unless OK_OBD_VERSIONS.include?(version)\n throw \"Specified version \\\"#{version}\\\" isn't supported.\\nTry one of the following:\\n #{OK_OBD_VERSIONS.join(\"\\n \")}\"\n end\n rebuild = !options[:rebuild].nil?\n full_engine = !options[:full_engine].nil?\n no_git = !options[:no_git].nil?\n download_openbd(version, rebuild)\n update_project(name, version, full_engine, false, false)\n put_into_git(name) unless no_git or ENV['OPENBD_HEROKU_NO_GIT']\n display \"-----> Project '#{name}' created successfully.\\nType 'cd #{name}' to change to your project folder.\\nType 'foreman start' to run the server locally\"\n end", "def args_builder_common(opts)\n gcovr_opts = get_opts(opts)\n\n args = \"\"\n args += \"--root \\\"#{gcovr_opts[:report_root] || '.'}\\\" \"\n args += \"--config \\\"#{gcovr_opts[:config_file]}\\\" \" unless gcovr_opts[:config_file].nil?\n args += \"--filter \\\"#{gcovr_opts[:report_include]}\\\" \" unless gcovr_opts[:report_include].nil?\n args += \"--exclude \\\"#{gcovr_opts[:report_exclude] || GCOV_FILTER_EXCLUDE}\\\" \"\n args += \"--gcov-filter \\\"#{gcovr_opts[:gcov_filter]}\\\" \" unless gcovr_opts[:gcov_filter].nil?\n args += \"--gcov-exclude \\\"#{gcovr_opts[:gcov_exclude]}\\\" \" unless gcovr_opts[:gcov_exclude].nil?\n args += \"--exclude-directories \\\"#{gcovr_opts[:exclude_directories]}\\\" \" unless gcovr_opts[:exclude_directories].nil?\n args += \"--branches \" if gcovr_opts[:branches].nil? || gcovr_opts[:branches] # Defaults to enabled.\n args += \"--sort-uncovered \" if gcovr_opts[:sort_uncovered]\n args += \"--sort-percentage \" if gcovr_opts[:sort_percentage].nil? || gcovr_opts[:sort_percentage] # Defaults to enabled.\n args += \"--print-summary \" if gcovr_opts[:print_summary]\n args += \"--gcov-executable \\\"#{gcovr_opts[:gcov_executable]}\\\" \" unless gcovr_opts[:gcov_executable].nil?\n args += \"--exclude-unreachable-branches \" if gcovr_opts[:exclude_unreachable_branches]\n args += \"--exclude-throw-branches \" if gcovr_opts[:exclude_throw_branches]\n args += \"--use-gcov-files \" if gcovr_opts[:use_gcov_files]\n args += \"--gcov-ignore-parse-errors \" if gcovr_opts[:gcov_ignore_parse_errors]\n args += \"--keep \" if gcovr_opts[:keep]\n args += \"--delete \" if gcovr_opts[:delete]\n args += \"-j #{gcovr_opts[:num_parallel_threads]} \" if !(gcovr_opts[:num_parallel_threads].nil?) && (gcovr_opts[:num_parallel_threads].is_a? Integer)\n\n [:fail_under_line, :fail_under_branch, :source_encoding, :object_directory].each do |opt|\n unless gcovr_opts[opt].nil?\n\n value = gcovr_opts[opt]\n if (opt == :fail_under_line) || (opt == :fail_under_branch)\n if not value.is_a? Integer\n puts \"Option value #{opt} has to be an integer\"\n value = nil\n elsif (value < 0) || (value > 100)\n puts \"Option value #{opt} has to be a percentage from 0 to 100\"\n value = nil\n end\n end\n args += \"--#{opt.to_s.gsub('_','-')} #{value} \" unless value.nil?\n end\n end\n\n return args\n end", "def new_project \n require 'fileutils'\n dir = \"./\" + @arguments.first\n Dir.mkdir(dir)\n %w[app config experiments report results test tmp vendor].each do |d|\n Dir.mkdir(dir + \"/\" + d)\n end\n basedir = File.dirname(__FILE__)\n File.open(File.join(dir, \"config\", \"config.yaml\"), \"w\") do |f|\n f << \"---\\nenvironments:\\n development:\\n compute:\\n\"\n end\n File.open(File.join(dir, \".gitignore\"), \"w\") do |f|\n f << \"tmp/*\"\n end\n FileUtils::cp File.join(basedir, \"generator/readme_template.txt\"), File.join(dir, \"README\")\n FileUtils::cp File.join(basedir, \"generator/Rakefile\"), File.join(dir, \"Rakefile\")\n FileUtils::cp File.join(basedir, \"generator/experiment_template.rb.txt\"), File.join(dir, \"experiments\", \"experiment.rb\")\n end", "def create_android\n puts \"Creating Android project\"\n `android create project -t #{ @target } -k #{ @pkg } -a #{ @name } -n #{ @name.gsub(' ','') } -p #{ @output_dir }`\n end", "def pom_xml\n if self.buildr_project\n Buildr::CustomPom.pom_xml(self.buildr_project, self)\n else\n Proc.new do\n xml = Builder::XmlMarkup.new(:indent => 2)\n xml.instruct!\n xml.project do\n xml.modelVersion '4.0.0'\n xml.groupId group\n xml.artifactId id\n xml.version version\n xml.classifier classifier if classifier\n end\n end\n end\n end", "def run_all\n \n projects.each do |project|\n project.targets.each do |target|\n config = target.config('Debug')\n UI.info((\"*\" * 80))\n UI.info \"Building #{project.name} - #{target.name} - #{config.name}\"\n UI.info((\"*\" * 80))\n config.builder.build\n end\n end\n \n end", "def compile\n read_yml if File.exists?(@project)\n\n default_options = {}\n other_options = {}\n\n @compile_options.each do |k,v| \n if /default/.match(k)\n default_options[k] = v\n else\n other_options[k] = v\n end\n end\n\n command = \"#{@flex_sdk_bin}#{@compiler}\"\n other_options.each { |k,v| command += \" -#{k}=\\\"#{[v].flatten.join ','}\\\"\" }\n default_options.each { |k,v| command += \" -#{k}=\\\"#{[v].flatten.join ','}\\\"\" }\n command += \" #{@document_class}.as\"\n\n# puts command\n# TextMate.exit_show_html\n\n @command = command\n#TextMate.exit_show_html\n if process_output command\n# load_debugger\n display_web_player #unless ARGV[0] = \"--display\"\n# display_player\n end\nend", "def define_maven_package_task\n [ MVN_STATE_FILE, MVN_STATE_FILE_INSTALL ].each do |sf|\n file sf => maven_dependencies do\n run_maven\n end\n end\n\n task :install => MVN_STATE_FILE_INSTALL\n end", "def build_project(go)\n content = {\n \"active\" => true,\n \"path\" => BASEDIR + \"/#{go}\"\n }\n return content\n end", "def create_android\n `android create project -t 5 -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`\n end", "def run\n program :version, AppRepo::VERSION\n program :description, AppRepo::DESCRIPTION\n program :help, 'Author', 'Matej Sychra <suculent@me.com>'\n program :help, 'Website', 'https://github.com/suculent/apprepo'\n program :help, 'GitHub', 'https://github.com/suculent/apprepo/tree/master/apprepo'\n program :help_formatter, :compact\n\n generator = FastlaneCore::CommanderGenerator.new\n generator.generate(AppRepo::Options.available_options)\n\n global_option('--verbose') { $verbose = true }\n\n always_trace!\n\n command :run do |c|\n c.syntax = 'apprepo'\n c.description = 'Upload IPA and metadata to SFTP (e.g. AppRepo)'\n c.action do |_args, options|\n config = FastlaneCore::Configuration\n available_opts = AppRepo::Options.available_options\n options = config.create(available_opts, options.__hash__)\n loaded = options.load_configuration_file('Repofile')\n loaded = true if options[:repo_description] || options[:ipa]\n\n unless loaded\n UI.message('[AppRepo::CommandsGenerator] configuration file not loaded')\n if UI.confirm('No Repofile found. Do you want to setup apprepo?')\n require 'apprepo/setup'\n AppRepo::Setup.new.run(options)\n return 0\n end\n end\n\n AppRepo::Runner.new(options).run\n end\n end\n\n command :download_manifest do |c|\n c.syntax = 'apprepo download_manifest'\n c.description = 'Download metadata only'\n c.action do |_args, options|\n config = FastlaneCore::Configuration\n available_opts = AppRepo::Options.available_options\n options = config.create(available_opts, options.__hash__)\n options.load_configuration_file('Repofile')\n AppRepo::Runner.new(options).download_manifest\n end\n end\n\n command :submit do |c|\n c.syntax = 'apprepo submit'\n c.description = 'Submit a specific build-nr, use latest.'\n c.action do |_args, options|\n config = FastlaneCore::Configuration\n available_opts = AppRepo::Options.available_options\n options = config.create(available_opts, options.__hash__)\n options.load_configuration_file('Repofile')\n AppRepo::Runner.new(options).run\n end\n end\n\n command :init do |c|\n c.syntax = 'apprepo init'\n c.description = 'Create the initial `apprepo` configuration'\n c.action do |_args, options|\n if File.exist?('Repofile') || File.exist?('fastlane/Repofile')\n UI.important('You already got a running apprepo setup.')\n return 0\n end\n\n require 'apprepo/setup'\n config = FastlaneCore::Configuration\n available_opts = AppRepo::Options.available_options\n options = config.create(available_opts, options.__hash__)\n AppRepo::Runner.new(options)\n AppRepo::Setup.new.run(options)\n end\n end\n\n # rubocop:enable Metrics/AbcSize\n # rubocop:enable Metrics/MethodLength\n\n default_command :run\n\n run!\n end", "def new_shell_script_build_phase(name = nil)\n phase = project.new(PBXShellScriptBuildPhase)\n phase.name = name\n build_phases << phase\n phase\n end", "def build\n CircleCi.request(@conf, \"/project/#{username}/#{project}\").post\n end", "def configure_args\n @args = {}\n OptionParser.new do |opt|\n opt.on('-c', '--configure STRING', String) { |arg| push_arg_if_present( \"configure\", arg, \"boolean\") }\n opt.on('-d', '--deploy STRING', String) { |arg| push_arg_if_present( \"deploy\", arg, \"boolean\") }\n opt.on('-on', '--org_name STRING', String) { |arg| push_arg_if_present( \"org_name\", arg, \"string\") }\n opt.on('-od', '--org_desc STRING', String) { |arg| push_arg_if_present( \"org_desc\", arg, \"string\") }\n opt.on('-cd', '--contact_desc STRING', String) { |arg| push_arg_if_present( \"contact_desc\", arg, \"string\") }\n opt.on('-odo', '--org_domain STRING', String) { |arg| push_arg_if_present( \"org_domain\", arg, \"string\") }\n opt.on('-oe', '--org_email STRING', String) { |arg| push_arg_if_present( \"org_email\", arg, \"string\") }\n opt.on('-op', '--org_phone STRING', String) { |arg| push_arg_if_present( \"org_phone\", arg, \"string\") }\n opt.on('-of', '--org_facebook STRING', String) { |arg| push_arg_if_present( \"org_facebook\", arg, \"string\") }\n opt.on('-ot', '--org_twitter STRING', String) { |arg| push_arg_if_present( \"org_twitter\", arg, \"string\") }\n opt.on('-oi', '--org_instagram STRING', String) { |arg| push_arg_if_present( \"org_instagram\", arg, \"string\") }\n opt.on('-ow', '--org_website STRING', String) { |arg| push_arg_if_present( \"org_website\", arg, \"string\") }\n opt.on('-cp', '--color_primary STRING', String) { |arg| push_arg_if_present( \"color_primary\", arg, \"string\") }\n opt.on('-cs', '--color_secondary STRING', String) { |arg| push_arg_if_present( \"color_secondary\", arg, \"string\") }\n opt.on('-l', '--logo STRING', String) { |arg| push_arg_if_present( \"logo\", arg, \"string\") }\n opt.on('-lo', '--logo_option STRING', String) { |arg| push_arg_if_present( \"logo_option\", arg, \"string\") }\n opt.on('-su', '--smtp_username STRING', String) { |arg| push_arg_if_present( \"smtp_username\", arg, \"string\") }\n opt.on('-sp', '--smtp_password STRING', String) { |arg| push_arg_if_present( \"smtp_password\", arg, \"string\") }\n opt.on('-sa', '--smtp_address STRING', String) { |arg| push_arg_if_present( \"smtp_address\", arg, \"string\") }\n opt.on('-so', '--smtp_port STRING', String) { |arg| push_arg_if_present( \"smtp_port\", arg, \"integer\") }\n opt.on('-as', '--account_sid STRING', String) { |arg| push_arg_if_present( \"account_sid\", arg, \"string\") }\n opt.on('-at', '--auth_token STRING', String) { |arg| push_arg_if_present( \"auth_token\", arg, \"string\") }\n opt.on('-ae', '--admin_email STRING', String) { |arg| push_arg_if_present( \"admin_email\", arg, \"string\") }\n opt.on('-ap', '--admin_password STRING', String) { |arg| push_arg_if_present( \"admin_password\", arg, \"string\") }\n opt.on('-af', '--admin_first_name STRING', String) { |arg| push_arg_if_present( \"admin_first_name\", arg, \"string\") }\n opt.on('-al', '--admin_last_name STRING', String) { |arg| push_arg_if_present( \"admin_last_name\", arg, \"string\") }\n opt.on('-hc', '--heroku_command STRING', String) { |arg| push_arg_if_present( \"heroku_command\", arg, \"string\") }\n opt.on('-ha', '--heroku_app_name STRING', String) { |arg| push_arg_if_present( \"heroku_app_name\", arg, \"string\") }\n opt.on('-sn', '--form_name STRING', String) { |arg| push_arg_if_present( \"form_name\", arg, \"string\") }\n opt.on('-f', '--faq STRING', String) { |arg| push_arg_if_present( \"faq\", arg, \"yml\") }\n opt.on('-s', '--form STRING', String) { |arg| push_arg_if_present( \"form\", arg, \"yml\") }\n end.parse!\nend", "def generate_settings(cmdline, configuration)\n loaded = YAML::load(configuration)\n\n if loaded[:properties].nil?\n loaded[:properties] = {}\n end\n\n unless cmdline['--pattern'].nil? \n loaded[:vcs][:release_regex] = input['--pattern']\n end\n\n #User name override\n if cmdline['-c']\n (0..cmdline['-c']-1).each do |it|\n u = cmdline['<user>'][it]\n p = cmdline['<password>'][it]\n t = cmdline['<target>'][it]\n loaded[:task_systems].each do |ts|\n if ts[:name] == t\n ts[:usr] = u\n ts[:pw] = p\n end\n end\n end\n end\n \n unless cmdline['--properties'].nil? \n json_value = JSON.parse(cmdline['--properties'])\n loaded[:properties] = loaded[:properties].merge(json_value)\n end\n loaded[:verbosity] = Logging.calc_verbosity(cmdline)\n loaded \n end", "def make(args)\n # Maybe we should write an \"uncrustify\" fastlane action?...\n Dir.chdir '..' do\n sh 'make ' + args\n end\nend", "def make(args)\n # Maybe we should write an \"uncrustify\" fastlane action?...\n Dir.chdir '..' do\n sh 'make ' + args\n end\nend", "def mock_build(successful)\n project = new_mock\n project.__setup(:name) {\"TestProject\"}\n \n setup_changes\n revisions = RSCM::Revisions.new\n revisions.add(@change1)\n revisions.add(@change2)\n revisions.add(@change3)\n revisions.add(@change4)\n revisions.add(@change5)\n revisions.add(@change6)\n revisions.add(@change7)\n revisions.each{|revision| revision.project = project}\n \n build = new_mock\n build.__setup(:project) {project}\n build.__setup(:successful?) {successful}\n build.__setup(:revision) {revisions[3]}\n build.__setup(:status_message) {successful ? \"Successful\" : \"Failed\"}\n build\n end", "def project_root=(_arg0); end", "def install_projects\n if @project.include? ','\n projects = @project.split ','\n projects.each do |p|\n @project = p\n check_core\n install_project \n puts\n end \n else\n check_core\n install_project\n end\n end", "def build_pkg(dist, arch, deps)\n start_dir = Dir.pwd\n build_dir = \"/tmp/rhobuild\"\n version = Rhoconnect::VERSION\n description = '\"Rhoconnect production environment\"'\n prefix = \"/opt/rhoconnect/installer\"\n gem_name = \"rhoconnect-#{version}.gem\"\n\n before_install_script = \"#{build_dir}/unix-like/pre_install.sh\"\n after_install_script = \"#{build_dir}/unix-like/post_install.sh\"\n before_remove_script = \"#{build_dir}/unix-like/pre_uninstall.sh\"\n after_remove_script = \"#{build_dir}/unix-like/post_uninstall.sh\"\n\n `rm -rf #{build_dir}` if File.exist?(\"#{build_dir}\")\n Dir.mkdir(\"#{build_dir}\")\n Dir.mkdir(\"#{build_dir}/unix-like\")\n\n # Copy all necessary Files into the build_dir\n system(\"cp install.sh Gemfile Gemfile.lock #{build_dir}\")\n system(\"cp -r installer/unix-like/*.sh #{build_dir}/unix-like\")\n system(\"cp -r installer/unix-like/*.rb #{build_dir}/unix-like\")\n system(\"cp pkg/#{gem_name} #{build_dir}\")\n\n # cd into the pkg dir so that fpm will create the package into the pkg dir.\n Dir.chdir(\"./pkg\") # it created by build task and should already exist\n\n # Construct fpm command\n fpm_cmd = \"fpm -s dir -t #{dist} -n rhoconnect -v #{version} -a #{arch} -C #{build_dir} --epoch 1 \" +\n \"--before-install #{before_install_script} --after-install #{after_install_script} \" +\n \"--before-remove #{before_remove_script} --after-remove #{after_remove_script} \" +\n \"--prefix #{prefix} --description #{description}\"\n # Add the list of dependencies to the fpm call\n deps.each { |dep| fpm_cmd << \" -d '#{dep}'\" }\n fpm_cmd << \" './'\"\n # Create the package\n system(fpm_cmd)\n # Leave no trace...\n system(\"rm -rf #{build_dir}\")\n Dir.chdir(start_dir)\nend", "def writable_create_project(dashboard_name) \n\tscript \"create_dashing_project\" do\n\t\tinterpreter \"bash\"\n\t\tuser \"root\"\n\t\tcwd \"/home\"\n\t\tcode <<-EOH\n\t\tdashing new \"#{dashboard_name}\"\n\t\tchmod 777 \"#{dashboard_name}\"\n\t\tcd \"#{dashboard_name}\"\n\t\tEOH\n\tend\n\tChef::Log.info \"#{dashboard_name} dashboard project created\"\n\nend", "def dress(commands, pre_or_post, stage)\n chdir = \"cd #{build_dir} && \"\n chdir = \"\" if [:prepare, :download].include?(stage)\n chdir = \"\" if stage == :extract and pre_or_post == :pre\n flatten(commands).collect { |command| \"bash -c '#{chdir}#{command} >> #{@package.name}-#{stage}.log 2>&1'\" }\n end", "def initialize(default_target, arguments)\n option_parser = OptionParser.new\n option_parser.on('--no-ivy') { @no_ivy = true }\n option_parser.on('--no-compile') { @no_compile = true }\n option_parser.on('--no-demo') { @no_demo = true }\n option_parser.on('--no-schema') { @no_schema = true }\n option_parser.on('--no-jre') { @no_jre = true }\n option_parser.on('--no-no') do \n @no_ivy = true\n @no_demo = true\n @no_schema = true\n end\n option_parser.on('--emma') do Registry[:emma] = true end\n \n @start_time = Time.now\n @basedir = FilePath.new(File.dirname(File.expand_path(__FILE__)), \"..\").canonicalize\n Registry[:basedir] = @basedir\n puts(\"Building with base directory: '#@basedir'.\")\n puts\n @default_target = default_target\n @ant = TerracottaAnt.new\n Registry[:ant] = @ant\n @platform = CrossPlatform.create_implementation(:ant => @ant)\n Registry[:platform] = @platform\n \n # The CommandLineConfigSource actually parses its arguments, and returns only the ones\n # that aren't configuration property settings (e.g., of the form 'a=b').\n arguments = option_parser.parse(arguments)\n @arguments, command_line_source = CommandLineConfigSource.from_args(arguments)\n @internal_config_source = InternalConfigSource.new\n Registry[:internal_config_source] = @internal_config_source\n @config_source = create_config_source(command_line_source, @internal_config_source)\n Registry[:config_source] = @config_source\n Registry[:command_line_config] = command_line_source\n\n @script_results = ScriptResults.new\n\n if Registry[:emma]\n Registry[:emma_home] = FilePath.new(@basedir.to_s, \"..\", \"..\", \"buildsystems\", \"emma-2.0.5312\").canonicalize.to_s\n fail(\"EMMA_HOME does not exist: #{Registry[:emma_home]}\") unless File.exists?(Registry[:emma_home])\n Registry[:emma_lib] = \"#{Registry[:emma_home]}/lib/emma.jar\"\n puts \"EMMA_HOME: #{Registry[:emma_home]}\"\n end\n\n # XXX: this is a hack to get around jruby script converting JAVA_HOME to unix path\n begin\n if `uname` =~ /CYGWIN/i\n ENV['JAVA_HOME'] = `cygpath -w #{ENV['JAVA_HOME']}`.strip\n end\n rescue\n # do nothing\n end\n\n reset\n end", "def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake . #{cmake_std_parameters}\"\n system \"make install\"\n end", "def pkg_default_build\n jobnum = @jobs\n make = @make\n\n # If job number specification is missing, use default\n if jobnum <= 0\n jobnum = $bsyscfg.get_jobs\n end\n if make.length == 0\n make = $bsyscfg.get_make\n end\n\n <<BUILD\nCC=\"#{$bsyscfg.get_cc}\" \\\\\nCPP=\"#{$bsyscfg.get_cpp}\" \\\\\nCXX=\"#{$bsyscfg.get_cxx}\" \\\\\nCFLAGS=\"#{$bsyscfg.get_cflags} #{@cflags}\" \\\\\nCPPFLAGS=\"#{$bsyscfg.get_cppflags} #{@cppflags}\" \\\\\nCXXFLAGS=\"#{$bsyscfg.get_cxxflags} #{@cxxflags}\" \\\\\nLDFLAGS=\"#{$bsyscfg.get_ldflags} #{@ldflags}\" \\\\\n#{make} -j#{jobnum}\nBUILD\n end" ]
[ "0.7134042", "0.6587739", "0.65063107", "0.63672405", "0.6364035", "0.61755776", "0.59287566", "0.59153837", "0.5698165", "0.568441", "0.5618777", "0.5569372", "0.5516172", "0.5450874", "0.5429077", "0.5422712", "0.5402287", "0.5376412", "0.5375085", "0.53579277", "0.5323111", "0.52909744", "0.52821743", "0.522422", "0.5202138", "0.51773083", "0.5176729", "0.5174706", "0.5173554", "0.5165742", "0.5164473", "0.5151626", "0.51437896", "0.50947785", "0.50912964", "0.50634855", "0.5052636", "0.50219065", "0.5014597", "0.5014149", "0.5001795", "0.49987495", "0.49776152", "0.49707127", "0.49699774", "0.4968174", "0.49669868", "0.49660307", "0.49561173", "0.4954477", "0.4932625", "0.4928574", "0.4913625", "0.49047312", "0.48969516", "0.4883665", "0.4883665", "0.48815966", "0.4881316", "0.4880636", "0.48771417", "0.48765218", "0.48628384", "0.48467857", "0.48466522", "0.48391864", "0.48380417", "0.4833129", "0.48153526", "0.4805513", "0.4796289", "0.4774238", "0.4771714", "0.47696137", "0.47608334", "0.474902", "0.4748554", "0.4736825", "0.4720588", "0.47189492", "0.4710984", "0.47001815", "0.46830374", "0.46814385", "0.46782723", "0.46726382", "0.46663272", "0.46616334", "0.465542", "0.46530396", "0.46530396", "0.46515632", "0.4641791", "0.46403396", "0.46372536", "0.46346727", "0.4631712", "0.4624681", "0.46156207", "0.46150085" ]
0.8005089
0
GET /courses GET /courses.json
def index @courses = Course.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end", "def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n @courses = Course.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses}\n end\n end", "def index\n\t\t@courses = @teacher.courses\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @courses }\n end\n end", "def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend", "def courses\n request(COURSES_URL, {}, 'GET').map do |course|\n Course.new(self, course)\n end\n end", "def all_courses\n [\n {\n id: 1,\n title: 'The Complete Node.js Developer Course',\n author: 'Andrew Mead, Rob Percival',\n description: 'Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs/'\n },\n {\n id: 2,\n title: 'Node.js, Express & MongoDB Dev to Deployment',\n author: 'Brad Traversy',\n description: 'Learn by example building & deploying real-world Node.js applications from absolute scratch',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs-express-mongodb/'\n },\n {\n id: 3,\n title: 'JavaScript: Understanding The Weird Parts',\n author: 'Anthony Alicea',\n description: 'An advanced JavaScript course for everyone! Scope, closures, prototypes, this, build your own framework, and more.',\n topic: 'JavaScript',\n url: 'https://codingthesmartway.com/courses/understand-javascript/'\n }\n ]\n end", "def index\n authorize! :read, Course\n\n if is_student?\n @course_sections = Course.find_student_courses(current_user.id)\n else\n @course_sections = Course.find_professor_courses(current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def get_courses(opts = {})\n data, _status_code, _headers = get_courses_with_http_info(opts)\n data\n end", "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end", "def courses\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = nil\n\n @courses = current_user.instructor.courses.collect{ |course|\n {\n name: course.name,\n id: course.id\n }\n }\n\n render :template => \"home/index\"\n end", "def show_course\n\t\t@course = Course.find(params[:course_id])\n\t\trender json: @course\n\tend", "def index\n @courses = Courses.all\n end", "def index\n @courses = Course.all.includes(:translations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n # Check for filters\n @courses = Course.getCourseInformation(params[:dept],params[:course])\n @page_title = \"Browse Courses\"\n respond_to do |format|\n format.html\n format.json {render json: @courses }\n end\n end", "def index\n @courses = Course.order(:name).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => Course.all }\n end\n end", "def index\n\t\t@courses = Course.all\n\tend", "def index\n query = params[:q]\n @courses = query ? Course.search(query) : Course.all.order(:id)\n\n render json: @courses\n end", "def index\n @courts = Court.by_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "def show\n render json: @course\n end", "def index\n @assessment_courses = AssessmentCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assessment_courses }\n end\n end", "def list_courses\n if current_user.is_admin?\n @user = User.find(params[:id])\n @courses = @user.courses\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n else\n respond_to do |format|\n format.xml { render :text => \"error\" }\n end\n end\n end", "def index\r\n @courses = Course.all\r\n end", "def get_courses\n\t\tif current_student.id.to_i == params[:id].to_i\n\t\t\t@student = Student.find(params[:id])\n\t\t\t@evaluations = @student.evaluations\n\t\tend\n\t\trender 'get_courses'\n\tend", "def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end", "def show\n render json: course\n end", "def index\n @courses = Course.all\n\n end", "def index\n @study_courses = StudyCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_courses }\n end\n end", "def index\n\t\t@course = Course.find(params[:course_id])\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\tend\n\tend", "def course\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = Course.where({id: params[:id]}).first\n\n @course_projects = $selected_course.projects.collect{ |project|\n {\n project_name: project.name,\n team_names: project.teams.reduce(''){|names, team| names + team.name + ', '}[0..-3],\n due: project.due.in_time_zone('Eastern Time (US & Canada)').strftime('%Y-%m-%d %I:%M:%S %p')\n }\n }\n\n render :template => \"home/index\"\n end", "def courses(institution, pageIndex=0, options={})\n options.merge!({:query => {:pageIndex => pageIndex}})\n self.class.get(\"/Institution/#{institution}/Courses.json\", options)\n end", "def show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end", "def index\n begin\n conditions = [\"club_id = ?\",@club.id]\n @courses = Course.find(:all, :order => 'id', :conditions => conditions)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end", "def show\n @courses = Course.all\n end", "def get_course_of_instructor\n instructor_id = params[:instructor_id]\n\n course_ids = if instructor_id.blank?\n []\n else\n Course.where(:user_id => instructor_id).map(&:id).map(&:to_s)\n end\n\n render json: {:course_ids => course_ids}\n end", "def show\n render json: @course, status: :found\n end", "def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def index\n @current_user = User.find_by_id(session[:user_id])\n @courses = @current_user.courses.paginate page: params[:page], order: 'created_at asc', per_page: 25\n if @current_user.courses.empty?\n redirect_to new_course_url, notice: \"You Have No Courses Yet\"\n return\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def courses_all\n call_path = \"courses/all\"\n data = build_post_data(\"\")\n perform_post(build_url(call_path), data)\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end", "def index\n @courts = Court.all\n end", "def index\n @enrolleds = Enrolled.all\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enrolleds }\n end\n end", "def index\n \n if can? :update, @course #instructor \n @courses = current_user.subjects #Course.where(:user_id => current_user.id) #courses that person teaches\n else\n @courses = current_user.courses \n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def courses\n @courses = Course.where(\"teacher_id=?\",session[:user].teacher_id)\n end", "def list_courses(courses_collection)\n courses_collection.each do |course|\n\n end\n end", "def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "def index\n @path_courses = PathCourse.all\n end", "def courses_json\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n courses = Course.all\n .where(school_id: @school.id)\n .includes(sections: :students)\n\n courses_json = courses.as_json({\n :only => [:id, :course_number, :course_description],\n :include => {\n :sections => {\n :only => [:id, :section_number, :term_local_id, :schedule, :room_number],\n :include => {\n :students => {\n :only => [:id, :grade, :date_of_birth],\n :include => {\n :school => {\n :only => [:id, :name]\n }\n }\n }\n }\n }\n }\n })\n\n render json: {\n courses: courses_json,\n school: @school.as_json(only: [:id, :name])\n }\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end", "def show\r\n @course = Course.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @course }\r\n\r\n end\r\n end", "def courses\n Content::Courses.new(token: @token)\n end", "def courses\n @learn_courses\n end", "def index\n @given_courses = GivenCourse.all\n end", "def index\n if (params[:query])\n @courses = Course.full_course_search(params[:query]).listed.page(params[:page]).per_page(10)\n else \n @courses = Course.listed.paginate(:page => params[:page], :per_page => 10).order(\"created_at desc\")\n end\n @followers = Course.get_number_people_following_published_courses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def index\n \tif current_user && current_user.username.eql?(\"admin\")\n @courses = Course.all\n elsif current_user\n\t @lista = Profesor.joins(:course).where(:user_id => session[:user_id])\t\n\t list = Array.new\n\t @lista.each do |l|\n\t \tlist << l.course_id\n end\n\t @courses = Course.find(list)\n\tend\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> @courses }\n end\n end", "def index\n @curriculum_courses = CurriculumCourse.all\n end", "def index\n @user_courses = UserCourse.all\n end", "def student_show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n \n end", "def show\n @courses = Courses.first\n end", "def list_courses \r\n courses = Subject.find(params[:s]).courses rescue render_return\r\n render_return if courses.empty? or !logged_in_user.see_course?(courses.first)\r\n render_p 'course_display/list_courses',{'courses'=>courses,'caller'=>params[:caller]}\r\n end", "def index\n #@courses = @curriculum.courses\n\n @courses = ScopedCourse.where(:curriculum_id => @curriculum.id)\n .joins(:course_descriptions)\n .where([\"course_descriptions.locale = ?\", I18n.locale]).includes(:strict_prereqs)\n# .joins(<<-SQL\n# INNER JOIN course_descriptions\n# ON competence_nodes.abstract_course_id = course_descriptions.abstract_course_id\n# SQL\n# )\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json do\n render :json => @courses.select(<<-SQL\n competence_nodes.id,\n competence_nodes.course_code,\n course_descriptions.name AS translated_name\n SQL\n ).to_json(:methods => :strict_prereq_ids, :root => true)\n end\n end\n end", "def index \n @courses = Course.all\n puts 'Courses-Index -mashal is super helpful'\n end", "def show\n @court = Court.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @court }\n end\n end", "def show\n if !params.has_key?(:section)\n redirect_to courses_path and return\n end\n\n @course = Course.find(params[:id])\n authorize! :read, @course\n @section = Section.find(params[:section])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def course(institution, course, kismode, recursive=true, options={})\n response = self.class.get(\"/Institution/#{institution}/Course/#{course}/#{kismode}.json\", options)\n if recursive\n response.merge!({:accreditations => course_accreditations(institution, course, kismode)})\n response.merge!({:stages => course_stages(institution, course, kismode)})\n response.merge!({:statistics => course_statistics(institution, course, kismode)})\n end\n response.parsed_response\n end", "def index\n @courses = Course.all\n @titre = \"All courses\"\n @description = \"Here, you will find the list of all the Courses available in our High school :\"\n end" ]
[ "0.7943173", "0.78570646", "0.7742099", "0.7729055", "0.7729055", "0.76939315", "0.76708746", "0.76526207", "0.752899", "0.74440956", "0.74415404", "0.73988724", "0.7373047", "0.7365082", "0.73555565", "0.7347125", "0.7311683", "0.7271882", "0.7270879", "0.72251445", "0.72230077", "0.7210611", "0.7208962", "0.718815", "0.7180561", "0.7142384", "0.7141049", "0.7132171", "0.7123155", "0.710393", "0.7097321", "0.7049614", "0.70113283", "0.7009046", "0.6999527", "0.6994991", "0.6979547", "0.6971477", "0.6964548", "0.69494456", "0.6943253", "0.6943253", "0.6943253", "0.6943253", "0.6943253", "0.6943253", "0.6923683", "0.69026154", "0.6892542", "0.6891432", "0.68823546", "0.6879756", "0.68756413", "0.68729115", "0.6871734", "0.6863271", "0.6861751", "0.6840159", "0.68221515", "0.680736", "0.6803287", "0.679456", "0.67933244", "0.6782277", "0.6777651", "0.6772413", "0.6771088", "0.6734414", "0.6700828", "0.6693249", "0.66928315", "0.6688745", "0.6687543", "0.6658302", "0.6633408", "0.6625263" ]
0.7169304
46
GET /courses/1 GET /courses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end", "def show_course\n\t\t@course = Course.find(params[:course_id])\n\t\trender json: @course\n\tend", "def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend", "def index\n @courses = Course.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses}\n end\n end", "def index\n\t\t@courses = @teacher.courses\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @courses }\n end\n end", "def show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end", "def index\n @courts = Court.by_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "def show\n render json: @course\n end", "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def show\n render json: course\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end", "def show\n render json: @course, status: :found\n end", "def index\n @courses = Courses.all\n end", "def index\n authorize! :read, Course\n\n if is_student?\n @course_sections = Course.find_student_courses(current_user.id)\n else\n @course_sections = Course.find_professor_courses(current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end", "def show\r\n @course = Course.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @course }\r\n\r\n end\r\n end", "def index\n @courses = Course.order(:name).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => Course.all }\n end\n end", "def index\n # Check for filters\n @courses = Course.getCourseInformation(params[:dept],params[:course])\n @page_title = \"Browse Courses\"\n respond_to do |format|\n format.html\n format.json {render json: @courses }\n end\n end", "def one args\n @courses = args[:courses]\n render\n end", "def show\n @courses = Courses.first\n end", "def index\n\t\t@course = Course.find(params[:course_id])\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\tend\n\tend", "def show\n @court = Court.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @court }\n end\n end", "def index\n @courses = Course.all.includes(:translations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def courses\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = nil\n\n @courses = current_user.instructor.courses.collect{ |course|\n {\n name: course.name,\n id: course.id\n }\n }\n\n render :template => \"home/index\"\n end", "def student_show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n \n end", "def get_courses\n\t\tif current_student.id.to_i == params[:id].to_i\n\t\t\t@student = Student.find(params[:id])\n\t\t\t@evaluations = @student.evaluations\n\t\tend\n\t\trender 'get_courses'\n\tend", "def index\n @assessment_courses = AssessmentCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assessment_courses }\n end\n end", "def all_courses\n [\n {\n id: 1,\n title: 'The Complete Node.js Developer Course',\n author: 'Andrew Mead, Rob Percival',\n description: 'Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs/'\n },\n {\n id: 2,\n title: 'Node.js, Express & MongoDB Dev to Deployment',\n author: 'Brad Traversy',\n description: 'Learn by example building & deploying real-world Node.js applications from absolute scratch',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs-express-mongodb/'\n },\n {\n id: 3,\n title: 'JavaScript: Understanding The Weird Parts',\n author: 'Anthony Alicea',\n description: 'An advanced JavaScript course for everyone! Scope, closures, prototypes, this, build your own framework, and more.',\n topic: 'JavaScript',\n url: 'https://codingthesmartway.com/courses/understand-javascript/'\n }\n ]\n end", "def show\n @lab_course = LabCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_course }\n end\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def index\n @courses = Course.all\n end", "def get_course_of_instructor\n instructor_id = params[:instructor_id]\n\n course_ids = if instructor_id.blank?\n []\n else\n Course.where(:user_id => instructor_id).map(&:id).map(&:to_s)\n end\n\n render json: {:course_ids => course_ids}\n end", "def index\n @study_courses = StudyCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_courses }\n end\n end", "def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end", "def index\n\t\t@courses = Course.all\n\tend", "def index\n @course = Course.find params[:course_id]\n end", "def show\n if !params.has_key?(:section)\n redirect_to courses_path and return\n end\n\n @course = Course.find(params[:id])\n authorize! :read, @course\n @section = Section.find(params[:section])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def index\r\n @courses = Course.all\r\n end", "def index\n @courses = Course.all\n\n end", "def course\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = Course.where({id: params[:id]}).first\n\n @course_projects = $selected_course.projects.collect{ |project|\n {\n project_name: project.name,\n team_names: project.teams.reduce(''){|names, team| names + team.name + ', '}[0..-3],\n due: project.due.in_time_zone('Eastern Time (US & Canada)').strftime('%Y-%m-%d %I:%M:%S %p')\n }\n }\n\n render :template => \"home/index\"\n end", "def show\n @courses = Course.all\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def get_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\"\n _get(path)\n # returns: JSON object of the course\nend", "def index\n # puts \"params[:course][:id] is: #{params[:course][:id]}\"\n # @course = Course.find_by_id(params[:course][:id])\n# @students = @course.students\n end", "def index\n begin\n conditions = [\"club_id = ?\",@club.id]\n @courses = Course.find(:all, :order => 'id', :conditions => conditions)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end", "def show\n @study_course = StudyCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study_course }\n end\n end", "def index\n query = params[:q]\n @courses = query ? Course.search(query) : Course.all.order(:id)\n\n render json: @courses\n end", "def index\n \n if can? :update, @course #instructor \n @courses = current_user.subjects #Course.where(:user_id => current_user.id) #courses that person teaches\n else\n @courses = current_user.courses \n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "def get_single_course_courses(id,include,opts={})\n query_param_keys = [\n :include\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"include is required\" if include.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :include => include\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n Course.new(response)\n end", "def list_courses\n if current_user.is_admin?\n @user = User.find(params[:id])\n @courses = @user.courses\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n else\n respond_to do |format|\n format.xml { render :text => \"error\" }\n end\n end\n end", "def show\n #@course = Course.find(params[:course_id])\n @course_lesson = CourseLesson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_lesson }\n end\n end", "def courses\n request(COURSES_URL, {}, 'GET').map do |course|\n Course.new(self, course)\n end\n end", "def index\n @current_user = User.find_by_id(session[:user_id])\n @courses = @current_user.courses.paginate page: params[:page], order: 'created_at asc', per_page: 25\n if @current_user.courses.empty?\n redirect_to new_course_url, notice: \"You Have No Courses Yet\"\n return\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "def index\n @courts = Court.all\n end", "def show\n @course_category = CourseCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_category }\n end\n end", "def new\n @course = Course.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def show\n @assessment_course = AssessmentCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assessment_course }\n end\n end", "def show\n @court = Court.friendly.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @court }\n end\n end", "def show\n @course_request = CourseRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_request }\n end\n end", "def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @course = Course.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end" ]
[ "0.7639248", "0.7600732", "0.7561499", "0.7498261", "0.7492566", "0.7492566", "0.7460362", "0.7459336", "0.7438278", "0.7280991", "0.7248682", "0.7241407", "0.723878", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.72222453", "0.721023", "0.71961445", "0.7176137", "0.71723205", "0.71608883", "0.71429384", "0.71275723", "0.7109096", "0.710453", "0.70959777", "0.7086524", "0.70511097", "0.70144516", "0.70103335", "0.69955844", "0.6995095", "0.69948006", "0.69911087", "0.69872206", "0.6982276", "0.6972223", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6969603", "0.6962494", "0.6960013", "0.6957612", "0.6955127", "0.6948716", "0.69405997", "0.69362515", "0.6913349", "0.6903795", "0.68959415", "0.6884874", "0.6872327", "0.6870878", "0.68597114", "0.6853467", "0.68510145", "0.6824737", "0.6815046", "0.6800382", "0.6788517", "0.67855954", "0.6782395", "0.6776448", "0.67733794", "0.6766255", "0.67600936", "0.67587054", "0.6756013", "0.67511064", "0.6749037", "0.67460793", "0.67350477", "0.67350477", "0.67350477", "0.67350477", "0.67350477" ]
0.0
-1
POST /courses POST /courses.json
def create @course = Course.new(course_params) #section_chunks = get_chunks(params) sections = JSON.parse(params['sections']) # The course has been created by the signed-in user. @course.user_id = current_user.id respond_to do |format| if @course.save # Save the course's subcomponents to the course. update_section_chunks(sections) format.html { redirect_to @course } format.json { render :show, status: :created, location: @course } else format.html { render new_course_path } format.json { render json: @course.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n # render plain: params[:courses].inspect\n @courses = Courses.new(courses_params)\n\n respond_to do |format|\n if @courses.save\n format.html { redirect_to @courses, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @courses }\n else\n format.html { render :new }\n format.json { render json: @courses.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(courses_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n course = Course.new(course_params)\n\n if course.save\n render json: course, status: :created\n else\n render json: course.errors, status: :unprocessable_entity\n end\n end", "def create\n @course = Course.new(course_params)\n @course.save\n render_jsonapi_response(@course)\n end", "def create\n \n @course = current_user.courses.build(course_params)\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = current_teacher.courses.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = current_teacher.courses.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n authorize! :manage, Course\n @course = Course.new(course_params)\n @course.course_sections.each do |course_section|\n course_section.name = \"#{@course.name} #{course_section.grade_section.name}\"\n end\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Curso creado satisfactoriamente' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_path(), notice: 'El curso fue exitosamente creado.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { redirect_to new_course_path, notice: \"Debe escribir por lo menos el nombre del curso para crearlo.\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course ' + @course.course_id + ' was successfully created!' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, :notice=> 'Curso creado' }\n format.json { render :json=> @course, :status=> :created, :location=> @course }\n else\n format.html { render :action=> \"new\" }\n format.json { render :json=> @course.errors, :status=> :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n respond_to do |format|\n if @course.save\n\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n \n format.html { redirect_to @course, notice: 'course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n ppp @course.errors.full_messages\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to admin_courses_path, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Curso criado com sucesso.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to [:admin, @course], :notice => 'Course was successfully created.' }\n format.json { render :json => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to static_pages_admin_url, notice: 'Course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_course\r\n @course = Course.create(fast_course_params)\r\n respond_to do |format|\r\n if @course.save\r\n format.html { redirect_to courses_path, notice: 'Course was successfully created.' }\r\n format.json { render courses_path, status: :created, location: @course }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @course.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def new\n @course = Course.new\n 2.times do\n course=@course.students.build\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n # Add the course just created to this student's courses, better use the drop down list \n if params[:course] != nil then\n @student.courses << Course.find(params[:course][:id])\n end\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def courses_all\n call_path = \"courses/all\"\n data = build_post_data(\"\")\n perform_post(build_url(call_path), data)\n end", "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @semester ? semester_course_path(@semester, @course) : @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:course][:user_id]=current_user.id\n \n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.find(params[:course_id])\n @question = @course.questions.build(params[:question])\n @question.save\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @course, notice: 'Question was successfully created.' }\n format.json { render json: @course, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end", "def create\n @course = Course.new(course_params)\n @course.user = current_user\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tcourse = Course.new(course_params)\n\t\tif course.save\n\n\t\t params[:course][\"major_id\"].each do |major_id|\n\t if !major_id.empty?\n\t course.major << Major.find(major_id)\n\t end\n\t end\n\n\t params[:course][\"minor_id\"].each do |minor_id|\n\t if !minor_id.empty?\n\t course.minor << Minor.find(minor_id)\n\t end\n\t end\n\n\t params[:course][\"concentration_id\"].each do |concentration_id|\n\t if !concentration_id.empty?\n\t course.concentration << Concentration.find(concentration_id)\n\t end\n\t end\n\n\t params[:course][\"distribution_id\"].each do |distribution_id|\n\t if !distribution_id.empty?\n\t course.distribution << Distribution.find(distribution_id)\n\t end\n\t end\n\n\t\t\tredirect_to '/courses'\n\t\telse\n\t\t\tflash[:danger] = \"The form you submitted is invalid.\"\n\t\t\tredirect_to '/courses/new'\n\t\tend\n\tend", "def create(params)\n response = self.class.post(\n '/webservice/rest/server.php',\n {\n :query => query_hash('core_course_create_courses', token),\n :body => {\n :courses => {\n '0' => {\n :fullname => params[:full_name],\n :shortname => params[:short_name],\n :categoryid => params[:parent_category],\n :idnumber => params[:idnumber]\n }\n }\n }\n }.merge(query_options)\n )\n check_for_errors(response)\n response.parsed_response.first\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to admin_course_url(@course), notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course added. Warning no Instructor assigned. Go to the manage user history tab and add instructor' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params) # crea un curso con todos los parametros que le envia el formulario\n @course.save\n @courses = Course.all # aqui consultamos por todos los cursos\n render :index # y pintamos otra vez la lista de cursos\n\n end", "def create\n @court = Court.new(params[:court])\n\n respond_to do |format|\n if @court.save\n format.html { redirect_to @court, notice: 'Court was successfully created.' }\n format.json { render json: @court, status: :created, location: @court }\n else\n format.html { render action: \"new\" }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(course_params)\n \n respond_to do |format|\n if @course.save\n #format.html { redirect_to course_build_path(:id =>\"courseinfo\", :course_id => @course.id), notice: \"Course Created\" }\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n @course.publisher = current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to new_course_lesson_path(@course), :notice => 'Course was successfully created.' }\n format.json { render :json => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @course = @student.courses.new(params[:course])\n @course.save\n redirect_to @course.student\n end", "def create\n @courses_teacher = CoursesTeacher.new(courses_teacher_params)\n\n respond_to do |format|\n if @courses_teacher.save\n format.html { redirect_to @courses_teacher, notice: 'Courses teacher was successfully created.' }\n format.json { render :show, status: :created, location: @courses_teacher }\n else\n format.html { render :new }\n format.json { render json: @courses_teacher.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @course = Course.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end", "def new\n @course = Course.new\n 1.times { @course.lessons.build }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end", "def create\n @enrolled = Enrolled.new(:student_id => current_student.student_id, :course_id => params[:course_id])\n\n respond_to do |format|\n if @enrolled.save\n format.html { redirect_to @enrolled, notice: 'Enrolled was successfully created.' }\n format.json { render json: @enrolled, status: :created, location: @enrolled }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrolled.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = CourseAccount.new(id_user:11,id_course: params[:course],coin:5000)\n @course.save()\n session[:id_course] =params[:course]\n render :json =>[@course,session[:id_course]]\n\n end", "def create\n @curriculum_course = CurriculumCourse.new(curriculum_course_params)\n\n respond_to do |format|\n if @curriculum_course.save\n format.html { redirect_to @curriculum_course, notice: 'Curriculum course was successfully created.' }\n format.json { render :show, status: :created, location: @curriculum_course }\n else\n format.html { render :new }\n format.json { render json: @curriculum_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @court = Court.new(court_params)\n\n respond_to do |format|\n if @court.save\n format.html { redirect_to @court, notice: 'Court was successfully created.' }\n format.json { render :show, status: :created, location: @court }\n else\n format.html { render :new }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.new(params[:course])\n \n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, :notice => t('selecao_admin.flash_messages.successfully_created', :model => @course.class.model_name.human) }\n format.json { render :json => @course, :status => :created, :location => @course }\n format.js\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end", "def create\n @course = Course.new(course_params)\n\n if @course.save\n flash[:success] = \"Curso criado com sucesso\"\n redirect_to courses_path\n else\n flash[:error] = \"Não foi possível criar o curso\"\n redirect_to courses_path\n end\n end", "def create\n @course = Course.new(course_params)\n @course.description = \"Curriculum Description\"\n @course.short_description = \"Marketing Description\"\n authorize @course\n @course.user=current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to course_course_wizard_index_path(@course), notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n @tags = Tag.all\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_course = UserCourse.new(user_course_params)\n respond_to do |format|\n if @user_course.save\n format.html { redirect_to @user_course, notice: 'User course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_course }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_course = Admin::Course.new(admin_course_params)\n\n respond_to do |format|\n if @admin_course.save\n format.html { redirect_to @admin_course, notice: t('crud.created_successfully!', name: Admin::Course.model_name.human) }\n format.json { render :show, status: :created, location: @admin_course }\n else\n format.html { render :new }\n format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @course = Course.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "def create\n course_name = params[:text].to_s\n course = Course.create(name: course_name)\n CourseInstructor.create(course: course, instructor: current_user.instructor)\n\n @courses = current_user.instructor.courses.collect{ |course|\n {\n name: course.name,\n id: course.id\n }\n }\n\n render :template => \"home/index\"\n end", "def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html\n format.json { render json: @course }\n end\n end", "def create\n # @course = Course.new(course_params)\n\n CourseBuilder.build do |builder|\n builder.set_code(course_params['code'])\n builder.set_title(course_params['title'])\n builder.set_instructor(course_params['instructor'])\n builder.set_semester(course_params['semester'])\n builder.set_credit(course_params['credit'])\n builder.set_room(course_params['room'])\n builder.set_evaluation(course_params['midterm'], course_params['final'], course_params['assignment'], course_params['project'])\n\n @course = builder.course\n end\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n format.json { render :index, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @question = Question.new(question_params)\n @courses = Course.all\n @users = User.all\n respond_to do |format|\n if @question.save\n format.html { redirect_to course_path(Course.find(@question.course_id))}\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @people_course = PeopleCourse.new(people_course_params)\n\n respond_to do |format|\n if @people_course.save\n format.html { redirect_to @people_course, notice: 'People course was successfully created.' }\n format.json { render :show, status: :created, location: @people_course }\n else\n format.html { render :new }\n format.json { render json: @people_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @course = Course.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end", "def new\n @course =Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end", "def create\n @course = Course.new( { :subject_id => params[:subject_id] } )\n\n respond_to do |format|\n if @course.save\n current_user.courses << @course\n lesson = @course.lessons.new\n @course.lessons << lesson\n flash[:notice] = 'Start learning'\n format.html { redirect_to :controller => 'lessons', :action => 'show', :id => lesson.id }\n format.xml { render :xml => @course, :status => :created, :location => @course }\n else\n flash[:error] = 'Problem encountered.'\n format.html { redirect_to(:back) }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @study_course = StudyCourse.new(params[:study_course])\n\n respond_to do |format|\n if @study_course.save\n format.html { redirect_to @study_course, notice: 'Study course was successfully created.' }\n format.json { render json: @study_course, status: :created, location: @study_course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @study_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @given_course = GivenCourse.new(given_course_params)\n\n respond_to do |format|\n if @given_course.save\n format.html { redirect_to @given_course, notice: 'Given course was successfully created.' }\n format.json { render :show, status: :created, location: @given_course }\n else\n format.html { render :new }\n format.json { render json: @given_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=> @course }\n end\n end", "def new\n @court = Court.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @court }\n end\n end", "def create\n @university_course = UniversityCourse.new(university_course_params)\n\n respond_to do |format|\n if @university_course.save\n format.html { redirect_to @university_course, notice: 'University course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @university_course }\n else\n format.html { render action: 'new' }\n format.json { render json: @university_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if @course.save\n redirect_to @course, notice: 'Course was successfully created.'\n else\n redirect_to action: :new\n end\n end" ]
[ "0.76892596", "0.73786503", "0.733382", "0.72321343", "0.7226333", "0.7156661", "0.71277976", "0.71260464", "0.71082616", "0.710302", "0.710302", "0.710302", "0.710302", "0.710302", "0.710302", "0.710302", "0.7091641", "0.7081471", "0.706835", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.705234", "0.7052087", "0.70390403", "0.7034913", "0.7020897", "0.70196193", "0.7006089", "0.69705534", "0.6934739", "0.692708", "0.692409", "0.69128674", "0.69034415", "0.68776643", "0.6869153", "0.6854769", "0.6846298", "0.6816691", "0.6812634", "0.6802218", "0.6789687", "0.6789469", "0.67786044", "0.67783284", "0.67516315", "0.67125636", "0.67094135", "0.6707667", "0.6692438", "0.669107", "0.6688414", "0.6685879", "0.668451", "0.6678632", "0.66716915", "0.6665886", "0.66652733", "0.66598773", "0.66545373", "0.6617867", "0.6611976", "0.66105884", "0.6606813", "0.6606745", "0.66060495", "0.66014636", "0.658122", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.6579664", "0.65739167", "0.656531", "0.65609866", "0.65568936", "0.6554794", "0.65500903", "0.65390193", "0.6532627", "0.6524649", "0.6522867", "0.6518086", "0.65162486", "0.65041983" ]
0.6863272
45
PATCH/PUT /courses/1 PATCH/PUT /courses/1.json
def update section_chunks = get_chunks(params) puts params redirect_to @course return sections = params['sections'] if sections.nil? # Loop through course's existing sections. @course.sections.each do |section| end end respond_to do |format| # Update subcontents if update_section_chunks(section_chunks) format.html { redirect_to @course } format.json { render :show, status: :ok, location: @course } else format.html { render :edit } format.json { render json: @course.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @course.update(course_params)\n render_jsonapi_response(@course)\n end", "def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update(courses_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n #don't need to add user_id here.. already exists.\n \n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n begin\n @course = Course.find(params[:id])\n raise if @course.nil?\n \n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to club_course_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end", "def update\n @course.update_attributes(parama[:course])\n respond_with(@course)\n end", "def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to user_course_path(current_user,@course), notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice=> 'Curso actualizado' }\n format.json { head :ok }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @course.errors, :status=> :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n @course.user_id=current_user.id\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n format.html { redirect_to @courses, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @courses }\n\n\n end\n end", "def update\n @course.update(course_params)\n respond_with(@course, location: course_path)\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@course = @teacher.courses.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to [:teacher, @course], :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @course\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course ' + @course.course_id + ' was successfully updated!' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Admin::Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to [:admin, @course], :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to courses_path(:option=>2), notice: 'El curso fue exitosamente editado!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @course.update(course_params)\n render :show, status: :ok, location: @course\n else\n render json: @course.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_course.update(admin_course_params)\n format.html { redirect_to (params[:ref] || @admin_course), notice: t('crud.updated_successfully!', name: Admin::Course.model_name.human) }\n format.json { render :show, status: :ok, location: @admin_course }\n else\n format.html { render :edit }\n format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n \n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @course.class.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @people_course.update(people_course_params)\n format.html { redirect_to @people_course, notice: 'People course was successfully updated.' }\n format.json { render :show, status: :ok, location: @people_course }\n else\n format.html { render :edit }\n format.json { render json: @people_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @assessment_course = AssessmentCourse.find(params[:id])\n\n respond_to do |format|\n if @assessment_course.update_attributes(params[:assessment_course])\n format.html { redirect_to @assessment_course, notice: 'Assessment course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assessment_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @court = Court.find(params[:id])\n\n respond_to do |format|\n if @court.update_attributes(params[:court])\n format.html { redirect_to @court, notice: 'Court was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Curso editado satisfactoriamente' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n # format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n # format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course_request = CourseRequest.find(params[:id])\n\n respond_to do |format|\n if @course_request.update_attributes(params[:course_request])\n format.html { redirect_to @course_request, notice: 'Course request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to admin_courses_path, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to admin_course_url(@course), notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @person_course.update(person_course_params)\n format.html { redirect_to @person_course, notice: 'Person course was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_course }\n else\n format.html { render :edit }\n format.json { render json: @person_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lecture = Lecture.find(params[:id])\n @course= Course.find(params[:course_id])\n \n respond_to do |format|\n if @lecture.update_attributes(params[:lecture])\n format.html { redirect_to [@course, @lecture], notice: 'Lecture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Curso atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @study_course = StudyCourse.find(params[:id])\n\n respond_to do |format|\n if @study_course.update_attributes(params[:study_course])\n format.html { redirect_to @study_course, notice: 'Study course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n @course.update_attributes(params[:course])\n\n respond_with @course, :location => [:admin, @course]\n end", "def update\n respond_to do |format|\n if @user_course.update(user_course_params)\n format.html { redirect_to @user_course, notice: 'User course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@course = Course.find(params[:id])\n\n\t if @course.update_attributes(course_params)\n\n\t @course.major.clear\n\t @course.minor.clear\n\t @course.concentration.clear\n\t @course.distribution.clear\n\n\t params[:course][\"major_id\"].each do |major_id|\n\t if !major_id.empty?\n\t @course.major << Major.find(major_id)\n\t end\n\t end\n\n\t params[:course][\"minor_id\"].each do |minor_id|\n\t if !minor_id.empty?\n\t @course.minor << Minor.find(minor_id)\n\t end\n\t end\n\n\t params[:course][\"concentration_id\"].each do |concentration_id|\n\t if !concentration_id.empty?\n\t @course.concentration << Concentration.find(concentration_id)\n\t end\n\t end\n\n\t params[:course][\"distribution_id\"].each do |distribution_id|\n\t if !distribution_id.empty?\n\t @course.distribution << Distribution.find(distribution_id)\n\t end\n\t end\n\n\t flash[:success] = \"Successfully updated\"\n\t redirect_to :action => 'show', :id => @course\n\n\t end\n\tend", "def update\n respond_to do |format|\n if @given_course.update(given_course_params)\n format.html { redirect_to @given_course, notice: 'Given course was successfully updated.' }\n format.json { render :show, status: :ok, location: @given_course }\n else\n format.html { render :edit }\n format.json { render json: @given_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n course = Course.includes(:professors).find(params[:id])\n course.update!(course_params)\n \n course.professor_ids=(params[:professors])\n\n render json: course.to_json(include: :professors)\n end", "def update\n respond_to do |format|\n if @path_course.update(path_course_params)\n format.html { redirect_to @path_course, notice: 'Path course was successfully updated.' }\n format.json { render :show, status: :ok, location: @path_course }\n else\n format.html { render :edit }\n format.json { render json: @path_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n professor = Professor.find(params[:id])\n professor.update!(professor_params)\n\n render json: professor.to_json(include: :courses)\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n flash[:success] = 'Course was successfully updated.'\n format.html { redirect_to admin_course_path}\n format.json { render :show, status: :ok, location: send(@course) }\n else\n flash[:danger] = 'Course already exists.'\n format.html { redirect_to edit_admin_course_path(@course, admin_id: current_admin.id) }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @type_of_courses = TypeOfCourse.all\n respond_to do |format|\n if @type_of_course.update(type_of_course_params)\n format.html { redirect_to @type_of_course, notice: 'Type of course was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_of_course }\n else\n format.html { render :edit }\n format.json { render json: @type_of_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n \n if (!params[:course])\n params[:course] = {:name=>params[:title], \n :f_day=>params[:description], \n :l_day=>params[:price]\n } \n end\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @university_course.update(university_course_params)\n format.html { redirect_to @university_course, notice: 'University course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @university_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course }\n format.mobile { redirect_to @course }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.mobile { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n render action: 'edit'\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n invalid_redirect_action = updating_course_info?(params[:course]) ? \"edit\" : \"show\"\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: invalid_redirect_action }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Class was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course_section.update(course_section_params)\n format.html { redirect_to @course_section, notice: 'Course section was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course_section.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrolled_course.update(enrolled_course_params)\n format.html { redirect_to @enrolled_course, notice: 'Enrolled course was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrolled_course }\n else\n format.html { render :edit }\n format.json { render json: @enrolled_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @course_detail.update(course_detail_params)\n format.html { redirect_to @course_detail, notice: 'Course detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_detail }\n else\n format.html { render :edit }\n format.json { render json: @course_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @course\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n @tags = Tag.all\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @novanet_course.update(novanet_course_params)\n format.html { redirect_to @novanet_course, notice: 'Novanet course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @novanet_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @type_course = TypeCourse.find(params[:id])\n\n respond_to do |format|\n if @type_course.update_attributes(params[:type_course])\n format.html { redirect_to @type_course, notice: 'Type course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to courses_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @course_section\n respond_to do |format|\n if @course_section.update(course_section_params)\n format.html { redirect_to @course_section, notice: 'Course section was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_section }\n else\n format.html { render :edit }\n format.json { render json: @course_section.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @employees_course.update(employees_course_params)\n format.html { redirect_to @employees_course, notice: 'Employees course was successfully updated.' }\n format.json { render :show, status: :ok, location: @employees_course }\n else\n format.html { render :edit }\n format.json { render json: @employees_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @court.update(court_params)\n format.html { redirect_to @court, notice: 'Court was successfully updated.' }\n format.json { render :show, status: :ok, location: @court }\n else\n format.html { render :edit }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to( :back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_course.update(admin_course_params)\n format.html { redirect_to [:admin, @admin_course], notice: 'Course was successfully updated.' }\n #format.json { render :show, status: :ok, location: @admin_course }\n else\n format.html { render :edit }\n #format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.72374034", "0.7137671", "0.7121435", "0.7102951", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.708175", "0.70531946", "0.70469433", "0.6967811", "0.696716", "0.6964841", "0.6954444", "0.6949194", "0.6934083", "0.6929629", "0.6929629", "0.6929629", "0.6929629", "0.6928621", "0.6918439", "0.68971944", "0.6887663", "0.6871643", "0.6835715", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.6830851", "0.68308413", "0.6830826", "0.6815376", "0.6807256", "0.6803469", "0.68031514", "0.679686", "0.6793151", "0.6785962", "0.6782753", "0.6782753", "0.6782753", "0.6782753", "0.678097", "0.6770692", "0.6768888", "0.67602706", "0.674873", "0.67482096", "0.6704989", "0.670445", "0.66898364", "0.66820645", "0.667509", "0.6640902", "0.662763", "0.66183007", "0.6601846", "0.6592378", "0.6587889", "0.6574319", "0.65728474", "0.65707076", "0.6569678", "0.6564089", "0.6560185", "0.65587103", "0.6558379", "0.65573984", "0.6555558", "0.6550613", "0.6535997", "0.65136147", "0.64654124", "0.6464839", "0.6461915", "0.6455836", "0.64449835", "0.6439658" ]
0.0
-1
DELETE /courses/1 DELETE /courses/1.json
def destroy @course.destroy respond_to do |format| format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @Course = Course__c.find(params[:id])\n @Course.destroy\n\n respond_to do |format|\n format.html { redirect_to Courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @course = Course.find(params[:id])\r\n @course.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to courses_path }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n course_name = @course.course_id\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course ' + course_name + ' was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to coursees_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @study_course = StudyCourse.find(params[:id])\n @study_course.destroy\n\n respond_to do |format|\n format.html { redirect_to study_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to my_created_courses_path, notice: 'Course was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n puts \"WTF I GOT HERE\"\n @course = Course.find(params[:id])\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_path, notice: 'Course was successfully removed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Kurs je uspješno izbrisan. ' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Curso destruído com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lab_course = LabCourse.find(params[:id])\n @lab_course.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_courses_url }\n format.json { head :no_content }\n end\n end", "def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend", "def destroy\n @path_course.destroy\n respond_to do |format|\n format.html { redirect_to path_courses_url, notice: 'Path course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @novanet_course.destroy\n respond_to do |format|\n format.html { redirect_to novanet_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_course.destroy\n respond_to do |format|\n format.html { redirect_to admin_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.delete\n end", "def destroy\n @course = Course.find(params[:id])\n authorize! :destroy, @course\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n LearningMaterial.destroy_course(@course)\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_path(:option=>2), notice: 'El curso fue exitosamente eliminado!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @court = Court.find(params[:id])\n @court.destroy\n\n respond_to do |format|\n format.html { redirect_to courts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.where(:id=>params[:id]).first()\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_courses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @university_course.destroy\n respond_to do |format|\n format.html { redirect_to university_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content, status: :ok }\n end\n end", "def destroy\n begin\n @course = Course.find(params[:id])\n raise if @course.nil?\n \n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to club_courses_path }\n format.json { head :no_content }\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end", "def destroy\n @watercourse.destroy\n respond_to do |format|\n format.html { redirect_to watercourses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @clinical_course = ClinicalCourse.find(params[:id])\n @clinical_course.destroy\n\n respond_to do |format|\n format.html { redirect_to clinical_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.update(deleted: true)\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @first_aid_course = FirstAidCourse.find(params[:id])\n @first_aid_course.destroy\n\n respond_to do |format|\n format.html { redirect_to first_aid_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize! :destroy, @course\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_courses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @enrolled_course.destroy\n respond_to do |format|\n format.html { redirect_to enrolled_courses_url, notice: 'Enrolled course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @type_course = TypeCourse.find(params[:id])\n @type_course.destroy\n\n respond_to do |format|\n format.html { redirect_to type_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize :destroy, @course\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course_request = CourseRequest.find(params[:id])\n @course_request.destroy\n\n respond_to do |format|\n format.html { redirect_to course_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course_status = CourseStatus.find(params[:id])\n @course_status.destroy\n\n respond_to do |format|\n format.html { redirect_to course_statuses_url, :notice => 'Estado de Curso excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n current_user.enrollments.where(course_id: @course.id).first.destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_url, :flash => { :success => 'Course was successfully deleted.' } }\n format.json { head :no_content }\n end\n end", "def destroy\n @given_course.destroy\n respond_to do |format|\n format.html { redirect_to given_courses_url, notice: 'Given course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n result = Hash.new\n begin # try\n result = RegistCoursesHlp.delete(params[:id])\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def destroy\n @person_course.destroy\n respond_to do |format|\n format.html { redirect_to person_courses_url, notice: 'Person course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n flash[:success] = \"Course was successfully deleted.\"\n format.html { redirect_to admin_url(current_admin.id)}\n format.json { head :no_content }\n end\n end", "def destroy\n @course.destroy\n end", "def destroy\n @course_detail.destroy\n respond_to do |format|\n format.html { redirect_to course_details_url, notice: 'Course detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_sub_course = StudentSubCourse.find(params[:id])\n @student_sub_course.destroy\n\n respond_to do |format|\n format.html { redirect_to student_sub_courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n Course.find(params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to course_url, notice: 'Course was successfully removed.' }\n format.json { head :no_content }\n end\n # redirect_to static_pages_home_path\n end", "def destroy # simply delete single course\n begin\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end #end do\n rescue Exception => msgErr # interrogate a rescured exception\n puts msgErr #print error message\n end #end rescue\n end", "def destroy\n @people_course.destroy\n respond_to do |format|\n format.html { redirect_to people_courses_url, notice: 'People course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n \n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n format.js\n end\n end", "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.mobile { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @curriculum_course.destroy\n respond_to do |format|\n format.html { redirect_to curriculum_courses_url, notice: 'Curriculum course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.77230847", "0.77079666", "0.77079666", "0.77079666", "0.77079666", "0.76962376", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.7696043", "0.76494783", "0.76408905", "0.7619815", "0.7609345", "0.7590714", "0.75764287", "0.75692135", "0.75462914", "0.75420517", "0.75322306", "0.7522291", "0.75156885", "0.7509708", "0.7489476", "0.7485458", "0.74687713", "0.74641526", "0.74630284", "0.74558574", "0.74558574", "0.74227786", "0.74169743", "0.7414259", "0.73992723", "0.73934436", "0.73934436", "0.73816776", "0.73779315", "0.73350716", "0.7319183", "0.73014355", "0.729593", "0.7287025", "0.7287025", "0.7287025", "0.7282225", "0.72555995", "0.72491413", "0.72398365", "0.72395265", "0.7239376", "0.72244465", "0.72101367", "0.7208372", "0.72082925", "0.7190602", "0.71847165", "0.71824086", "0.7180118", "0.71787465", "0.7177156", "0.71766627", "0.71729076", "0.7164049", "0.71633387", "0.7152715" ]
0.73929405
62
Use callbacks to share common setup or constraints between actions.
def set_course @course = Course.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
Only allow a list of trusted parameters through.
def course_params params.require(:course).permit(:title, :description, :user_id, :tag_ids => []) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\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 strong_params\n params.require(:user).permit(param_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 allow_params_authentication!; end", "def whitelisted_args\n args.select &:allowed\n end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def filtered_parameters; end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def param_whitelist\n [:rating, :review]\n end", "def check_params; true; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\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 allowed?(*_)\n true\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 allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\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 permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def valid_params?; 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 url_allowlist=(_arg0); 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 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 list_params\n params.permit(:list_name)\n end", "def valid_params_request?; end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "def safelists; end", "def authorize_own_lists\n authorize_lists current_user.lists\n end", "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "def lists_params\n params.require(:list).permit(:name)\n\n end", "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "def check_params\n true\n end", "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "def filter_parameters; end", "def filter_parameters; end", "def whitelist; end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.permit(:name)\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def permitted_params\n []\n end", "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "def params(list)\n @declared_params = list\n end", "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "def allow(ids); end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def safelist; end", "def valid_for_params_auth?; end", "def default_param_whitelist\n [\"mode\"]\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 shopping_list_params\n params.require(:shopping_list).permit!\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def permitters\n @_parametrizr_permitters || {}\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def url_allowlist; end", "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "def quote_params\n params.permit!\n end" ]
[ "0.69490993", "0.6812977", "0.6801889", "0.67950445", "0.6745037", "0.6740698", "0.65270424", "0.6519444", "0.6492448", "0.6430671", "0.6430671", "0.6430671", "0.63992614", "0.6355569", "0.6354901", "0.63456345", "0.63430274", "0.63376623", "0.6327184", "0.6327184", "0.6327184", "0.6312343", "0.6298636", "0.6264699", "0.62606114", "0.6257774", "0.62360454", "0.6227809", "0.62203985", "0.6220124", "0.6208926", "0.6198754", "0.61961126", "0.61733264", "0.61565864", "0.6156045", "0.61525464", "0.6135898", "0.6120792", "0.61104727", "0.6074026", "0.60715514", "0.6061967", "0.6055065", "0.6044363", "0.60349673", "0.60197556", "0.60169685", "0.60148275", "0.6010643", "0.60085577", "0.6007718", "0.6006462", "0.6004975", "0.6004975", "0.599722", "0.599272", "0.5991751", "0.59836066", "0.5970689", "0.59686905", "0.5965213", "0.59646696", "0.59614", "0.5960139", "0.5933335", "0.5928459", "0.59223276", "0.5907845", "0.5903901", "0.5903133", "0.58924323", "0.58886814", "0.5880674", "0.5880674", "0.5880674", "0.58724785", "0.58617043", "0.5853673", "0.5843668", "0.5842991", "0.58351576", "0.5831751", "0.58289963", "0.5827831", "0.58164775", "0.5814396", "0.5814107", "0.58099633", "0.5802532", "0.5802532", "0.57996815", "0.57947254", "0.5784507", "0.57802397", "0.5776441", "0.57747304", "0.5767034", "0.5766118", "0.57619715", "0.57567734" ]
0.0
-1
EXAMPLE OUTPUT What is your name? Clair Hello, Clair, nice to meet you! CONSTRAINTS Keep the input, string concatenation and output seperate
def say_hello p "What is your name?" name = gets.chomp p "Hello, #{name}, nice to meet you!" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_name(first_name, last_name)\n # Q3 CODE HERE\n return \"#{first_name} #{last_name}\"\nend", "def introduce_yourself\n \"Hi, my name is #{name} and I am the boss. YAY!\"\n end", "def string_concat(name_1, name_2)\n puts \"I went to the concert with \" +name_1 + \" and \" + name_2 + \".\"\nend", "def sentence_maker(a_single_argument)\n output = a_single_argument.join(\" \")\n output += \".\"\n return output.capitalize!\nend", "def format_name(name, birthday)\n # prints sentence on screen and uses interprelation to pass the arguments to the statement dynamically.\n puts \"Hi #{name}, your bday is #{birthday}. Did you know that?\"\nend", "def sayhello(name, last_name='Rojas')#al hacer parametro=______ es un parametro por defecto, si no se especifica luego linea 6, me lo auto completa\n horoscope = 'capricornio'\n \"Hola #{name.capitalize} #{last_name.capitalize}. Pura Vida! #{horoscope}\" #notar que las interpolaciones estan separadas!!\nend", "def sayHello( name=\"Stranger\", adjective=\"stinky\" )\n puts \"Hello #{ adjective } #{ name }\"\n \"hotdogs hotdogs hotdogs\"\nend", "def greetings(name, info)\n full_name = name.join(' ')\n puts \"Hello, #{full_name}! Nice to have a #{info[:title]} #{info[:occupation]} around.\"\nend", "def greetings(name, details)\n string_name = name.join(' ')\n \n puts \"Hello, #{string_name}! Nice to have a #{details[:title]} #{details[:occupation]} around.\"\nend", "def sentence_maker(strings)\n concat = \"\"\n strings.each do |n|\n concat << n.to_s + \"\"\n concat = concat.chomp(\" \") << \".\"\n end\n return concat.capitlize\nend", "def essay_writer(title, name, major_accomplishment, year_of_accomplishment, thesis, pronoun)\n\tputs \"Final Assignment Essay:\\n #{title}\n\t\\n\n\t#{year_of_accomplishment} was the year of #{name}. #{major_accomplishment},\n\tdoes that ring a bell? That was all thanks to #{name}. #{thesis} \n\t\\n\n\tMuch more could be said of #{name}, but I believe in brevity. #{pronoun.capitalize} is somebody worth remembering. \n\t\"\n\t\nend", "def say_hello\nputs \"Whats your name?\"\n name = gets.strip #gets info from the user. Strip just takes away the line break\n puts \"Hello #{name}!\" #this is called INTERPOLATION\n end", "def essay_writer(title, full_name, year, contribution_sentence, pronoun)\n\t\n\tname = full_name.split(\" \")\n\tfirst_name = name[0]\n\tlast_name = name[1]\n\n\tif pronoun == \"male\"\n\t\the_she = \"he\"\n\t\thim_her = \"him\"\n\t\this_hers = \"his\"\n\telsif pronoun == \"female\"\n\t\the_she = \"she\"\n\t\thim_her = \"her\"\n\t\this_hers = \"hers\"\n\tend\n\n\tcanned_essay = \"\\n#{title}\\n\n\t\t#{full_name} was a central figure in #{year}. #{he_she.capitalize} accomplished a lot.\\n\n\t\tIt was fun learning more about #{him_her}. #{contribution_sentence}\\n\n\t\t#{last_name}'s contribution's go farther than that though, and I look forward to\\n\n\t\tlearning more about #{him_her}. After this brief study I can surly say that\\n\n\t\t#{his_hers} was a most interesting life indeed.\\n\"\n\n\tputs canned_essay\nend", "def name(namei)\n return \"hola \" + namei + \" Welcome\"#namei->name input\nend", "def sentence_maker(a_single_argument)\n items = a_single_argument.count.to_i\n output = a_single_argument.values_at(0..(items-1)).join(\" \").capitalize\n return output + \".\"\nend", "def example(first_name, last_name)\n full_name = first_name + ' ' + last_name\n \"#{first_name} #{last_name}\"\nend", "def sentence_maker (strings)\n\njoin_strings = String.new\n\n strings.each { |string| join_strings += \" \" + \"#{string}\"}\n join_strings[0] = \"\"\n join_strings[0] = join_strings[0].capitalize\n return join_strings + \".\"\n\nend", "def make_sentence(name, sport)\n puts \"Did you know #{name} likes to play #{sport}\"\nend", "def concatenation(word1, word2)\n puts \"Artist #{word1} just released their newest album, titled #{word2}.\"\nend", "def sentence_maker(my_sentence)\n result=my_sentence.shift\n my_sentence.each { |x| result= result + \" \" + x.to_s }\n result=result + \".\"\n result.capitalize!\n end", "def stuff(input)\n\twords = input.split(\" \")\n\n\twords.each do |x| \n\t\tif x == 'the' || x == 'of' || x == 'and' || x == 'is' || x == 'a'\n\t\t\telse\n\t\t\t\t@acronym << x.to_s.chars.first.upcase + \".\"\n\t\tend\n\tend\nend", "def make_sentence (height_inches, age)\n return \"I am #{height_inches} inches tall and #{age} years old\"\nend", "def write(take_input)\n string = []\n take_input.chars.each do |c|\n @dura > 0 ? string << c : string << ' '\n @dura -= 1 if c =~ /[a-z]/\n @dura -= 2 if c =~ /[A-Z]/\n end\n @paper += string.join\n \"You wrote: #{string.join}\"\n end", "def essay_writer(title, name, major_accomplishment, year_of_accomplishment, thesis, pronoun)\n\tputs \"Final Assignment Essay:\\n #{title}\n\t\\n\n\t#{date_of_accomplishment} was the year of #{name}. #{major_accomplishment.capitalize},\n\tdoes that ring a bell? That was all thanks to #{name}. \\n \n\t#{thesis} \\n\n\tMuch more could be said of #{name}. #{pronoun.capitalize} is somebody worth remembering. \n\t\"\n\t\nend", "def sentence_maker(my_sentence)\n result=my_sentence.join(\" \")\n result=result.capitalize + \".\"\n end", "def all_about_you\n# interpolate the final string with the correct variables to print a complete sentence\n puts \"What is your first name?\"\n f_name = gets.chomp\n puts \"What is your last name?\"\n l_name = gets.chomp\n puts \"What school do you go to?\"\n school = gets.chomp\n puts \"What is your favorite movie?\"\n favorite_movie = gets.chomp\n puts \"Who is your favorite music artist?\"\n music_artist = gets.chomp\n puts \"Hello, I'm f_name l_name! I attend school. My favorite movie is favorite_movie. And my favorite music artist is music_artist.\"\nend", "def full_name(first_name, last_name)\n puts \"Your full name is #{first_name + \" \" + last_name}.\"\nend", "def friendly_parrot(name, age)\n age\n \"Hello! Your name is #{name} and you are #{age} years old.\"\nend", "def name\n output = \"\"\n output += first_name + ' ' unless first_name.blank?\n output += last_name unless last_name.blank?\n output.strip\n end", "def names(name1, name2)\n puts \"Huge announcement today! #{name1} climbed #{name2}! Congratulations!\"\nend", "def shout_out_to(name)\n # name.chars.each { |c| c.upcase! }\n name = name.chars.each { |c| c.upcase! }.join\n puts 'HEY ' + name\nend", "def concat(school, person, program)\n return person + \" wants to go to \" + school + \" for \" + program + \".\"\nend", "def friendly_parrot(name, age)\n \"Hi #{name}, you're #{age} years old.\"\nend", "def format_name(first, last)\nif first.length<1 || last.length<1\n\tnil\nelse\n first = first.split.join\n last = last.split.join\n str = (first[0]+last).downcase.gsub(/[^0-9a-z]/i, '')\nend\nend", "def friendly_parrot(name, age)\n \"Hello #{name} you are #{age}\"\nend", "def fullName\n # Print 'My name is Bruce Martha Thomas'\n puts firstName secondName lastName\n end", "def friendly_parrot(name, age)\n \"Hi, Are you #{name}? You're #{age} years old.\"\nend", "def friendly_parrot (name, age)\n \"You are called #{name} and you are #{age}\"\nend", "def offer_rose (string)\r\n \"Would you take this rose, #{string}, in exchange for giving an old beggar woman shelter from the bitter cold?\" \r\nend", "def game_intro\n puts \"\\n\\nLes deux combattants vont à présent entrer dans l'aire de combat !!\\n\n Ladies and Gentlemen !!! \\n\\nA ma droite, invaincu avec plus de 32 combats à son actif. Venu tout droit de la jungle profonde ...... #{@name1} !!!\nDit, Le Vautour des Antilles !!\"\n \n\nputs \" \\n\\nA ma gauche, tout droit venu des profondeurs de l'océan de la désolation lunaire sur terre : Bobigny!!! \\nMortal Combat THP mode vous présente :\n\\n#{@name2.upcase} Le Batracien Radioactif !!!!\\n\"\nend", "def format_name(first, last)\n\tf_return = \"\"\n\tl_return = \"\"\n\tif first[0]\n\t\tf_return = first.gsub(\" \", \"\")\n\t\tf_return =f_return.gsub(/[^A-Za-z]/, '')\n\t\tf_return = f_return[0].downcase\n\telse\n\t\tf_return = \"\"\n\tend\n\tif last[0]\n\t\tl_return = last.gsub(\" \", \"\")\n\t\tl_return = l_return.gsub(/[^A-Za-z]/, '')\n\t\tl_return.downcase!\n\telse\n\t\tlast = \"\"\n\tend\n if f_return[0] && l_return[0]\n \treturn f_return+l_return\n else\n \treturn nil\n end\nend", "def sentence_maker(strings)\n sentance = \"\"\n strings.each do |word|\n sentance += word.to_s + \" \"\n end\n sentance.strip!\n sentance.capitalize + \".\"\n\nend", "def format_input\n str = ARGV[1].gsub(/[^a-zA-Z]+/, '').upcase\n divided = []\n while str.length > 0\n word = str.slice!(0, 5)\n while word.length < 5\n word += \"X\"\n end\n divided << word\n end\n divided.join ' '\nend", "def full_name(first_name, last_name, title)\n\n# #shows that at first we are not placing anything in for name\n# name = nil\n\n# #if all three are present do title then first then last\n if title && first_name && last_name\n name = title + \" \" + first_name + \" \" + last_name\n# #if first missing, title then last, with a space\n elsif title && last_name\n name = title + \" \" + last_name\n# #if title missing, first then last\n elsif first_name && last_name\n name = first_name + \" \" + last_name\n# #if only first name is in, just puts the first name\n elsif first_name\n name = first_name\n# #if anything else is put in, puts the \"oh no\" sentence\n else\n \"Oh no, that doesn't look like a name\"\n end\n# #tells the terminal to return whatever is put in the puts\n return name\nend", "def spy_name(str)\n #CREATE VARIABLES FOR VOWELS AND CONSONANTS\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n #CHANGE STRING FIRST INTO ARRAY THAT MAKES EACH WORD A VALUE THEN REVERSE THEM. \n #THEN TURN ARRAY BACK INTO STRING AND DOWNCASE ANY LETTER.\n #THEN TURN STRING BACK INTO ARRAY THAT TAKES EACH INDIVIDUAL CHARACATER AS A VALUE.\n str = str.split(' ').reverse.join.downcase\n str = str.split('')\n #CREATE TEMPORARY VARIABLE STR_NEW TO EQUEL STR THEN CHANGE BUMP EACH \n #VOWEL AND CONSONANT TO THE NEXT ONE IN LINE. \n str_new = str.map do |char|\n if vowels.include?(char)\n vowels.rotate(1)[vowels.index(char)]\n elsif consonants.include?(char)\n consonants.rotate(1)[consonants.index(char)]\n else\n char\n end\n end\n #TURN ARRAY BACK INTO STRING.\n str_new.join\nend", "def format_name(first, last)\n if first.length == 0\n p nil\n elsif last.length == 0\n p nil\n else\n first_name = first.delete(\" \")\n last_name = last.delete(\" \")\n first_init = first_name[0]\n name_temp = first_init + last_name\n name_v1 = name_temp.delete(\" \").downcase\n p name_v1\n end\nend", "def print_full_name(firstname, lastname)\n puts \"Hi \" + firstname.capitalize + \" \" + lastname.capitalize\nend", "def beam_me_up(person1, person2)\n \"The away team consists of #{person1} and #{person2}.\"\nend", "def mixture (fname, lname)\n mix_firstname = vowel_adv(fname)\n mix_firstname = const_adv(mix_firstname)\n \n mix_lastname = vowel_adv(lname)\n mix_lastname = const_adv(mix_lastname)\n \n mix_firstname = mix_firstname.capitalize\n mix_lastname = mix_lastname.capitalize\n \n tmp = mix_firstname\n mix_firstname = mix_lastname\n mix_lastname = tmp\n return \"#{mix_firstname} #{mix_lastname}\"\n \nend", "def dog_names(name_1, name_2)\n puts \"The dogs are named #{name_1} and #{name_2}.\"\n puts \"It was hard to give up #{name_1} but we got #{name_2} right after.\"\n puts \"#{name_1} was a little crazy and #{name_2} is quite mature.\"\n puts \"We're not suppose to pick favoriets but I'd pick #{name_2} over #{name_1}.\"\n puts \"\" # Added this to create a space in between the different arguments.\n end", "def shout_name\n puts \"What is your name?\"\n name = gets.chomp\n\n message = \"Hello #{name}\"\n\n if name[-1] == '!'\n puts \"#{message} Why are we screaming?\".upcase\n else\n puts message + \".\"\n end\nend", "def format_name(first, last)\n if last == '' || first == ''\n word = nil\n else\n user_name = ''\n user_name += first.gsub(' ', '').gsub(/[^0-9A-Za-z]/, '')[0]\n user_name += (last.gsub(' ','').gsub(/[^0-9A-Za-z]/, ''))\n user_name.gsub(/\\d/, '').downcase\n end\nend", "def hello\n print \"Lovely to meet you! What is your name? \\n\"\n user_name = gets.chomp\n return \"#{user_name}, it's lovely to meet you!\"\nend", "def sentence_maker(variable)\n\treturn variable.inject{|sentence, x| sentence + \" \" + x.to_s}.lstrip.capitalize + \".\"\nend", "def string(food, dessert)\n puts \"#{food.upcase} & #{dessert.upcase} is my restaurant\"\nend", "def solution(string)\n # lowers = string.scan(/[a-z]+[A-Z]/).join\n uppers = string.scan(/[A-Z][^A-Z]+/).join(' ')\n # lowers + \" \" + uppers\n # require 'pry'; binding.pry\n\nend", "def shout_out_to(name)\n # name = name.chars.each { |c| c.upcase! }.join\n name.upcase!\n puts 'HEY ' + name\nend", "def marriage(name1,name2)\n p \"Do you #{name1} take #{name2} to be your lawfully wedded partner?\"\nend", "def create_second_text_message(first_response)\n%(When I feel #{first_response}, I will also feel:\nCarefree\nPeaceful \nRelieved\nMellow\nRelaxed)\n end", "def format_name(first, last)\n if first == \"\" || last == \"\"\n return nil\n end\n new_first = first.gsub(/\\W+/,\"\")\n new_last = last.gsub(/\\W+/,\"\")\n username = new_first[0] + new_last\n username = username.downcase.gsub(/\\d/,\"\")\n\nend", "def sentence_maker(words)\n sentence = \"\"\n words.each { |word| sentence << word.to_s + \" \"}\n sentence = sentence.chomp(\" \") << \".\"\n return sentence.capitalize\nend", "def generate_username6a\n\tputs \"Give me your info in this format please:\"\n puts \"['Connor', 'Slakey', 1993]\"\n input = gets\n generate_username5(inputs)\nend", "def format_name(str)\n\tnames = str.split(\" \")\n\tformatted = \"\"\n\n\tnames.each do |name|\n\t\tformatted += name[0].upcase + name[1..-1].downcase + \" \"\n\tend\n\n\treturn formatted\n\n\t# name.each do |word|\n\t# \tword.each_char.with_index do |char, idx|\n\t# \t\tif idx == 0\n\t# \t\t\tupLetter = char.upcase\n\t# \t\t\tformatted << upLetter\n\t# \t\telse\n\t# \t\t\tdownLetter = char.downcase\n\t# \t\t\tformatted << downLetter\t\n\t# \t\tend\n\t# \tend\n\t# end\n\t# return formatted.join(\"\")\n\t# print formatted\nend", "def format_name(first, last)\n return nil if first.empty? || last.empty?\n first.gsub! (/[^a-z]/i, \"\")\n last.gsub! (/[^a-z]/i, \"\")\n ((first.split(\" \").join[0]<<last).split(\" \").join.downcase)\n\nend", "def say_hello_3 name1=\"Bill\", name2=\"Ted\"\n \"hello, #{name1} and #{name2}\"\nend", "def titleize(sentence)\n counter = 0\n entered_sentence_titled = ''\n break_apart = sentence.split\n counter = break_apart.size\n\n break_apart.each_with_index do |word, index|\n word[0] = word.chr.upcase\n entered_sentence_titled << word\n entered_sentence_titled << \" \" if index < counter - 1\n # binding.pry\n end\n puts entered_sentence_titled\nend", "def greetings(name_arr, info_hsh)\n name = name_arr.join(\" \")\n \"=> Greetings, #{info_hsh[:title]} #{name}! I can see that you are a mighty fine #{info_hsh[:occupation]}.\"\nend", "def alias_creator(name)\n puts \"Your name backwards is #{name.split(' ').rotate!.join(' ')}.\"\nend", "def greetings(names, info)\n \"Hello, #{names.join(' ')}! Nice to have a \" +\n \"#{info[:title]} #{info[:occupation]} around.\"\nend", "def complete_sentence(animal1, animal2)\n p \"The #{animal1} chased the #{animal2}\"\nend", "def full_name\n puts \"Hello I am #{@first_name} #{@last_name}\"\n end", "def say_happy_birthday_to(name)\n puts \"Happy Birthday #{name}!\"\nend", "def praise_person(name)\n puts \"#{name} is amazing\"\n puts \"#{name} is talented\"\nend", "def essay_writer( title, thing, year, thesis, type )\n \n if type.thing == \"male\" or type.thing == \"female\"\n \tword1 = type.single.capitalize + \" did a lot. \"\n \tname = thing.split\n \tword2 = name[0]\n else\n \tword1 = \"I find \" + type.single + \" facinating. \"\n \tword2 = thing\n end \n\n # title\n puts title\n\n # blank line\n puts\n\n # first sentence\n print thing + \" was an important \" + type.thing + \" in \" + year.to_s + \". \"\n\n # second sentence\n print word1\n\n # third sentence\n print \"I want to learn more about \" + type.object + \". \"\n\n # thesis\n print thesis + \" \"\n\n # last sentence\n puts word2 + \"'s contribution is important.\"\n\nend", "def format_text(result)\n final_names = \"\"\n counter = 0\n result.each_with_index do |names, counter|\n if counter < result.length - 1\n final_names += \"#{names[0]} #{names[1]}, \"\n else\n final_names += \"#{names[0]} #{names[1]}\"\n end\n end\n if result.length == 1\n birthday_phrase = \"A jeKnowledge deseja um feliz aniverário a: #{final_names} continua o óptimo trabalho!\"\n else\n birthday_phrase = \"A jeKnowledge deseja um feliz aniversário a: #{final_names} continuem o óptimo trabalho!\"\n end\n end", "def sentence_maker(strings)\n\n new_string = strings[0]\n i = 1\n while i < strings.length\n new_string = new_string + \" \" + strings[i].to_s\n i += 1\n end\n new_string = new_string + \".\"\n return new_string.capitalize\nend", "def essay_writer(title, person, date, thesis_statement, gender)\n\nif gender == \"female\"\n pronoun_1 = \"she\"\n pronoun_2 = \"her\" \nelse \n pronoun_1 = \"he\"\n pronoun_2 = \"his\"\nend \n \n\"#{title}\n \n #{person.capitalize} was important in #{date}. #{pronoun_1.capitalize} were great because of #{pronoun_2} work. #{thesis_statement}.\" \n \n end", "def sentence_maker(words)\r\n\tsentence = ''\r\n\ti = 0\r\n\r\n\twhile i < words.length\r\n\t\tif i == 0 \r\n\t\t\tsentence = sentence + words[i].to_s.capitalize + ' '\r\n\t\t\ti += 1\r\n\t\telsif i == (words.length - 1)\r\n\t\t\tsentence = sentence + words[i].to_s + '.'\r\n\t\t\ti += 1\r\n\t\telse\r\n\t\t\tsentence = sentence + words[i].to_s + ' '\r\n\t\t\ti += 1\r\n\t\tend\r\n\tend\r\n\tp sentence\r\nend", "def say_goodnight(name)\r\n \"Dobranoc #{ name.capitalize }\"\r\nend", "def strings(team1, team2)\n p \"I think the #{team1} are better than the #{team2}.\"\nend", "def full_name \r\n [firstname, surname].join(\" \") \r\n end", "def hello2 name2\n 'good day ' + name2\nend", "def full_name1(first, last)\n first + \" \" + last\nend", "def name\n \"#{ forename } #{ surname }\"\n end", "def format_name(first, last)\n\n if first.length == 0\n p nil\n elsif last.length == 0\n p nil\n else\n # this will remove all empty spaces\n first_name = first.gsub(/[^A-Za-z]/,\"\")\n last_name = last.gsub(/[^A-Za-z]/, \"\")\n # this will get the first letter in first name\n first_inlast = first_name[0]\n # this will return the first letter of the name + the last name\n full_name = first_inlast + last_name\n # this will return the full name lowercased along with deleting white spaces\n lowercase_name = full_name.downcase\n # remove_allcharacters = full_name.gsub(/[^a-zA-Z0-9\\-]/,\"\")\n p lowercase_name\n end\nend", "def concatenation (blow_dryer_setting, male_first_name)\n puts \"but my friends call me #{blow_dryer_setting} #{male_first_name}\"\nend", "def string_conc(dog, cat)\n p \"#{dog} #{cat} around the house.\"\nend", "def introduce\n puts \"Hi my name is #{name} and I am #{age} years old\"\n end", "def introduction(name)\n\t pharase =\"Hi, my name is #{name}.\"\n\t puts pharase\nend", "def sentence_maker(array_of_strings)\n\t# Declare new sentence variable and set to \"\"\n\tsentence = \"\"\n\t# Capitalize first word in array\n\tarray_of_strings[0].to_s.capitalize!\n\t# For each member of array_of_strings, add to the sentence variable (converting to string)\n\tfor num in 0..(array_of_strings.length - 1)\n\t\t\tsentence += array_of_strings[num].to_s\n\t\t# unless the member of the array is the last member of array_of_strings_, add a space after the word\n\t\tunless num == (array_of_strings.length - 1)\n\t\t\tsentence += \" \"\n\t\tend\n\tend\n\t# End the sentence variable with a period\n\tsentence += \".\"\n\t# Return the sentence variable\n\treturn sentence\nend", "def format_name(str)\n parts = str.split(\" \")\n print parts\nend", "def shout(phrase)\n return \"#{phrase.upcase} !!!!\"\n #return \"#{phrase}!!!!\".upcase\nend", "def aliasMaker(name)\r\n\tnewName = []\r\n\tnewName2 = []\r\n\tvowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\r\n\tconsonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\r\n\tstep1 = name.split(\" \")\r\n\ti = 0\r\n\tj = 0\r\n\r\n\twhile i <= step1.length\r\n\t\tnewName.push(step1[i])\r\n\t\ti += 1\r\n\tend\r\n\tnewName = newName.reverse\r\n\tnewName = newName.join(\" \")\r\n\tstep2 = newName\r\n\twhile j <= step2.length\r\n\t\tif isConsonant(step2[j]) == true\r\n\t\t\tnewName2.push(nextConsonant(step2[j]))\r\n\t\telsif isVowel(step2[j]) == true\r\n\t\t\tnewName2.push(nextVowel(step2[j]))\r\n\t\telse newName2.push(step2[j])\r\n\t\tend\r\n\t\tj += 1\r\n\tend\r\n\tanswer = newName2.join(\"\")\r\n\r\nend", "def full_name(first_name, last_name)\n p \"Your full name is #{first_name} #{last_name}.\"\nend", "def badge_maker(name) #method that takes a name and returns \"Hello, my name is <name>\"\r\n \"Hello, my name is #{name}.\"\r\nend", "def sentence_maker(words)\n sentence = \"\"\n words.each { |word|\n word = word.to_s\n if word == words.first.to_s #cap if word is first in sentence\n sentence << (word.capitalize)\n else\n sentence << word\n end\n\n if word == words.last #period after last word, otherwise space\n sentence << \".\"\n else\n sentence << \" \"\n end\n }\n sentence\nend", "def sentence_maker(strings)\n return strings.join(' ').capitalize + '.'\nend", "def full_name(first_name, last_name)\n # concatenation\n # first_name.capitalize + \" \" + last_name.capitalize\n # interpolation\n \"#{first_name.capitalize} #{last_name.capitalize}\"\nend", "def create_multi_name\n base_name = String.new(Faker::Games::ElderScrolls.creature)\n if base_name.split.size == 1\n adjective = Spicy::Proton.adjective.capitalize\n new_name = base_name.split.unshift(adjective)\n new_name.join(' ')\n else\n return base_name\n end\n end", "def users_pet\n return \"Few Lines on my pet.\\nI have a #{@pet_name} at my home.\\nIt is #{@pet_size} in size.\\nIt has #{@pet_color} color.\\nIt is #{@pet_class} animal.\"\n end", "def fake_name_c2(real_name)\n\treal_full_name = real_name.split(\" \")\n\treal_first_name = real_full_name[0] \n\treal_last_name = real_full_name[1]\n\ti = 0\n\tfake_first_name = \"\"\n\tfake_last_name = \"\"\n\tvowel_index = \"\"\n\tlength_first = real_first_name.length\n\tlength_last = real_last_name.length \n\t\twhile i < length_last\n\t\tif real_last_name[i] == \"z\"\n\t\t\tfake_last_name += \"a\"\n\t\telsif real_last_name[i] == \"a\" || real_last_name[i] ==\"e\" || \n\t\t\t real_last_name[i] == \"i\" || real_last_name[i] == \"o\" || \n\t\t\t real_last_name[i] == \"u\"\n\t\t\tfake_last_name += real_last_name[i] \n\t\telse \n\t\t\tfake_last_name += real_last_name[i].next \n\t\tend \n\t\ti+=1\n\tend\n\tfake_last_name\nend" ]
[ "0.68104285", "0.6732113", "0.6697524", "0.6653155", "0.6610109", "0.6574876", "0.6562749", "0.6556261", "0.65466225", "0.6512053", "0.65084684", "0.65050846", "0.6500953", "0.6483936", "0.6477636", "0.6473342", "0.6472008", "0.6466545", "0.6452884", "0.643852", "0.6438458", "0.6435744", "0.6433551", "0.6388972", "0.6366186", "0.63051796", "0.6282299", "0.6281155", "0.6279961", "0.6267203", "0.6265278", "0.6263987", "0.6263252", "0.6250662", "0.6243543", "0.6241144", "0.62283075", "0.622535", "0.6223101", "0.6222478", "0.622136", "0.62184143", "0.6213969", "0.62095684", "0.6198426", "0.61974055", "0.6192821", "0.61870605", "0.61848605", "0.6181151", "0.61754596", "0.6173799", "0.6167643", "0.6163218", "0.6154782", "0.6153281", "0.61474043", "0.6146177", "0.61415005", "0.61399245", "0.6135855", "0.61232084", "0.6115095", "0.6108488", "0.610168", "0.6097313", "0.60950726", "0.60944754", "0.6089809", "0.60803384", "0.6078152", "0.6072243", "0.60691845", "0.6066873", "0.6063994", "0.6053985", "0.60471314", "0.6043081", "0.6040514", "0.60392886", "0.60357374", "0.6025561", "0.60250944", "0.6024797", "0.6020551", "0.60192305", "0.6018866", "0.6015317", "0.6015185", "0.60145295", "0.60129994", "0.60129726", "0.6001754", "0.59957075", "0.5995587", "0.59953475", "0.59931374", "0.59928787", "0.599156", "0.59843516", "0.59826106" ]
0.0
-1
Given a hash with numeric values, return the key for the smallest valu
def key_for_min_value(hash) lowest_key = nil lowest_value = Float::INFINITY hash.each do |key, value| if value < lowest_value lowest_value = value lowest_key = key end end lowest_key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |k, v|\n if v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n smallest_value = nil\n smallest_key = nil\n hash.each do |name, num|\n if smallest_value == nil || num < smallest_value\n smallest_value = num\n smallest_key = name\n end\n end\n smallest_key\nend", "def key_for_min_value(hash)\n min_val = Float::INFINITY\n min_key = nil\n hash.each do |key, value|\n if value < min_val\n min_val = value\n min_key = key\n end\n end\n min_key\nend", "def key_for_min_value(hash)\n \n min_val = Float::INFINITY\n min_key = nil\n hash.each do |k, v|\n if min_val > v\n min_val = v\n min_key = k\n end\n end\n return min_key\nend", "def key_for_min_value(hash)\n smallest = nil\n key = nil\n hash.collect do |name, val|\n if smallest == nil || val < smallest\n smallest = val\n key = name\n end\n end\n key\nend", "def key_for_min_value(hash)\n smallest_key = nil\n tiny_value = nil\n hash.each do |key, value|\n if tiny_value == nil || value < tiny_value\n tiny_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "def key_for_min_value(hash)\n int_hash = hash.select { |key, val| val.class == Fixnum }\n smallest = int_hash[int_hash.keys.sample]\n # debugger\n int_hash.each do |key, val|\n if val < smallest\n smallest = val \n end\n end\n int_hash.key(smallest)\nend", "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = 0\n\n\n hash.each do |key,value|\n if lowest_value == 0 || value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\r\n smallest_key = nil\r\n tiniest_value = nil\r\n hash.each do |key, value|\r\n if tiniest_value == nil || value < tiniest_value\r\n tiniest_value = value\r\n smallest_key = key\r\n end\r\n end\r\n smallest_key\r\nend", "def key_for_min_value(hash)\n min = nil\n hash.each_pair do |key, value|\n min ||= value\n min = value if value < min\n end\n hash.key(min)\nend", "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k, v|\n if lowest_value == nil || v < lowest_value\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n if hash.empty?\n return nil\n end\n ans = [hash.first[0],hash.first[1]]\n hash.each do |k,v|\n if v < ans[1]\n ans[1] = v\n ans[0] = k\n end\n end\n return ans[0]\nend", "def key_for_min_value(hash)\n smallest_key = nil\n tiniest_value = nil\n hash.each do |key, value|\n if tiniest_value == nil || value < tiniest_value\n \n # this way, the smallest value in the hash so far always overwrites the existing tiniest value\n \n tiniest_value = value\n smallest_key = key\n end\n end\n smallest_key\nend", "def key_for_min_value(hash)\n smallest = nil\n hash.each do |key, value|\n if smallest == nil\n smallest = key\n end\n if hash[key] < hash[smallest]\n smallest = key\n end\n end\n smallest\nend", "def key_for_min_value(hash)\n hash_key = nil\n hash_value = nil\n hash.each do |key, value|\n if hash_value == nil || value < hash_value\n hash_value = value\n hash_key = key\n end\n end\n hash_key\nend", "def key_for_min_value(hash)\n min_key = nil\n hash.each do |key, value|\n if min_key.nil?\n min_key = key\n elsif value < hash[min_key]\n min_key = key\n else\n next\n end\n end\n min_key\nend", "def key_for_min_value(hash)\n min_key = nil\n hash.each do |key, value|\n if min_key.nil?\n min_key = key\n elsif value < hash[min_key]\n min_key = key\n else\n next\n end\n end\n min_key\nend", "def key_for_min_value(hash)\n min = 99999999\n min_key = nil\n hash.select do |key, value|\n if value < min\n min = value\n min_key = key\n end\n end\n min_key\nend", "def key_for_min_value(name_hash)\n lowestnum = 1000\n name_hash.each_value do |hashvalue|\n if hashvalue < lowestnum\n lowestnum = hashvalue\n end\n end\n name_hash.index(lowestnum)\nend", "def key_for_min_value(hash)\n key = nil\n lowest_value = nil\n hash.each do |name, value|\n if lowest_value == nil || value < lowest_value\n lowest_value = value\n key = name\n end\nend\nkey\nend", "def key_for_min_value(hash)\n hash_key = nil\n hash_value = nil\n hash.each do |a, b|\n if hash_value == nil || b < hash_value\n hash_value = b\n hash_key = a\n end\n end\n hash_key\nend", "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil \n hash.each do |key, value|\n if lowest_value == nil || value < lowest_value \n lowest_value = value \n lowest_key = key \n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_number = nil\n name_hash.each do |name, number|\n if lowest_number == nil || number < lowest_number\n lowest_number = number\n lowest_key = name\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = nil\n hash.each do |k,v|\n # first iteration\n ## this creates a starting point for comparison\n if lowest_value == nil || lowest_value > v\n lowest_value = v\n lowest_key = k\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n low_min = 1000\n min_key = nil\n hash.each do |key, value|\n if(low_min > value)\n low_min = value\n min_key = key\n end\nend\n min_key\nend", "def key_for_min_value(hash)\n lo_key = nil \n lo_value = nil \n hash.each do |k,v| \n if lo_key == nil || v < lo_value\n lo_key = k \n lo_value = v \n end \n end \n lo_key\n end", "def key_for_min_value(name_hash)\n low = Float::INFINITY\n name_hash.each do |k,v|\n if v < low\n low = v\n end\n end\n name_hash.key(low)\nend", "def key_for_min_value(hash)\n i = 0\n lowest1 = :key\n lowest = 0\n if hash.empty? == true \n return nil\n end\n hash.each do |name, value|\n if i == 0\n lowest1 = name\n lowest = value\n i =+ 1\n end\n if value < lowest\n lowest1 = name\n lowest = value\n end\n if hash.empty? == true \n lowest1 = nil\n end\n end\n lowest1\nend", "def key_for_min_value(name_hash)\n lowest = nil\n key = nil\n if name_hash.length == 0\n return \n end\n \n name_hash.each do |name, number|\n if lowest == nil\n lowest = number\n end\n if key == nil\n key = name\n end\n if number < lowest\n lowest = number\n key = name\n end\n end\n key\nend", "def key_for_min_value(hash)\n least_value = nil \n least_key = nil\n hash.each do |a, b|\n if least_value == nil || b < least_value\n least_value = b\n least_key = a\n end\n end\n least_key\nend", "def key_for_min_value(hash)\n return nil if hash.empty?\n arr = hash.collect {|key, value| value}.sort\n hash.each {|key, value| return key if value == arr[0]}\nend", "def key_for_min_value(hash)\n array = []\n hash.each do |key, value|\n array << value\n end\n array.sort!\n hash.key(array[0])\nend", "def key_for_min_value(hash)\n small_key = nil\n small_value = nil\n \n hash.each do |key, value|\n if small_value == nil || value < small_value\n small_value = value\n small_key = key\n end\nend\nsmall_key\nend", "def key_for_min_value(hash)\n value_only_array = []\n hash.each_pair do |key, value|\n value_only_array << value\n end\n value_only_array.sort!\n hash.key(value_only_array[0])\nend", "def key_for_min_value(hash)\n\n lowest_key = nil \n lowest_value = nil \n \n hash.each do |key,value|\n if lowest_value == nil || lowest_value > value\n\n lowest_key = key\n lowest_value = value \n end \n \n end \n lowest_key\nend", "def key_for_min_value(name_hash)\n\tif name_hash == {}\n\t\tnil\n\tend\n\n\tsmallest_key = nil\n\tsmallest_value = nil\n\tname_hash.each do |key, value|\n\t\tif !smallest_value || value < smallest_value\n\t\t\tsmallest_key = key\n\t\t\tsmallest_value = value\n\t\tend\n\tend\n\tsmallest_key\nend", "def key_for_min_value(name_hash)\n lowest = \"\"\n lowest = nil if name_hash.empty?\n high_num = 100000000000000000\n name_hash.each do | key, value |\n lowest = key if value < high_num\n high_num = value if value < high_num\n end\n lowest\nend", "def key_for_min_value(hash)\n if hash.count < 2\n return hash[0]\n else \n num = 42\n hash.each do |key, value|\n if value <= num\n num = value\n end\n end\n hash.invert[num] \n end\nend", "def key_for_min_value(name_hash)\n empty_hash = nil\n lowest_value = 10000000000000000000000\n name_hash.collect do |name, value|\n if value < lowest_value\n lowest_value = value\n empty_hash = name\n end\n end\n empty_hash\nend", "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n name_hash.each do |name, amount|\n if amount < lowest_value\n lowest_value = amount\n lowest_key = name\n end\n end\n lowest_key\n end", "def key_for_min_value(name_hash)\n small_num = Float::INFINITY\n smallest_key = \"\"\n if name_hash.length == 0\n return nil\n end\n name_hash.each do |key, value|\n if value < small_num\n small_num = value\n smallest_key = key\n end\n end\nsmallest_key\nend", "def key_for_min_value(name_hash)\n lowest_key = nil\n lowest_value = nil\n name_hash.each do |name, num|\n if lowest_key == nil || num < lowest_value\n lowest_key = name\n lowest_value = num\n elsif name_hash == nil\n nil\n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n lowestId = nil\n lowestNum = 0\n name_hash.each{ |id, val|\n if lowestNum == 0 \n lowestNum = val\n end\n if val <= lowestNum\n lowestNum = val\n lowestId = id\n end\n }\n return lowestId\nend", "def key_for_min_value(name_hash)\n lowest_key=nil\n lowest_value=Float::INFINITY\n name_hash.each{|key, value| \n if value<lowest_value\n lowest_value=value\n lowest_key=key\n end\n }\n lowest_key\nend", "def key_for_min_value(name_hash)\n smallest_val = 0\n smallest_key = nil\n name_hash.each do|key, val|\n if smallest_val == 0 || val < smallest_val\n smallest_val = val\n smallest_key = key\n end\n end\n smallest_key\n\nend", "def key_for_min_value(name_hash)\n return nil if name_hash.empty?\n lowest_number = name_hash.first[1];\n key_value = \"\"\n name_hash.each do |key, value|\n if value <= lowest_number\n lowest_number = value\n key_value = key\n end\n end\n key_value\nend", "def key_for_min_value(name_hash)\n num = nil\n name_hash.collect do |key, value|\n if value < num\n num = value\n end\n end \n name_hash.key(num)\nend", "def key_for_min_value(name_hash)\n lowest_key=nil\n lowest_val=0\n name_hash.collect do |key,value|\n if value<lowest_val or lowest_val==0\n lowest_key=key\n lowest_val=value\n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n lowest_key = nil\n lowestvalue = 1000\n name_hash.each do |name, value|\n if value < lowestvalue\n lowest_key = name\n lowestvalue = value\n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n rkey = nil\n rvalue = 10000000000000000\n name_hash.each do |key, value|\n if value < rvalue\n rkey = key\n rvalue = value\n end\n end\n rkey\nend", "def key_for_min_value(name_hash)\n low_key = nil\n low_value = nil\n name_hash.each do |k, v|\n if low_value == nil || v < low_value\n low_value = v\n low_key = k\n end\n end\n low_key\n end", "def key_for_min_value(name_hash)\n current = 0\n lowest = 0\n lowest_key = nil\n name_hash.collect do |key, value|\n current = value\n if current < lowest || lowest == 0\n lowest = current\n lowest_key = key\n end\n\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n lowest=\"\"\n lowest=nil if name_hash.empty?\n tracker=100000000\n name_hash.each do |key,value|\n lowest=key if value<tracker\n tracker=value if value<tracker\n # if value<tracker\n end\n lowest\nend", "def key_for_min_value(name_hash)\n smallest_val = 0\n smallest_key = 0\n comp = nil\n name_hash.each do |key,val|\n comp = val\n if smallest_key == 0\n smallest_key = key\n smallest_val = val\n end \n if comp < smallest_val\n smallest_val = comp\n smallest_key = key\n end\n end\n if smallest_key == 0 \n return nil \n else\n return smallest_key\n end\nend", "def key_for_min_value(hash)\n \n if hash.empty?\n return nil\n end\n min_value=500\n min_key=:symbol\n \n hash.each do |key, value|\n if value<min_value\n min_value=value\n min_key=key\n end\n end\n return min_key\nend", "def key_for_min_value(name_hash)\n smallest_hash_key = nil\n name_hash.each do |key, val|\n if smallest_hash_key == nil\n smallest_hash_key = key\n next\n elsif val < name_hash[smallest_hash_key]\n smallest_hash_key = key\n end\n end\n smallest_hash_key\nend", "def key_for_min_value(name_hash)\n smallest = nil\n this_num = 0\n previous_num = 1000000\n name_hash.collect { |item, qty|\n this_num = qty\n if this_num < previous_num\n smallest = item\n previous_num = this_num\n end\n }\n smallest\nend", "def key_for_min_value(hash)\n return nil if hash.empty?\n arr = hash.collect { |k, v| v }.sort\n hash.each { |k, v| return k if v == arr[0] }\nend", "def key_for_min_value(name_hash)\n\tsmallest_value = nil\n\tassociated_key = nil \n\tname_hash.collect do |key, value|\n\t\tif smallest_value == nil || value < smallest_value\n\t\t\tsmallest_value = value \n\t\t\tassociated_key = key\n\t \tend\n\tend\n\tassociated_key\nend", "def key_for_min_value(hash)\n # binding.pry\n lowest_key = nil\n lowest_value = 0\n # binding.pry\n hash.each do |key, value|\n if lowest_key == nil || value < lowest_value\n # binding.pry\n lowest_value = value\n lowest_key = key\n # binding.pry\n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n low_key = nil\n low_value = nil\n name_hash.each do |n, s|\n if low_value == nil\n low_value = s\n low_key = n\n elsif low_value > s\n low_value = s\n low_key = n\n end\n end\n low_key\nend", "def key_for_min_value(hash)\n lowest_value = nil\n lowest_key = nil\n\n hash.each do |key, value|\n if lowest_value == nil # tell me if this makes sense\n lowest_value = value\n lowest_key = key\n elsif lowest_value > value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key #you want to return the key for min\nend", "def key_for_min_value(hash)\n aa = 1000000000\n i = nil\n hash.each do |key, value|\n if value <= aa\n aa = value\n i = key\n end\n end\n return i\nend", "def key_for_min_value(name_hash)\n key = \"\"\n low_value = nil\n if name_hash.empty? == true\n return nil\n end\n name_hash.each do |name, number|\n if low_value == nil || number < low_value\n low_value = number\n key = name\n end\n end\n key\nend", "def key_for_min_value(name_hash)\n small_value = 10000000000\n small_key = nil\n name_hash.each do |k,v|\n if v < small_value\n small_value = v\n small_key = k\n end\n end\n small_key\nend", "def key_for_min_value(name_hash)\n nums = name_hash.collect do |item, num|\n num\n end\n nums.sort!\n nums[0]\n \n min_key = nil\n name_hash.map do |item, num|\n if num == nums[0]\n min_key = item\n end\n end\n min_key\nend", "def key_for_min_value(name_hash)\n lowestKey = nil\n lowestValue = Float::INFINITY\n name_hash.each do |k, v|\n if v < lowestValue\n lowestValue = v\n lowestKey = k\n end\n end\n lowestKey\n\nend", "def key_for_min_value(name_hash)\n lowest_v = nil\n lowest_k = nil\n name_hash.each do |name, value|\n if lowest_v == nil\n lowest_v = value\n lowest_k = name\n elsif value < lowest_v\n lowest_v = value\n lowest_k = name\n end\n end\n lowest_k\n end", "def key_for_min_value(name_hash)\n vals = name_hash.collect { |key, value| value }\n keys = name_hash.collect { |key, value| key }\n low = vals[0]\n lowkey = keys[0]\n if name_hash.empty?\n nil\n else\n name_hash.collect do |key, value|\n if value < low\n low = value\n lowkey = key\n end\n end\n lowkey\n end\nend", "def key_for_min_value(name_hash)\n return nil if name_hash == nil || name_hash == {}\n number_array = name_hash.collect do |name, number|\n number\n end\n number_array.sort!\n name_hash.key(number_array[0])\nend", "def key_for_min_value(name_hash)\nlowest = 1000000\n low_key = nil\n name_hash.each {|key, value|\n if value < lowest\n lowest = value\n low_key = key\n end\n }\n low_key\nend", "def key_for_min_value(hash)\n array = []\n hash.each {|key,value| \n if array.empty? || value < array[1] \n array[0] = key \n array[1] = value \n end }\n if !array.empty? \n array.first \n else \n nil \n end\nend", "def key_for_min_value(my_hash)\n #what is my value?\n lowest_value = 500\n lowest_key = nil\n\n my_hash.collect do |key, value|\n # what is my value?\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n if name_hash.length == 0 \n nil\n else\n smallest_num = nil\n smallest_num_key = nil\n name_hash.collect do |key, value|\n if smallest_num == nil\n smallest_num = value\n smallest_num_key = key\n elsif smallest_num > value\n smallest_num = value\n smallest_num_key = key\n end\n end\n smallest_num_key\n end\n\nend", "def key_for_min_value(name_hash)\n low_val = (2**(0.size * 8 - 2) - 1) # largest posible fixnum\n low_key = nil\n\n name_hash.each do |key, value|\n value.nil? ? nil : (low_val > value ? (low_val = value; low_key = key) : nil)\n end\n low_key\nend", "def key_for_min_value(name_hash)\n minKey = nil\n minVal = 2 ** (64 - 2) - 1\n name_hash.each {|key, value|\n if value < minVal\n minVal = value\n minKey = key\n end}\n minKey\nend", "def key_for_min_value(name_hash)\n # saves the smaller value in memo, and takes the first elem of memo at the end (the key)\n smallest = name_hash.inject do|memo, (k, v)|\n memo = v < memo[1] ? [k,v] : memo\n end\n #handle the empty hash case...\n smallest ? smallest[0] : nil\nend", "def key_for_min_value(name_hash)+\n low = 9999\n key = nil\n name_hash.each do |name, value| \n if value < low\n low = value\n key = name\n end\n end\n return key\nend", "def key_for_min_value(name_hash)\n low=10000000000000000000\n return_key=nil\n name_hash.each do |key, value|\n if value<low\n low=value\n return_key=key\n end\n end\n return_key\nend", "def smallest_key(q, hash)\n\t\ttemp = {}\n\t\tq.each do |v|\n\t\t\ttemp[v] = hash[v]\n\t\tend\n\t\treturn temp.key(temp.each_value.min)\n\tend", "def key_for_min_value(name_hash)\n value1 = 0\n lowestKey = nil\n name_hash.each do |key, value|\n if(value1 == 0)\n value1 = value\n lowestKey = key\n end\n if(value1 > value)\n value1 = value\n lowestKey = key\n elsif (value1 < value)\n lowestKey = lowestKey\n value1 = value1\n end\n end\n return lowestKey\nend", "def key_for_min_value(name_hash)\n low_number = nil\n key_value = nil\n name_hash.collect do |name, value|\n if low_number == nil || value < low_number\n low_number = value\n key_value = name\n end\n end\n key_value\nend", "def key_for_min_value(hash)\n if hash.length == 0\n return nil\n else\n smallest = 1000\n printme = \"\"\n hash.each do |thing, number|\n if number < smallest\n smallest = number\n printme = thing\n end\n end\n printme\n end\nend", "def key_for_min_value(name_hash)\n lowest_value = 0\n lowest_key = \"\"\n if name_hash.empty? == true\n nil\n else\n name_hash.each_with_index do |(key, value), i|\n if i == 0\n lowest_value = value\n lowest_key = key\n elsif value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\n end\nend", "def key_for_min_value(name_hash)\n lowest_value = nil\n key_value = nil\n name_hash.collect do |name, number|\n if lowest_value == nil || number < lowest_value\n lowest_value = number\n key_value = name\n end\n end\n key_value\nend", "def key_for_min_value(name_hash)\n smallest_key = nil\n smallest_value = nil\n name_hash.each do |j, r|\n if smallest_value == nil || r < smallest_value\n smallest_value = r\n smallest_key = j\n end\n end\n smallest_key\nend", "def key_for_min_value(name_hash)\n lowest_num = 1000000000\n lowest_num_key = \" \"\n if name_hash == {}\n return nil\n else\n name_hash.each do |name, num|\n if num < lowest_num\n lowest_num = num\n lowest_num_key = name\n end\n end\n return lowest_num_key\n end\nend", "def key_for_min_value(name_hash)\n lowest_value = nil\n lowest_key = nil\nname_hash.each do |name, number|\n if !lowest_value|| number < lowest_value\n lowest_value = number\n lowest_key = name\nend\nend\nlowest_key\nend", "def key_for_min_value(name_hash)\n lowest_key = nil\n name_hash.each_key do |key|\n if lowest_key == nil\n lowest_key = key\n elsif name_hash[key] < name_hash[lowest_key]\n lowest_key = key\n end\n end\n lowest_key\nend", "def key_for_min_value(name_hash)\n\n if name_hash.empty?\n return nil\n end\n lowest = Float::INFINITY\n name_hash.each_pair do |k, v|\n if v < lowest\n lowest = v\n end\n end\n name_hash.each_pair do |k, v|\n if v == lowest\n return k\n end\n end\nend", "def key_for_min_value(name_hash)\n key_of_smallest_value = \"\"\n smallest_value = 99999\n name_hash.each do |key, value|\n if smallest_value > value\n smallest_value = value\n key_of_smallest_value = key\n end\n end\n if name_hash.size == 0\n key_of_smallest_value = nil\n end\n key_of_smallest_value\nend", "def key_for_min_value(name_hash)\n low_key = nil\n low = nil\n name_hash.collect do |key, value|\n if low == nil || low > value\n low = value\n low_key = key\n end\n end\n low_key\nend", "def key_for_min_value(name_hash)\n smallest_value = 100\n name_hash.each do |key, value| \n if value < smallest_value\n smallest_value = value \n end \n end\n name_hash.key(smallest_value)\nend", "def key_for_min_value(name_hash)\n if name_hash == {}\n return nil\n end\n lowest_number = nil\n name_hash.collect do |name, value|\n if lowest_number == nil\n lowest_number = value\n elsif lowest_number > value\n lowest_number = value\n end\n end\n \n name_hash.each do |name, value|\n if lowest_number == value\n return name\n end\n end\nend", "def key_for_min_value(name_hash)\n lowest_number= nil \n lowest_key=nil\nname_hash.collect do |key, int|\n if lowest_number==nil || int<lowest_number \n lowest_number=int\n lowest_key=key\n end\n end\n return lowest_key\nend", "def key_for_min_value(name_hash)\n min_value = 10**10\n low_key = nil\n\n name_hash.each do |name_key, value|\n if value < min_value\n min_value = value\n low_key = name_key\n end\n end\n low_key\nend", "def key_for_min_value(hash)\n hash.key(hash.values.min)\nend", "def key_for_min_value(hash)\n hash.key(hash.values.min)\nend", "def key_for_min_value(name_hash)\n lowest_value = 100000\n stored_key = nil\n if (name_hash.empty?)\n return nil\n else\n array = name_hash.each do |key, value|\n if (value < lowest_value)\n lowest_value = value\n stored_key = key\n end\n end\n end\n return stored_key\nend" ]
[ "0.86987203", "0.86949843", "0.8660648", "0.8621884", "0.8582308", "0.8569927", "0.85285586", "0.85255176", "0.84987754", "0.8477007", "0.8472328", "0.8472328", "0.8453883", "0.8446745", "0.84344155", "0.84309626", "0.8410307", "0.8410307", "0.8408448", "0.8407354", "0.83905816", "0.83849084", "0.83773404", "0.836724", "0.8357212", "0.83205914", "0.83176047", "0.8308182", "0.8306506", "0.8304246", "0.8303933", "0.83038235", "0.8296995", "0.82906467", "0.8285363", "0.8265126", "0.82646537", "0.82609963", "0.82566816", "0.82541656", "0.8250098", "0.82410103", "0.8238575", "0.8232177", "0.82234037", "0.8218019", "0.82150155", "0.82149476", "0.8214298", "0.82123154", "0.8211781", "0.8209733", "0.8202375", "0.8197943", "0.8197372", "0.819452", "0.81927097", "0.8180932", "0.81726515", "0.8172584", "0.81724036", "0.81694245", "0.8169004", "0.81673056", "0.81667435", "0.81667346", "0.815978", "0.8154028", "0.8153346", "0.814546", "0.8143318", "0.81417567", "0.81398684", "0.8136696", "0.81350434", "0.8132928", "0.81310815", "0.8130706", "0.8130003", "0.81297", "0.81282395", "0.8124191", "0.8124164", "0.8119376", "0.8118865", "0.8114648", "0.81119967", "0.81106114", "0.81086767", "0.8106475", "0.8101656", "0.8100436", "0.80978894", "0.80965126", "0.80957836", "0.809491", "0.80948514", "0.80927896", "0.80927896", "0.80921984" ]
0.8727882
0
GET /estimates/1 GET /estimates/1.json
def show @estimate = Estimate.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @estimate } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @estimates = Estimate.all\n end", "def index\n @estimates = Estimate.all\n end", "def retrieve_estimates_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimates ...'\n end\n # resource path\n local_var_path = '/v1/estimates'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EstimateListResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearer_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EstimatesApi#retrieve_estimates\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def retrieve_estimates(opts = {})\n data, _status_code, _headers = retrieve_estimates_with_http_info(opts)\n data\n end", "def new\n @estimate = Estimate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estimate }\n end\n end", "def index\n @estimates = current_user_company.estimates.search(params[:query]).order(created_at: :desc).paginate(page: params[:page], per_page: 20)\n @query = params[:query]\n end", "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interests }\n end\n end", "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "def index\n @estimate_line_items = EstimateLineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @estimate_line_items }\n end\n end", "def show\n @user_ticket_estimate = UserTicketEstimate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_ticket_estimate }\n end\n end", "def index\n @incomes = Income.all\n\n respond_to do |format|\n format.json { render json: @incomes }\n end\n end", "def index\n @investments = Investment.all\n\n render json: {investments: @investments}, root: false\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def index\n @points_spents = PointsSpent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_spents }\n end\n end", "def index\n render :json => UserInterest.all\n end", "def show\n simulation = Simulation.retrieve_by_id(params[:id])\n\n render json: simulation\n end", "def create\n @estimate = Estimate.new(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to root_path, notice: 'Estimate was successfully created.' }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @analysis = Analysis.find(params[:id])\n\n # Get all the relevant rows from the view stack\n estimates = execute <<-SQL\n select * from estimate_factors_analyses_categorized\n where analysis_name='#{@analysis.analysis_name}';\n SQL\n\n # Turn them into a map for handy fetching\n @estimates = {}\n @used_estimates = {}\n estimates.each do |estimate|\n @estimates[estimate['input_zone_id']+'@'+estimate['analysis_year']] = estimate\n @used_estimates[estimate['input_zone_id']] = true\n end\n\n respond_to do |format|\n format.html {\n render layout: 'fullscreen'\n }\n format.json { render json: @analysis }\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 @expenses = find_expenses.all\n render json: @expenses\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 index\n @expenses = Expense.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end", "def index\n @employer_studies = @university.employer_studies.page(params[:page])\n @studies = @employer_studies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employer_studies }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interest }\n end\n end", "def index\n @funds = Fund.all\n\n render json: @funds\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "def index\n @investments = Investment.all\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @interest }\n end\n end", "def index\n @monthly_interests = MonthlyInterest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @monthly_interests }\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 create\n @estimate = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to @estimate, notice: 'Estimate was successfully created.' }\n format.json { render json: @estimate, status: :created, location: @estimate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\r\n @stats = Stat.all\r\n @statsu = Stat.where(calculation_id: params[:id])\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @stats }\r\n end\r\n end", "def index\n @illnesses = Illness.all\n\n render json: @illnesses\n end", "def index\n @estimated_hours = Estimated_hour.all\n end", "def show\n @estimate_line_item = EstimateLineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estimate_line_item }\n end\n end", "def set_estimate\n @estimate = Estimate.find(params[:id])\n end", "def set_estimate\n @estimate = Estimate.find(params[:id])\n end", "def index\n @interests = Interests.for_person(@person)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @interests }\n end\n end", "def get_one\n test_data = @test.get_one\n return render json: test_data\n end", "def show\n render json: @investment, root: false\n end", "def retrieve_estimate_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimate ...'\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 EstimatesApi.retrieve_estimate\"\n end\n # resource path\n local_var_path = '/v1/estimates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EstimateResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearer_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EstimatesApi#retrieve_estimate\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @efforts = Effort.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @efforts }\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 @investigations = Investigation.where(:visible => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @investigations }\n end\n end", "def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend", "def index\n @person_expense_records = PersonExpenseRecord.all\n\n render json: @person_expense_records\n end", "def create\n @resource = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to estimates_url, notice: 'estimate was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @expectation = Expectation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expectation }\n end\n end", "def get_api_results(_url)\n JSON.parse File.read('spec/inspector/stubbed_example.json')\n end", "def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend", "def update\n @estimate = Estimate.find(params[:id])\n\n respond_to do |format|\n if @estimate.update_attributes(params[:estimate])\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @monthly_interest = MonthlyInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monthly_interest }\n end\n end", "def index\n @assertions = Assertion.all.sample(10)\n\n respond_to do |format|\n format.html\n format.json { render json: @assertions }\n end\n end", "def show\n @income = Income.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @income }\n end\n end", "def index\n @incomes = current_company.incomes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @incomes }\n end\n end", "def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end", "def index\n @api_v1_mentorship_interests = Api::V1::MentorshipInterest.all\n end", "def show\n @points_spent = PointsSpent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @points_spent }\n end\n end", "def index\n @illnesses = Illness.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @illnesses }\n end\n end", "def index\n @historicals = @project.historical\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @historicals }\n end\n end", "def destroy\n @estimate = Estimate.find(params[:id])\n @estimate.destroy\n\n respond_to do |format|\n format.html { redirect_to estimates_url }\n format.json { head :no_content }\n end\n end", "def show\n @approximate_service = ApproximateService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @approximate_service }\n end\n end", "def show\n @test_summary = TestSummary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_summary }\n end\n end", "def index\n sanitized_params = parse_params(simulation_where_params)\n simulations = Simulation.find_all(sanitized_params)\n\n render json: simulations\n end", "def index\n \n @interests = Interest.find(@interestsId)\n \n if params[:persona_id] == nil \n @interests = Interest.order(:name) \n end\n \n respond_to do |format|\n format.json { render :json => @interests }\n end\n end", "def index\n getProfile\n @consents = TherapistConsent.where('therapist_id = ? ', @therapist.id)\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render :status => 200, :json => { action: 'index', consents: @consents }}\n end\n end", "def index \n @calculation = Calculation.all # retrieve all calculations from calculations table \n json_response(@calculation) # respond with the array of calculations\n end", "def show\n @transit_score = TransitScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transit_score }\n end\n end", "def index\n @trades = Trade.order('created_at desc') - Trade.rejected_trades\n @all_accepted_trades = Trade.accepted_trades\n\n @test = Trade.accepted_trades_stipulations(@all_accepted_trades)\n\n @stipulations_cap = Stipulation.cap_space.for_year(current_year)\n @stipulations_draft = Stipulation.draft_spots.for_year(current_year)\n @stipulations_players = Stipulation.player.for_year(current_year)\n @stipulations_other = Stipulation.other.for_year(current_year)\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trades }\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 show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end", "def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\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 puts \"Index method called...\"\n @studies = Study.all\n\n # render json: @studies\n end", "def show\n @person_interest = PersonInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_interest }\n end\n end", "def index\n @other_studies = @university.other_studies.page(params[:page])\n @studies = @other_studies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @other_studies }\n end\n end", "def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end", "def show\n @explaination = Explaination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @explaination }\n end\n end", "def index\n @data_points = DataPoint.recent # cached_recent\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_points }\n end\n end", "def index\n @area = Area.find(params[:area_id])\n @city = @area.city\n\n @rates = Rate.where(\"area_id = ?\",params[:area_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rates }\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 show\n @simulation_market = SimulationMarket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simulation_market }\n end\n end", "def show\n @historical = Historical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historical }\n end\n end", "def index\n @trades = Trade.all\n render json: @trades\n end", "def index *_\n @trades = owned_trades_view\n\n render json: @trades\n end", "def show\n @daily_statistic = DailyStatistic.find(params[:id])\n\n render json: @daily_statistic\n end", "def create\n @estimate = current_user_company.estimates.build(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to @estimate, notice: t('.estimate_was_successfully_created') }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\r\n @attestations = Attestation.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @attestations }\r\n end\r\n end", "def index\n @trades = Trade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trades }\n end\n end", "def index\n @approvals = Approval.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @approvals }\n end\n end", "def index\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @leases }\n end\n end", "def show\n @experience_history = ExperienceHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experience_history }\n end\n end", "def index\n @expenses = Expense.all\n respond_with @expenses\n end", "def index\n @studies = Study.all\n #render json: @studies\n end", "def index\n @tests = Test.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tests }\n end\n end", "def show\n @income_entry = IncomeEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @income_entry }\n end\n end", "def index\n @employments = Employment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employments }\n end\n end", "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end", "def show\n @traces = Trace.find_by(id: params[:id])\n url_string = ''\n response = HTTParty.get(url_string)\n data = {\n \"latitude\": @traces.latitude,\n \"longitude\": @traces.longitude,\n \"elevation\": response.body.to_i\n }\n render json: data\n end" ]
[ "0.7323198", "0.7323198", "0.67951244", "0.6603065", "0.6570356", "0.64702016", "0.6095763", "0.60942274", "0.6083348", "0.60623455", "0.6042251", "0.60322577", "0.5974085", "0.5931608", "0.5878422", "0.5875207", "0.58408123", "0.58300257", "0.5828794", "0.5823716", "0.5823203", "0.5820413", "0.5819872", "0.58185655", "0.5815541", "0.5804246", "0.58038616", "0.5793204", "0.578223", "0.5776371", "0.57664925", "0.5760841", "0.5755675", "0.5755042", "0.57541764", "0.57494164", "0.57494164", "0.57422966", "0.5737292", "0.5727771", "0.5727314", "0.5709819", "0.5703748", "0.5701949", "0.568977", "0.56896484", "0.5681077", "0.56647384", "0.56586355", "0.56584454", "0.565217", "0.5646741", "0.5643953", "0.56422335", "0.5641647", "0.56409615", "0.5639346", "0.56387603", "0.56324035", "0.5630962", "0.5625994", "0.56246984", "0.5621689", "0.56098163", "0.5609383", "0.56067646", "0.560006", "0.5591575", "0.55825627", "0.55799115", "0.55797935", "0.55797935", "0.55664885", "0.5566318", "0.5565635", "0.556425", "0.5558341", "0.5547999", "0.55444664", "0.55422515", "0.5535159", "0.55299294", "0.5526896", "0.5525756", "0.5524291", "0.5522378", "0.5512694", "0.55094117", "0.5506179", "0.5502197", "0.5501297", "0.54945576", "0.54781675", "0.54761523", "0.54748774", "0.5473607", "0.5471601", "0.54690814", "0.54678154", "0.546767" ]
0.7521585
0
GET /estimates/new GET /estimates/new.json
def new @estimate = Estimate.new respond_to do |format| format.html # new.html.erb format.json { render json: @estimate } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def create\n @resource = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to estimates_url, notice: 'estimate was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @income }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def new\n @expectation = Expectation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expectation }\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 @historical = Historical.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historical }\n end\n end", "def new\n @person_interest = PersonInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_interest }\n end\n end", "def new\n @observation = Observation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end", "def new\n @observation = Observation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end", "def create\n @estimate = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to @estimate, notice: 'Estimate was successfully created.' }\n format.json { render json: @estimate, status: :created, location: @estimate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @curve = Curve.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @curve }\n end\n end", "def new\n @interesting = Interesting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interesting }\n end\n end", "def new\n @arrival = Arrival.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @arrival }\n end\n end", "def new\n @arrival = Arrival.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @arrival }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interest }\n end\n end", "def new\n @average = Average.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @average }\n end\n end", "def new\n @transit_score = TransitScore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @transit_score }\n end\n end", "def create\n @estimate = Estimate.new(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to root_path, notice: 'Estimate was successfully created.' }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @points_history = PointsHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @points_history }\n end\n end", "def new\n @money = Money.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @money }\n end\n end", "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lease }\n end\n end", "def new\n @predict = Predict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @predict }\n end\n end", "def new\n @income_entry = IncomeEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @income_entry }\n end\n end", "def new\n @explaination = Explaination.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @explaination }\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 @estimate_line_item = EstimateLineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estimate_line_item }\n end\n end", "def new\n @recent_transaction = RecentTransaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recent_transaction }\n end\n end", "def new\n @fundamentals_history = FundamentalsHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fundamentals_history }\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 @interests = Interests.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interests }\n end\n end", "def new\n @exp = Exp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exp }\n end\n end", "def new\n @seed = Seed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seed }\n end\n end", "def new\n @interested = Interested.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interested }\n end\n end", "def new\n @investigation = Investigation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @investigation }\n end\n end", "def new\n @event_interest = EventInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_interest }\n end\n end", "def new\n @financial = Financial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @financial }\n end\n end", "def new\n @essay = Essay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @essay }\n end\n end", "def new\n @historial = Historial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial }\n end\n end", "def new\n @offset = Offset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @offset }\n end\n end", "def new\n @annual_stat = AnnualStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @annual_stat }\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 @settlement_history = Settlement::History.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @settlement_history }\n end\n end", "def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end", "def new\n @incomestock = Incomestock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incomestock }\n end\n end", "def new\n @user_ticket_estimate = UserTicketEstimate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_ticket_estimate }\n end\n end", "def new\n @have = Have.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @have }\n end\n end", "def new\n @finance = Finance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finance }\n end\n end", "def new\n @lineup = Lineup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lineup }\n end\n end", "def new\n @arrival_range = ArrivalRange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @arrival_range }\n end\n end", "def new\n @experience_history = ExperienceHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experience_history }\n end\n end", "def new\n @portfolio = Portfolio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @portfolio }\n end\n end", "def new\n @simulation = Simulation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @simulation }\n end\n end", "def new\n @absence = Absence.new\n @title = \"New Absence\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @absence }\n end\n end", "def new\n @addimition = Addimition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @addimition }\n end\n end", "def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trial }\n end\n end", "def new\n @gage = Gage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gage }\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\n @anniversary = Anniversary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @anniversary }\n end\n end", "def new\n @approximate_service = ApproximateService.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @approximate_service }\n end\n end", "def new\n @trend = Trend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trend }\n end\n end", "def new\n @spend = Spend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spend }\n end\n end", "def new\n @basis = Base.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @basis }\n end\n end", "def new\n @intern = Intern.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @intern }\n end\n end", "def new\n @income = Income.new\n\n respond_to do |format|\n format.json { render json: @income }\n format.js\n end\n end", "def new\n @pay = Pay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pay }\n end\n end", "def new\n @interest_area = InterestArea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest_area }\n end\n end", "def new\n @trade = Trade.new\n\n render json: @trade\n end", "def new\n @trend = Trend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @trend }\n end\n end", "def new\n @invest = Invest.new\n @invest.seq = get_next_seq(Invest)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invest }\n end\n end", "def new\n @estacionamiento = Estacionamiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estacionamiento }\n end\n end", "def new\n @stable = Stable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stable }\n end\n end", "def new\n @settlement = Settlement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @settlement }\n end\n end", "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stat }\n end\n end", "def new\n @stats_money_transaction = Stats::MoneyTransaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stats_money_transaction }\n end\n end", "def new\n @examination = Examination.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @examination }\n end\n end", "def new\n @calculation = Calculation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @calculation }\n end\n end", "def new\n @assert = Assert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assert }\n end\n end", "def new\n @assert = Assert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assert }\n end\n end", "def new\n @estudiante = Estudiante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estudiante }\n end\n end", "def new\n @calculated_data_assessment = CalculatedDataAssessment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @calculated_data_assessment }\n end\n end", "def new\n @target_age = TargetAge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @target_age }\n end\n end", "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @stat }\n end\n end", "def new\n @trade = Trade.new\n @trade.stipulations.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trade }\n end\n end", "def new\n @datum = Datum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datum }\n end\n end", "def new\n @datum = Datum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datum }\n end\n end", "def new\n @test_summary = TestSummary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_summary }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @summary }\n end\n end", "def new\n @hold_date = HoldDate.new\n @customer_names = Customer.all(:order => 'last_name ASC')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hold_date }\n end\n end", "def new\n @visitation = Visitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visitation }\n end\n end", "def new\n @get = Get.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @get }\n end\n end", "def new\n @annex = Annex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @annex }\n end\n end", "def new\n @test_weight = TestWeight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_weight }\n end\n end", "def new\n @effort = Effort.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @effort }\n end\n end", "def new\n @weekly_expectation = WeeklyExpectation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weekly_expectation }\n end\n end", "def new\n @title = t('view.trust_funds.new_title')\n @trust_fund = TrustFund.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trust_fund }\n end\n end", "def new\n @lost = Lost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lost }\n end\n end" ]
[ "0.70564336", "0.70256335", "0.697581", "0.67708963", "0.67598325", "0.673785", "0.6693691", "0.66905004", "0.66465515", "0.66363513", "0.6626176", "0.6626176", "0.6620286", "0.6598921", "0.65976405", "0.65867835", "0.65867835", "0.65558636", "0.6547752", "0.65472966", "0.6544824", "0.6524586", "0.6521782", "0.65015924", "0.65010583", "0.6496574", "0.6495018", "0.6481649", "0.6479176", "0.6449106", "0.64468616", "0.6445751", "0.6445751", "0.6433586", "0.64315546", "0.64241976", "0.6420932", "0.63958824", "0.63943225", "0.63758624", "0.63747317", "0.63723916", "0.63719076", "0.636704", "0.63641477", "0.6362785", "0.6362672", "0.6362186", "0.6359797", "0.6359317", "0.6346365", "0.6343748", "0.63377756", "0.6330186", "0.6327947", "0.63216174", "0.6321595", "0.6319685", "0.6313773", "0.6313304", "0.63094205", "0.63034165", "0.6302828", "0.6300682", "0.6299299", "0.6298816", "0.62980884", "0.6292559", "0.6287932", "0.6285922", "0.6281008", "0.62791467", "0.6276792", "0.62741077", "0.6272709", "0.6269254", "0.6266358", "0.62659687", "0.62640554", "0.62611294", "0.62605613", "0.62605613", "0.6256728", "0.62561065", "0.6254921", "0.62537575", "0.6252799", "0.6249936", "0.6249936", "0.62440765", "0.62425315", "0.6241185", "0.62406677", "0.6239504", "0.62383753", "0.62382025", "0.6238188", "0.6235449", "0.62343967", "0.6233076" ]
0.7816572
0
POST /estimates POST /estimates.json
def create @estimate = Estimate.new(params[:estimate]) respond_to do |format| if @estimate.save format.html { redirect_to @estimate, notice: 'Estimate was successfully created.' } format.json { render json: @estimate, status: :created, location: @estimate } else format.html { render action: "new" } format.json { render json: @estimate.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @estimate = Estimate.new(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to root_path, notice: 'Estimate was successfully created.' }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @estimate = current_user_company.estimates.build(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to @estimate, notice: t('.estimate_was_successfully_created') }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @resource = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to estimates_url, notice: 'estimate was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @estimates = Estimate.all\n end", "def index\n @estimates = Estimate.all\n end", "def new\n @estimate = Estimate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estimate }\n end\n end", "def create\n @estimation = Estimation.new(estimation_params)\n\n respond_to do |format|\n if @estimation.save\n format.html { redirect_to @estimation, notice: t(\"notice.created\") }\n format.json { render :show, status: :created, location: @estimation }\n else\n format.html { render :new }\n format.json { render json: @estimation.errors, status: :unprocessable_entity }\n end\n end\n end", "def retrieve_estimates_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimates ...'\n end\n # resource path\n local_var_path = '/v1/estimates'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EstimateListResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearer_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EstimatesApi#retrieve_estimates\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n authorize @project, :estimate_new?\n \n if estimate_params[:estimateble_id].present?\n params[:id], params[:type] = estimate_params[:estimateble_id].split('-')\n set_estimatable\n end\n\n create_estimate(estimate_params)\n success = false\n @estimate.transaction do\n success = @estimate.save\n success = @estimateble.save && success\n end\n respond_to do |format|\n if success\n format.html { redirect_to @project, notice: 'Estimate was successfully created.' }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def retrieve_estimates(opts = {})\n data, _status_code, _headers = retrieve_estimates_with_http_info(opts)\n data\n end", "def save_estimate(estimate_request)\n estimate = estimate_request.estimate\n\n self.date = Time.now\n self.order_type = estimate.type\n self.estimate = estimate\n self.customer = estimate.customer\n self.carrier = estimate_request.carrier\n self.contact = estimate_request.contact\n self.origin_port = estimate.origin_port\n self.destination_port = estimate.destination_port\n self.origin_address = estimate.origin_address\n self.origin_city = estimate.origin_city\n self.origin_province = estimate.origin_province\n self.origin_zip = estimate.origin_zip\n self.origin_country = estimate.origin_country\n self.destination_address = estimate.destination_address\n self.destination_city = estimate.destination_city\n self.destination_province = estimate.destination_province\n self.destination_zip = estimate.destination_zip\n self.destination_country = estimate.destination_country\n self.imo = estimate.imo\n self.imo_class = estimate.imo_class\n self.imo_un = estimate.imo_un\n self.shipment_type = estimate.shipment_type\n self.shipments_per_month = estimate.shipments_per_month\n self.equipment_20_dv = estimate.equipment_20_dv\n self.equipment_20_ot = estimate.equipment_20_ot\n self.equipment_20_rf = estimate.equipment_20_rf\n self.equipment_20_fr = estimate.equipment_20_fr\n self.equipment_40_dv = estimate.equipment_40_dv\n self.equipment_40_hc = estimate.equipment_40_hc\n self.equipment_40_rf = estimate.equipment_40_rf\n self.equipment_40_fr = estimate.equipment_40_fr\n self.temperature = estimate.temperature\n self.stowage_factor = estimate.stowage_factor\n self.loading_laytime = estimate.loading_laytime\n self.unloading_laytime = estimate.unloading_laytime\n self.email_subject = estimate_request.email_subject\n self.email_content = estimate_request.email_content\n self.email_additional_content = estimate_request.email_additional_content\n self.comments = (!estimate.comments.blank? ? estimate.comments : \"\")\n if not estimate.comments.blank? and not estimate_request.comments.blank?\n self.comments << \"\\n\\n\"\n end\n self.comments << (!estimate_request.comments.blank? ? estimate_request.comments : \"\")\n self.save!\n\n estimate.estimate_items.each do |estimate_item|\n order_item = self.order_items.build\n order_item.estimate_item = estimate_item\n order_item.quant_type = estimate_item.quant_type\n order_item.number_of_items = estimate_item.number_of_items\n order_item.weight = estimate_item.weight\n order_item.size_type = estimate_item.size_type\n order_item.length = estimate_item.length\n order_item.width = estimate_item.width\n order_item.height = estimate_item.height\n order_item.diameter = estimate_item.diameter\n order_item.description = estimate_item.description\n order_item.description2 = estimate_item.description2\n# order_item.save!\n self.order_items << order_item\n end\n self.save!\n end", "def estimate_params\n params.require(:estimate).permit(:value, :estimateble_id)\n end", "def estimate_params\n params.require(:estimate).permit(:currently_listed, \n :prop_owner_name, \n :contact_name, \n :email, \n :phone, \n :street, \n :street2, :city, \n :state, \n :zip, \n :beds, \n :baths, \n :home_sf,\n :prop_sf, \n :num_garages, \n :pool, \n :spa, \n :upgrades, \n :damage, \n :photo, \n :tod_call, \n :status,\n :subtitle\n )\n end", "def show\n @estimate = Estimate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estimate }\n end\n end", "def index\n @estimates = current_user_company.estimates.search(params[:query]).order(created_at: :desc).paginate(page: params[:page], per_page: 20)\n @query = params[:query]\n end", "def create\n\n @estimation = Estimation.new(estimation_params)\n #Estimation.generation_new_item(params[:estimation])\n respond_to do |format|\n if @estimation.save\n format.html { redirect_to estimations_url, notice: 'Estimation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @estimation }\n else\n format.html { render action: 'new' }\n format.json { render json: @estimation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @estadium = Estadium.new(estadium_params)\n\n respond_to do |format|\n if @estadium.save\n format.html { redirect_to @estadium, notice: 'Estadium was successfully created.' }\n format.json { render :show, status: :created, location: @estadium }\n else\n format.html { render :new }\n format.json { render json: @estadium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: t('.estimate_was_successfully_updated') }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_ticket_estimate = UserTicketEstimate.new(params[:user_ticket_estimate])\n\n respond_to do |format|\n if @user_ticket_estimate.save\n format.html { redirect_to @user_ticket_estimate, notice: 'User ticket estimate was successfully created.' }\n format.json { render json: @user_ticket_estimate, status: :created, location: @user_ticket_estimate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_ticket_estimate.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 estimation_params\n params.require(:estimation).permit(:dm_number, :organization_name, :nursery_name, :postal_code, :address1, :address2, :phone, :email, :responder, :nursery_id, :total_sum, :coupon_code, :fax)\n end", "def mock\n transactions = JSON.parse(File.read(Rails.root.join('data', 'synthetic.json')))\n\n deposits, withdrawals = transactions.map { |transaction| OpenStruct.new(transaction) }.partition { |transaction| transaction.amt > 0 }\n deposit_mean = deposits.sum(&:amt) / deposits.length.to_f\n withdrawal_mean = withdrawals.sum(&:amt) / withdrawals.length.to_f\n\n deposit_stdev = Math.sqrt(deposits.map { |deposit| (deposit.amt - deposit_mean)**2 }.sum / deposits.length)\n withdrawal_stdev = Math.sqrt(withdrawals.map { |withdrawal| (withdrawal.amt - withdrawal_mean)**2 }.sum / withdrawals.length)\n\n json = {\n transactions: transactions,\n summary: {\n income: {\n period: (90.days / deposits.length.to_f) / (60 * 60 * 24),\n mean: deposit_mean,\n stdev: deposit_stdev\n },\n expenses: {\n period: (90.days / withdrawals.length.to_f) / (60 * 60 * 24),\n mean: withdrawal_mean,\n stdev: withdrawal_stdev\n }\n }\n }\n\n render plain: JSON.pretty_generate(json), content_type: :json\n end", "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_estimate\n @estimate = Estimate.find(params[:id])\n end", "def set_estimate\n @estimate = Estimate.find(params[:id])\n end", "def create\n @investment = Investment.new(investment_params)\n\n if @investment.save\n render json: @investment, status: :created\n else\n render json: @investment.errors, status: :unprocessable_entity\n end\n end", "def estimate_params\n params.require(:estimate).permit(:site_name, :link, :value)\n end", "def update\n @estimate = Estimate.find(params[:id])\n\n respond_to do |format|\n if @estimate.update_attributes(params[:estimate])\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def estimate_params\n params.require(:estimate).permit(:company_information_id, :prospect_id, :title, :customer_id, :customer_name, :issue_date, :due_date, :due_date_pending_flag, :payment_term, :effective_date, :tax_rate, :remarks, :user_profile_id, :submitted_flag, :ordered_flag, estimate_details_attributes: [:id, :_destroy, :display_order, :product_id, :product_name, :quantity, :unit_price])\n end", "def create\n @trip = Trip.new(trip_params)\n authorize @trip\n @trip.submitter = current_account.accountable\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to home_index_path, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_funding_and_estimates\n self.save_without_validating\n end", "def index\n @investments = Investment.all\n\n render json: {investments: @investments}, root: false\n end", "def rate_estimates(shipment, options: RateEstimateOptions.new, debug: false)\n rate_request_xml = SerializeRateRequest.call(shipment: shipment, login: login, options: options)\n request = build_request(api: :rates, xml: rate_request_xml, debug: debug)\n\n client.post(request).bind do |response|\n ParseRateResponse.call(response: response, request: request, shipment: shipment, options: options)\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 @investigated = Investigated.new(investigated_params)\n\n respond_to do |format|\n if @investigated.save\n format.html { redirect_to @investigated, notice: 'Investigated was successfully created.' }\n format.json { render :show, status: :created, location: @investigated }\n else\n format.html { render :new }\n format.json { render json: @investigated.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_estimate\n @estimate = Estimate.find_by!(id: params[:id], company_information: current_user_company)\n end", "def create\n puts \"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\"\n @investment = Investment.new(amount:params[:amount])\n\n respond_to do |format|\n if @investment.save\n format.html { redirect_to @investment, notice: 'Investment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @investment }\n else\n format.html { render action: 'new' }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @estimate = Estimate.find(params[:id])\n @estimate.destroy\n\n respond_to do |format|\n format.html { redirect_to estimates_url }\n format.json { head :no_content }\n end\n end", "def accept(params = {})\n call('estimate.accept', params)\n end", "def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.create_mass_estimate ...'\n end\n # verify the required parameter 'create_mass_estimate_request' is set\n if @api_client.config.client_side_validation && create_mass_estimate_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_mass_estimate_request' when calling EstimatesApi.create_mass_estimate\"\n end\n # resource path\n local_var_path = '/v1/estimates/mass'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(create_mass_estimate_request) \n\n # return_type\n return_type = opts[:return_type] || 'EstimateResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearer_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EstimatesApi#create_mass_estimate\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @estimate.destroy\n respond_to do |format|\n format.html { redirect_to estimates_url, notice: 'Estimate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @estimate.destroy\n respond_to do |format|\n format.html { redirect_to estimates_url, notice: 'Estimate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @interest = Interest.new(params[:interest])\n \n respond_to do |format|\n if @interest.save\n format.json { render :json => @interest,\n :status => :created, :location => @interest }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def register_estimate(params)\n # half-hour increments\n params.update(:user_estimate => [1, (params[:user_estimate].to_f * 2).round].max)\n\n if params[:user_estimate] > 0 # check to make sure that the user's estimate is meaningful\n a = most_recent_analysis_succeeded\n veritable_estimate = a.predict(stringify_hash_keys(params).update(\n 'true_time' => nil, # this is what we're predicting\n 'user_class' => params[:user_class]\n ))['true_time']\n Task.create(params.update(:veritable_estimate => veritable_estimate))\n end\nend", "def create\n @job_site = JobSite.find(params[:job_estimate][:job_site_id])\n @customer = Customer.find(@job_site.customer_id)\n @job_estimate = @job_site.job_estimates.create(job_estimate_params)\n\n respond_to do |format|\n if @job_estimate.save\n format.html { redirect_to customer_job_site_job_estimates_path(:customer_id=>@customer.id,:job_site_id => @job_site.id), notice: 'Job estimate was successfully created.' }\n format.xml { render :xml => @job_estimate, :status => :created, :location => [@job_site, @job_estimate] }\n else\n format.html { render action: 'new' }\n format.json { render json: @job_estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n respond_to do |format|\n if @estimate.destroy\n format.html { redirect_to estimates_url, notice: t('.estimate_was_successfully_destroyed') }\n else\n format.html { redirect_to estimates_url, notice: t('.estimate_was_fail_destroyed') }\n end\n format.json { head :no_content }\n end\n end", "def create\n @approximate_service = ApproximateService.new(params[:approximate_service])\n\n respond_to do |format|\n if @approximate_service.save\n format.html { redirect_to(@approximate_service, :notice => 'ApproximateService was successfully created.') }\n format.xml { render :xml => @approximate_service, :status => :created, :location => @approximate_service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @approximate_service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def estimate_item_params\n params.require(:estimate_item).permit(:estimate_id, :title, :price, :order)\n end", "def index\n @trades = Trade.order('created_at desc') - Trade.rejected_trades\n @all_accepted_trades = Trade.accepted_trades\n\n @test = Trade.accepted_trades_stipulations(@all_accepted_trades)\n\n @stipulations_cap = Stipulation.cap_space.for_year(current_year)\n @stipulations_draft = Stipulation.draft_spots.for_year(current_year)\n @stipulations_players = Stipulation.player.for_year(current_year)\n @stipulations_other = Stipulation.other.for_year(current_year)\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trades }\n end\n end", "def create\n @qborentestimate = Qborentestimate.new(params[:qborentestimate])\n\n respond_to do |format|\n if @qborentestimate.save\n format.html { redirect_to edit_qborentestimate_path(@qborentestimate), notice: 'Qestimate was successfully created.' }\n format.json { render json: @qborentestimate, status: :created, location: @qborentestimate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qborentestimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @user_ticket_estimate = UserTicketEstimate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_ticket_estimate }\n end\n end", "def create\n @api_v1_mentorship_interest = Api::V1::MentorshipInterest.new(api_v1_mentorship_interest_params)\n\n respond_to do |format|\n if @api_v1_mentorship_interest.save\n format.html { redirect_to @api_v1_mentorship_interest, notice: 'Mentorship interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentorship_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentorship_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def company_eps_estimates_with_http_info(symbol, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.company_eps_estimates ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_client.config.client_side_validation && symbol.nil?\n fail ArgumentError, \"Missing the required parameter 'symbol' when calling DefaultApi.company_eps_estimates\"\n end\n # resource path\n local_var_path = '/stock/eps-estimate'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'symbol'] = symbol\n query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EarningsEstimates' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#company_eps_estimates\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n redirect_to new_estimation_path\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, :notice => 'Interest was successfully created.' }\n format.json { render :json => @interest, :status => :created, :location => @interest }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def test_post_request_collection\n params = {\n size: 3,\n employmentTypeUris: ['/dk/atira/pure/person/employmenttypes/academic'],\n employmentStatus: 'ACTIVE'\n }\n response = client.persons.all_complex params: params\n assert_equal response.code, 200\n assert_instance_of HTTP::Response, response\n end", "def index\n @estimate_line_items = EstimateLineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @estimate_line_items }\n end\n end", "def create_flight_estimate_with_http_info(create_flight_estimate_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.create_flight_estimate ...'\n end\n # verify the required parameter 'create_flight_estimate_request' is set\n if @api_client.config.client_side_validation && create_flight_estimate_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_flight_estimate_request' when calling EstimatesApi.create_flight_estimate\"\n end\n # resource path\n local_var_path = '/v1/estimates/flight'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(create_flight_estimate_request) \n\n # return_type\n return_type = opts[:return_type] || 'EstimateResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearer_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EstimatesApi#create_flight_estimate\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @points_spents = PointsSpent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_spents }\n end\n end", "def save\n\t\t\tinvestor = params[:investor][:id].present? ? Investor.find(params[:investor][:id]) : Investor.new\n\t\t\tresult = investor.save_with_params params[:investor]\n\n\t\t\treturn render json: result if result[:status] != 0\n\n\t\t\trender json: {\n\t\t\t\tstatus: 0,\n\t\t\t\tresult: investor.id\n\t\t\t}\n\t\tend", "def create(params = {})\n wrapped_params = { insurance: params }\n @client.make_request(:post, 'insurances', MODEL_CLASS, wrapped_params)\n end", "def index\n @investments = Investment.all\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def estimation_params\n params.require(:estimation).permit(:client_id, :title, :dimension, :drawing_no, :date, :issued_by ,:welding , :oxygen_acetylene , :painting , :sand_blasting , :transport ,:crane ,:shipment,:labour,:installation,:dismantle,:machining,:insulation,:civil_work,:electrik,:piling_work,:forming,:misc,:jkkp , :station_id)\n end", "def save_financials\n current_user.update(assets: params[:assets], average_annual_income: params[:average_annual_income], credit_score: params[:credit_score], total_debt: params[:total_debt])\n user_listings = current_user.listings\n render json: [current_user, user_listings]\n end", "def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: 'Interest was successfully created.' }\n format.json { render json: @interest, status: :created, location: @interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimator.update(estimator_params)\n #@estimator.update(body: params[:estimator][:body]) unless params[:estimator][:body].nil?\n @estimator.create_or_update_line(params[:estimator][:body])\n @estimator.generate_files\n if params[:estimator][:status] == 'approved'\n @estimator.generate_scope\n end\n if params[:estimator][:url] == 'pending'\n format.html { redirect_to admin_estimators_url, notice: 'Estimator was successfully updated.' }\n else\n format.html { redirect_to edit_admin_estimator_url(@estimator), notice: 'Estimator was successfully updated.' }\n end\n format.json { render :show, status: :ok, location: @estimator }\n else\n format.html { render :edit }\n format.json { render json: @estimator.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @appreciation = Appreciation.new(appreciation_params)\n\n respond_to do |format|\n if @appreciation.save \n @appreciation.parse\n \n format.html { redirect_to @appreciation, notice: 'Appreciation was successfully created.' }\n format.json { render :show, status: :created, location: @appreciation }\n else\n format.html { render :new }\n format.json { render json: @appreciation.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @trade = Trade.new\n @trade.stipulations.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trade }\n end\n end", "def create\n @fund = Fund.new(fund_params)\n\n if @fund.save\n render json: @fund, status: :created, location: @fund\n else\n render json: @fund.errors, status: :unprocessable_entity\n end\n end", "def create\n @updaterete = Updaterete.update_rates(params)\n\n respond_to do |format|\n if @updaterete.save\n format.html { redirect_to @updaterete, notice: 'Updaterete was successfully created.' }\n format.json { render json: @updaterete, status: :created, location: @updaterete }\n else\n format.html { render action: \"new\" }\n format.json { render json: @updaterete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n @interest = Interest.new(interest_params)\n @interest.save\n end", "def set_estimation\n @estimation = Estimation.find(params[:id])\n end", "def set_estimation\n @estimation = Estimation.find(params[:id])\n end", "def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end", "def create\n @spent = Spent.new(spent_params)\n\n respond_to do |format|\n if @spent.save\n format.html { redirect_to @spent, notice: 'Spent was successfully created.' }\n format.json { render :show, status: :created, location: @spent }\n else\n format.html { render :new }\n format.json { render json: @spent.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # Get the variables passed in from params on create\n @expense = Expense.new(expense_params)\n\n if @expense.save\n render json: @expense, status: :created, location: @expense\n else\n render json: @expense.errors, status: :unprocessable_entity\n end\n end", "def process_drink_cost_estimates\n # set referring page\n @referring_url = request.referrer\n \n # get data\n @data = params[:id]\n @split_data = @data.split(\"-\")\n @category = @split_data[0]\n @action = @split_data[1]\n @input = @split_data[2]\n \n # get user's category preferences\n @user_preferences = DeliveryPreference.find_by_user_id(current_user.id)\n \n if @category == \"beer\"\n @user_drink_preferences = UserPreferenceBeer.find_by_user_id(current_user.id)\n if @action == \"average\"\n @user_drink_preferences.update(beer_price_estimate: @input)\n end\n \n if @action == \"limit\"\n @user_drink_preferences.update(beer_price_limit: @input)\n end\n @price_response = @user_drink_preferences.beer_price_response\n @price_limit = @user_drink_preferences.beer_price_limit\n end\n \n if @category == \"cider\" \n @user_drink_preferences = UserPreferenceCider.find_by_user_id(current_user.id)\n if @action == \"average\"\n @user_drink_preferences.update(cider_price_estimate: @input)\n end\n \n if @action == \"limit\"\n @user_drink_preferences.update(cider_price_limit: @input)\n end\n @price_response = @user_drink_preferences.cider_price_response\n @price_limit = @user_drink_preferences.cider_price_limit\n end\n \n # set last saved\n @last_saved = @user_drink_preferences.updated_at\n \n respond_to do |format|\n format.js\n end\n \n end", "def test_create_transaction\n params = {\n bank_transaction: {\n bank_account_id: 1,\n date: Time.local(2012, 4, 16),\n amount: 55\n }\n }\n\n post '/api/banks/1/transactions', params\n data = ActiveSupport::JSON.decode last_response.body\n\n assert last_response.successful?\n assert_match('application/json', last_response.content_type)\n assert BankTransaction.find(data['id'])\n end", "def create\n @statistic = Statistic.new(statistic_params)\n @statistic.avg_time_on_site *= 60 # conversion mn en seconde\n respond_to do |format|\n if @statistic.save\n format.html { redirect_to statistics_path, notice: 'Statistic was successfully created.' }\n format.json { render :show, status: :created, location: @statistic }\n else\n format.html { render :new }\n format.json { render json: @statistic.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @investigador = Investigador.new(investigador_params)\n\n respond_to do |format|\n if @investigador.save\n format.html { redirect_to investigadore_path(@investigador), notice: \"Investigador was successfully created.\" }\n format.json { render :show, status: :created, location: @investigador }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @investigador.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #not sure why this was here...? @trips = Trip.all\n\n @expense_report = ExpenseReport.new(expense_report_params)\n authorize @expense_report\n @expense_report.submitter = current_account.accountable\n\n @expense_report.actual_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @expense_report.trip.destination\n req.expense_type = 'actual'\n end\n end\n\n\n respond_to do |format|\n if @expense_report.save\n format.html { redirect_to home_index_path, notice: 'Expense report was successfully created.' }\n format.json { render :show, status: :created, location: @expense_report }\n else\n format.html { render :new }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @invest = Invest.new(params[:invest])\n\n respond_to do |format|\n if @invest.save\n format.html { redirect_to(@invest, :notice => 'Invest was successfully created.') }\n format.xml { render :xml => @invest, :status => :created, :location => @invest }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def retrieve_estimate_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EstimatesApi.retrieve_estimate ...'\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 EstimatesApi.retrieve_estimate\"\n end\n # resource path\n local_var_path = '/v1/estimates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'EstimateResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearer_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EstimatesApi#retrieve_estimate\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 @estimate_line_item = EstimateLineItem.new(params[:estimate_line_item])\n\n respond_to do |format|\n if @estimate_line_item.save\n format.html { redirect_to(@estimate_line_item, :notice => 'Estimate line item was successfully created.') }\n format.xml { render :xml => @estimate_line_item, :status => :created, :location => @estimate_line_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @estimate_line_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @investment.update(investment_params)\n render json: @investment, status: :ok\n else\n render json: @investment.errors, status: :unprocessable_entity\n end\n end", "def index\n @funds = Fund.all\n\n render json: @funds\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def update\n respond_to do |format|\n if @estimation.update(estimation_params)\n format.html { redirect_to @estimation, notice: 'Estimation was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimation }\n else\n format.html { render :edit }\n format.json { render json: @estimation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n num_days = (Date.parse(params['rent_info']['end_date']).mjd - Date.parse(params['rent_info']['start_date']).mjd) \n total = num_days * params['rent_info']['price_per_day']\n # byebug\n if User.find(params['rent_info']['owner_id'])\n user = User.find(params['rent_info']['owner_id'])\n user.money_made += total \n user.save\n end\n\n renter_post = RenterPost.create(\n renter_id: params['rent_info']['renter_id'],\n post_id: params['rent_info'][\"post_id\"],\n start_date: params['rent_info'][\"start_date\"],\n end_date: params['rent_info'][\"end_date\"],\n status: params['rent_info'][\"status\"]\n )\n if renter_post \n render json: renter_post\n else\n render json: {error: \"Could not create Renter Post\"}\n end\n end", "def create\n @investment = Investment.new(investment_params)\n\n respond_to do |format|\n if @investment.save\n format.html { redirect_to @investment, notice: 'Investment was successfully created.' }\n format.json { render :show, status: :created, location: @investment }\n else\n format.html { render :new }\n format.json { render json: @investment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @expense = Expense.new(expense_params)\n\n if @expense.save\n render json: @expense\n else\n render json: @expense.errors, status: :unprocessable_entity\n end\n end", "def create\n @ico_etz_investment = EtzInvestment.new(ico_etz_investment_params)\n\n respond_to do |format|\n if @ico_etz_investment.save\n format.html { redirect_to ico_etz_investment_path(@ico_etz_investment), notice: 'Etz investment was successfully created.' }\n format.json { render :show, status: :created, location: @ico_etz_investment }\n else\n format.html { render :new }\n format.json { render json: @ico_etz_investment.errors, status: :unprocessable_entity }\n end\n end\n end", "def interest_rate\n params['interest_rate'] = params['interest_rate'].to_f\n\n old_rate = @@interest_rate\n @@interest_rate = params['interest_rate']\n json_response(old_rate: old_rate, new_rate: @@interest_rate)\n end", "def amounts\n @common = Invoice.new(amounts_params) # TODO: test\n @precision = @common.currency_precision\n @common.set_amounts # they may have changed in the form\n respond_to do |format|\n format.js\n format.json\n end\n end", "def test_post_then_get\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n id = last_response.body\n\n get \"/traces/#{id}\"\n check_valid_trace last_response.body\n end", "def show\n render json: @investment, root: false\n end", "def create\n @average = Average.new(params[:average])\n\n respond_to do |format|\n if @average.save\n format.html { redirect_to @average, notice: 'Average was successfully created.' }\n format.json { render json: @average, status: :created, location: @average }\n else\n format.html { render action: \"new\" }\n format.json { render json: @average.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.70562315", "0.68773574", "0.68394464", "0.6381009", "0.6381009", "0.636285", "0.61552906", "0.61375886", "0.6101923", "0.59458786", "0.59409535", "0.59311026", "0.5916251", "0.5872112", "0.58600605", "0.5811628", "0.57637084", "0.5735993", "0.56948423", "0.5616753", "0.56150883", "0.5605512", "0.56029546", "0.56029546", "0.5573951", "0.5573951", "0.55520844", "0.55489427", "0.55003583", "0.5496836", "0.54488313", "0.54395425", "0.5424392", "0.5417101", "0.54113406", "0.5386388", "0.5380061", "0.53694534", "0.536122", "0.5348201", "0.5331377", "0.5310008", "0.5310008", "0.5294293", "0.52832115", "0.5270873", "0.5265104", "0.52429754", "0.52268875", "0.522201", "0.5209266", "0.5175897", "0.5175897", "0.5173824", "0.5167764", "0.5155488", "0.5154389", "0.51436245", "0.51415884", "0.5126773", "0.51158565", "0.51135886", "0.511296", "0.5104285", "0.51014227", "0.51002216", "0.50908464", "0.50789255", "0.507025", "0.50311756", "0.50269306", "0.5026777", "0.5020841", "0.5020144", "0.5020144", "0.50135887", "0.50091606", "0.5006357", "0.5006203", "0.5003044", "0.50007164", "0.5000425", "0.4991668", "0.49855468", "0.49834555", "0.49774688", "0.49748778", "0.497267", "0.4972476", "0.4961547", "0.4960207", "0.49575272", "0.49531266", "0.49511433", "0.49508432", "0.4946221", "0.49404585", "0.493291", "0.493132", "0.49252263" ]
0.70079684
1
PUT /estimates/1 PUT /estimates/1.json
def update @estimate = Estimate.find(params[:id]) respond_to do |format| if @estimate.update_attributes(params[:estimate]) format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @estimate.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: 'Estimate was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimate.update(estimate_params)\n format.html { redirect_to @estimate, notice: t('.estimate_was_successfully_updated') }\n format.json { render :show, status: :ok, location: @estimate }\n else\n format.html { render :edit }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimation.update(estimation_params)\n format.html { redirect_to @estimation, notice: 'Estimation was successfully updated.' }\n format.json { render :show, status: :ok, location: @estimation }\n else\n format.html { render :edit }\n format.json { render json: @estimation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estimator.update(estimator_params)\n #@estimator.update(body: params[:estimator][:body]) unless params[:estimator][:body].nil?\n @estimator.create_or_update_line(params[:estimator][:body])\n @estimator.generate_files\n if params[:estimator][:status] == 'approved'\n @estimator.generate_scope\n end\n if params[:estimator][:url] == 'pending'\n format.html { redirect_to admin_estimators_url, notice: 'Estimator was successfully updated.' }\n else\n format.html { redirect_to edit_admin_estimator_url(@estimator), notice: 'Estimator was successfully updated.' }\n end\n format.json { render :show, status: :ok, location: @estimator }\n else\n format.html { render :edit }\n format.json { render json: @estimator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n standard_update(Interest, params[:id], interest_params)\n end", "def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_estimate\n @estimate = Estimate.find(params[:id])\n end", "def set_estimate\n @estimate = Estimate.find(params[:id])\n end", "def update\n @user_ticket_estimate = UserTicketEstimate.find(params[:id])\n\n respond_to do |format|\n if @user_ticket_estimate.update_attributes(params[:user_ticket_estimate])\n format.html { redirect_to @user_ticket_estimate, notice: 'User ticket estimate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_ticket_estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @approximate_service = ApproximateService.find(params[:id])\n\n respond_to do |format|\n if @approximate_service.update_attributes(params[:approximate_service])\n format.html { redirect_to(@approximate_service, :notice => 'ApproximateService was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @approximate_service.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @interests = Interests.for_person(@person)[0]\n\n respond_to do |format|\n if @interests.update_attributes(params[:interests])\n flash[:notice] = 'Interests updated.'\n format.html { redirect_to(person_path(:id => @person)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interests.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update_funding_and_estimates\n self.save_without_validating\n end", "def test_put\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 contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def create\n @estimate = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to @estimate, notice: 'Estimate was successfully created.' }\n format.json { render json: @estimate, status: :created, location: @estimate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @estimate_line_item = EstimateLineItem.find(params[:id])\n\n respond_to do |format|\n if @estimate_line_item.update_attributes(params[:estimate_line_item])\n format.html { redirect_to(@estimate_line_item, :notice => 'Estimate line item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estimate_line_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n #@estimation.estimation_items.build(params[:estimation_items])\n #Estimation.generation_new_item(params[:estimation])\n \n respond_to do |format|\n if @estimation.update(estimation_params)\n format.html { redirect_to estimations_path, notice: 'Estimation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @estimation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_with Expense.update(params[:id], expense_params), status: 204\n end", "def create\n @estimate = Estimate.new(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to root_path, notice: 'Estimate was successfully created.' }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @resource = Estimate.new(params[:estimate])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to estimates_url, notice: 'estimate was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @qborentestimate = Qborentestimate.find(params[:id])\n\n respond_to do |format|\n if @qborentestimate.update_attributes(params[:qborentestimate])\n format.html { redirect_to @qborentestimate, notice: 'Qestimate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @qborentestimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end", "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, :notice => 'Interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @estadium.update(estadium_params)\n format.html { redirect_to @estadium, notice: 'Estadium was successfully updated.' }\n format.json { render :show, status: :ok, location: @estadium }\n else\n format.html { render :edit }\n format.json { render json: @estadium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, notice: 'Interest was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interest.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 if @investment.update(investment_params)\n render json: @investment, status: :ok\n else\n render json: @investment.errors, status: :unprocessable_entity\n end\n end", "def update\n @interesting = Interesting.find(params[:id])\n\n respond_to do |format|\n if @interesting.update_attributes(params[:interesting])\n format.html { redirect_to @interesting, notice: 'Interesting was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interesting.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @expectation = Expectation.find(params[:id])\n\n respond_to do |format|\n if @expectation.update_attributes(params[:expectation])\n format.html { redirect_to @expectation, notice: 'Expectation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expectation.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 set_estimate\n @estimate = Estimate.find_by!(id: params[:id], company_information: current_user_company)\n end", "def update\n @curve = Curve.find(params[:id])\n\n respond_to do |format|\n if @curve.update_attributes(params[:curve])\n format.html { redirect_to @curve, notice: 'Curve was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @curve.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @estimates = Estimate.all\n end", "def index\n @estimates = Estimate.all\n end", "def update\n @summary = Summary.find(params[:id])\n\n respond_to do |format|\n if @summary.update_attributes(params[:summary])\n format.html { redirect_to @summary, notice: 'Summary was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @estimate = Estimate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estimate }\n end\n end", "def update\n authorize! :update, @theorem\n if @theorem.update(theorem_params)\n render json: @theorem, status: :ok, location: @theorem\n else\n render json: @theorem.errors, status: :unprocessable_entity\n end\n end", "def update\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n if @estagio.update_attributes(params[:estagio])\n flash[:notice] = 'Estagio was successfully updated.'\n format.html { redirect_to(@estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @predict = Predict.find(params[:id])\n\n respond_to do |format|\n if @predict.update_attributes(params[:predict])\n format.html { redirect_to @predict, notice: 'Predict was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @predict.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @observation = Observation.find(params[:id])\n\n respond_to do |format|\n if @observation.update_attributes(params[:observation])\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def create\n @estimate = current_user_company.estimates.build(estimate_params)\n\n respond_to do |format|\n if @estimate.save\n format.html { redirect_to @estimate, notice: t('.estimate_was_successfully_created') }\n format.json { render :show, status: :created, location: @estimate }\n else\n format.html { render :new }\n format.json { render json: @estimate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @spent.update(spent_params)\n format.html { redirect_to @spent, notice: 'Spent was successfully updated.' }\n format.json { render :show, status: :ok, location: @spent }\n else\n format.html { render :edit }\n format.json { render json: @spent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @asset.update(price: params[:asset][:price])\n json_response(@asset,:created)\n end", "def put!\n request! :put\n end", "def update\n @points_spent = PointsSpent.find(params[:id])\n\n respond_to do |format|\n if @points_spent.update_attributes(params[:points_spent])\n format.html { redirect_to @points_spent, notice: 'Points spent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @points_spent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n record = Asset.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end", "def update\n\t\t\t\t\n\t\t\t\ttparams = params.require(:testimony).permit :quote,:author,:sort,:created_at,:updated_at\n\n\t\t\t\t@testimony = Testimony.find params[:id]\n\n\t\t\t\tif @testimony.update(tparams)\n\n\t\t\t\t\trender json: nil,status: 200\n\n\t\t\t\telse\n\n\t\t\t\t\trender json: nil,status: 422\n\n\t\t\t\tend\n\n\t\t\tend", "def update_expectation\n orgId = params[:id].to_i\n expectationId = params[:expectation_id].to_i\n expectation = params[:expectation]\n\n expectation[\"organization_id\"] = orgId\n expectation[\"id\"] = expectationId\n\n result = @expectationService.update_expectation(expectation)\n\n render status: result.status,\n json: {\n info: result.info,\n expectation: result.object\n }\n end", "def update\n @seance = Seances::UseCases::Update.new.call(id: params[:id], params: seance_params)\n\n if @seance.valid?\n render jsonapi: @seance\n else\n render jsonapi_errors: @seance.errors, status: :unprocessable_entity\n end\n end", "def put(sample)\n update_stats(sample)\n update_estimates(sample)\n nil\n end", "def update\n @invest = Invest.find(params[:id])\n\n respond_to do |format|\n if @invest.update_attributes(params[:invest])\n format.html { redirect_to(@invest, :notice => 'Invest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "def update\n @essay = Essay.find(params[:id])\n\n respond_to do |format|\n if @essay.update_attributes(params[:essay])\n format.html { redirect_to @essay, notice: 'Essay was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @estimate = Estimate.find(params[:id])\n @estimate.destroy\n\n respond_to do |format|\n format.html { redirect_to estimates_url }\n format.json { head :no_content }\n end\n end", "def update\n respond_to do |format|\n if @investigated.update(investigated_params)\n format.html { redirect_to @investigated, notice: 'Investigated was successfully updated.' }\n format.json { render :show, status: :ok, location: @investigated }\n else\n format.html { render :edit }\n format.json { render json: @investigated.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @expectation = RiGse::Expectation.find(params[:id])\n\n respond_to do |format|\n if @expectation.update_attributes(params[:expectation])\n flash[:notice] = 'RiGse::Expectation.was successfully updated.'\n format.html { redirect_to(@expectation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expectation.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @person_interest = PersonInterest.find(params[:id])\n\n respond_to do |format|\n if @person_interest.update_attributes(params[:person_interest])\n format.html { redirect_to @person_interest, notice: 'Person interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end", "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @income = Income.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(income_params)\n format.html { redirect_to @income, notice: 'Income was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @income.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_estimate_item\n @estimate_item = EstimateItem.find(params[:id])\n end", "def set_estimate_item\n @estimate_item = EstimateItem.find(params[:id])\n end", "def update\n @expense = Expense.find params.fetch(:id)\n\n if @expense.update(expense_params)\n render json: @expense\n else\n render json: @expense.errors, status: :unprocessable_entity\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n @income = Income.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(params[:income])\n format.json { head :ok }\n format.js\n else\n format.json { render json: @income.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def update\n o = OvertimeRate.find(params[:id])\n \n if o.update_attributes(:duration => params[:duration], :year => params[:year], \n :pay_rate => params[:pay_rate])\n render :json => { :success => 1, \n :message => 'Pay Rate was successfully updated.' }\n \n else\n render :json => OvertimeRateHelper.get_errors(o.errors)\n end\n end", "def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n @services_of_dependence = current_user.dependence.service_of_dependences\n agents_of_service = AgentOfService.where(service_of_dependence: @services_of_dependence)\n @agents = Agent.where(id: agents_of_service.pluck(:agent_id))\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @coordenador_estagio = CoordenadorEstagio.find(params[:id])\n\n respond_to do |format|\n if @coordenador_estagio.update_attributes(params[:coordenador_estagio])\n format.html { redirect_success(\"Coordenador alterado com sucesso!\",:coordenador_estagio, :index)}\n format.json { head :no_content }\n else\n format.html { redirect_error(\"Erro ao alterar coordenador!\",:coordenador_estagio, :index)}\n format.json { render json: @coordenador_estagio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n flash[:notice] = 'Interest was successfully updated.'\n format.html { redirect_to(@interest) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update*args\n pp args: args\n\n @trade = owned_trades.find(params[:id])\n\n if @trade.update_attributes(params[:trade])\n @tradeViewRow = TradesView.find(@trade.id)\n render json: @tradeViewRow\n else\n render json: @trade.errors, status: :unprocessable_entity\n end\n end", "def update\n @historical = Historical.find(params[:id])\n\n respond_to do |format|\n if @historical.update_attributes(params[:historical])\n format.html { redirect_to @historical, notice: 'Historical was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historical.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n if @moose.update_attributes(params[:moose])\n format.html { redirect_to @moose, notice: 'Moose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moose.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def set_estimation\n @estimation = Estimation.find(params[:id])\n end", "def set_estimation\n @estimation = Estimation.find(params[:id])\n end", "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supervisor_estagio = SupervisorEstagio.find(params[:id])\n\n respond_to do |format|\n if @supervisor_estagio.update_attributes(params[:supervisor_estagio])\n flash[:notice] = 'Supervisor de Estagio atualizado com sucesso.'\n format.html { redirect_to(@supervisor_estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @supervisor_estagio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @experiment = Experiment.find(@datapoint.experiment_id)\n respond_to do |format|\n if @datapoint.update(datapoint_params)\n format.html { redirect_to @experiment, notice: 'Datapoint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @datapoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @explaination = Explaination.find(params[:id])\n\n respond_to do |format|\n if @explaination.update_attributes(params[:explaination])\n format.html { redirect_to @explaination, notice: 'Explaination was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @explaination.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @transit_score = TransitScore.find(params[:id])\n\n respond_to do |format|\n if @transit_score.update_attributes(params[:transit_score])\n format.html { redirect_to @transit_score, notice: 'Transit score was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @transit_score.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @impressum = Impressum.find(params[:id])\n\n respond_to do |format|\n if @impressum.update_attributes(params[:impressum])\n format.html { redirect_to impressums_url, notice: 'Impressum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @impressum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @summary.update(summary_params)\n format.html { redirect_to @summary }\n format.json { render :show, status: :ok, location: @summary }\n else\n format.html { render :edit }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_put_success\n put \"/blah\", @test_obj do |response|\n assert response.ok?, \"Update test object failed\"\n end\n end", "def update\n effort = Effort.find_by(\"id\" => params[\"id\"])\n effort.update(\"value\" => params[\"value\"],\n \"date\" => params[\"date\"],\n \"goal_id\" => params[\"goal_id\"],\n \"strategy_id\" => params[\"strategy_id\"])\n redirect_to \"/efforts\"\n end", "def update\n @event = Event.find(params[:event_id])\n @point_of_interest = PointOfInterest.find(params[:id])\n\n respond_to do |format|\n if @point_of_interest.update_attributes(params[:point_of_interest])\n format.html { redirect_to(event_point_of_interest_path, :notice => 'Point of interest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @point_of_interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @record = Asset.find(params[:id])\n @record.update_attributes(params[:@record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end" ]
[ "0.6668553", "0.6668553", "0.6609188", "0.6127689", "0.60707873", "0.60226333", "0.59655094", "0.5887948", "0.5881626", "0.5881626", "0.58655113", "0.5859236", "0.5845", "0.5791681", "0.5770557", "0.57633036", "0.5754522", "0.5743896", "0.57413566", "0.5728985", "0.5717488", "0.5712655", "0.5701167", "0.56938183", "0.56928873", "0.5660362", "0.56517446", "0.5644218", "0.5636823", "0.56336117", "0.56127644", "0.56030405", "0.5596522", "0.5569915", "0.5556034", "0.55383056", "0.55362093", "0.55362093", "0.55276275", "0.55260456", "0.5525499", "0.5524872", "0.55139035", "0.5510001", "0.55076945", "0.55014765", "0.54998463", "0.54842186", "0.5478585", "0.5475198", "0.54632455", "0.54566467", "0.54469526", "0.5440999", "0.5437583", "0.5431093", "0.5430204", "0.54287285", "0.54252875", "0.54222536", "0.54071784", "0.54071534", "0.5404835", "0.5399538", "0.5397655", "0.53940046", "0.5377107", "0.5366792", "0.5366792", "0.53626037", "0.53594947", "0.53586674", "0.53471875", "0.5345496", "0.53416204", "0.5339242", "0.53373885", "0.53340286", "0.5328616", "0.5327208", "0.53265405", "0.531652", "0.531652", "0.531652", "0.5314184", "0.5314184", "0.5308726", "0.53056514", "0.53054863", "0.5303513", "0.5303135", "0.53028667", "0.53006995", "0.5298683", "0.52980393", "0.5296968", "0.529394", "0.5289808", "0.5289487", "0.5289487" ]
0.69992155
0
DELETE /estimates/1 DELETE /estimates/1.json
def destroy @estimate = Estimate.find(params[:id]) @estimate.destroy respond_to do |format| format.html { redirect_to estimates_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @estimate.destroy\n respond_to do |format|\n format.html { redirect_to estimates_url, notice: 'Estimate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @estimate.destroy\n respond_to do |format|\n format.html { redirect_to estimates_url, notice: 'Estimate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n respond_to do |format|\n if @estimate.destroy\n format.html { redirect_to estimates_url, notice: t('.estimate_was_successfully_destroyed') }\n else\n format.html { redirect_to estimates_url, notice: t('.estimate_was_fail_destroyed') }\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @estimation.destroy\n respond_to do |format|\n format.html { redirect_to estimations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estimation.destroy\n respond_to do |format|\n format.html { redirect_to estimations_url, notice: 'Estimation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @estimate_line_item = EstimateLineItem.find(params[:id])\n @estimate_line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(estimate_line_items_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @expectation = Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to expectations_url }\n format.json { head :no_content }\n end\n end", "def 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 destroy\n @expectation = RiGse::Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to(expectations_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @investigated.destroy\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @observations.destroy\n respond_to do |format|\n format.html { redirect_to observations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end \n end", "def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @approximate_service = ApproximateService.find(params[:id])\n @approximate_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(approximate_services_url) }\n format.xml { head :ok }\n end\n end", "def delete_demo(id)\n delete_record \"/demos/#{id}\"\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 delete\n render json: Alien.delete(params[\"id\"])\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n record = InvoiceLineItem.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @estimator.destroy\n respond_to do |format|\n format.html { redirect_to admin_estimators_url, notice: 'Estimator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @sumit.destroy\n respond_to do |format|\n format.html { redirect_to sumits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @curve = Curve.find(params[:id])\n @curve.destroy\n\n respond_to do |format|\n format.html { redirect_to curves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @test_summary = TestSummary.find(params[:id])\n @test_summary.destroy\n\n respond_to do |format|\n format.html { redirect_to test_summaries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estadium.destroy\n respond_to do |format|\n format.html { redirect_to estadia_url, notice: 'Estadium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n record = Asset.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @record = Asset.find(params[:id])\n @record.trash\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @interesting = Interesting.find(params[:id])\n @interesting.destroy\n\n respond_to do |format|\n format.html { redirect_to interestings_url }\n format.json { head :ok }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def delete(url, headers={})\n RestClient.delete url, headers\n end", "def destroy\n\t\t\t\n\t\t\t\tTestimony.find(params[:id]).destroy\n\n\t\t\t\trender json: nil,status: 200\n\t\t\t\n\t\t\tend", "def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end", "def destroy\n @simulation = Simulation.find(params[:id])\n @simulation.destroy\n\n respond_to do |format|\n format.html { redirect_to simulations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n Accessor.find(params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to accessors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\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 @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 delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @explaination = Explaination.find(params[:id])\n @explaination.destroy\n\n respond_to do |format|\n format.html { redirect_to explainations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @observation = Observation.find(params[:id])\n @observation.destroy\n\n respond_to do |format|\n format.html { redirect_to observations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @experiment_raw_dataset.destroy\n respond_to do |format|\n format.html { redirect_to experiment_raw_datasets_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 @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 @summary.destroy\n respond_to do |format|\n format.html { redirect_to summaries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @qborentestimate = Qborentestimate.find(params[:id])\n @qborentestimate.destroy\n\n respond_to do |format|\n format.html { redirect_to qborentestimates_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 @predict = Predict.find(params[:id])\n @predict.destroy\n\n respond_to do |format|\n format.html { redirect_to predicts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @examination = Examination.find(params[:id])\n @examination.destroy\n\n respond_to do |format|\n format.html { redirect_to examinations_url }\n format.json { head :ok }\n end\n end", "def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def destroy\n @forest = Forest.find(params[:id])\n @forest.destroy\n\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @user_ticket_estimate = UserTicketEstimate.find(params[:id])\n ticket = @user_ticket_estimate.ticket\n @user_ticket_estimate.destroy\n current_user.estimate! ticket\n\n respond_to do |format|\n format.html { redirect_to user_ticket_estimates_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @observation.wait_for_index_refresh = true\n @observation.destroy\n respond_to do |format|\n format.html do\n flash[:notice] = t(:observation_was_deleted)\n redirect_to(observations_by_login_path(current_user.login))\n end\n format.xml { head :ok }\n format.json do\n head :ok\n end\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def destroy\n @essay = Essay.find(params[:id])\n @essay.destroy\n\n respond_to do |format|\n format.html { redirect_to essays_url }\n format.json { head :ok }\n end\n end", "def delete_expectation\n orgId = params[:id].to_i\n expectationId = params[:expectation_id].to_i\n\n expectation = Expectation.new()\n expectation[\"organization_id\"] = orgId\n expectation[\"id\"] = expectationId\n\n result = @expectationService.delete_expectation(expectation)\n\n render status: result.status,\n json: {\n info: result.info\n }\n end", "def destroy\n @summary = Summary.find(params[:id])\n @summary.destroy\n\n respond_to do |format|\n format.html { redirect_to summaries_url }\n format.json { head :ok }\n end\n end", "def destroy\n @dataset_datum.destroy\n respond_to do |format|\n format.html { redirect_to dataset_data_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @intake.destroy\n respond_to do |format|\n format.html { redirect_to intakes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estacion = Estacion.find(params[:id])\n @estacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(estaciones_url) }\n format.xml { head :ok }\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()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete\n api_client.delete(url)\n end", "def destroy\n @estacionamiento = Estacionamiento.find(params[:id])\n @estacionamiento.destroy\n\n respond_to do |format|\n format.html { redirect_to estacionamientos_url }\n format.json { head :ok }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @dataset.destroy\n respond_to do |format|\n format.html { redirect_to study_path(@dataset.study), notice: 'Dataset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end", "def destroy\n contest = @data_set.contest\n @data_set.destroy\n respond_to do |format|\n format.html { redirect_to admin_contest_url(contest), notice: 'Data set was successfully destroyed.' }\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 @job_site = JobSite.find(params[:job_site_id])\n @customer = Customer.find(@job_site.customer_id)\n @job_estimate.destroy\n respond_to do |format|\n format.html { redirect_to customer_job_site_job_estimates_path(:customer_id=>@customer.id,:job_site_id => @job_site.id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @assertion.destroy\n respond_to do |format|\n format.html { redirect_to assertions_url, notice: 'Assertion was successfully destroyed.' }\n format.json { head :no_content }\n end\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 destroy\n @fixturestat = Fixturestat.find(params[:id])\n @fixturestat.destroy\n\n respond_to do |format|\n format.html { redirect_to fixturestats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @api_v1_reward.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_rewards_url, notice: 'Reward was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @simulation = Simulation.find(params[:id])\n @simulation.destroy\n\n respond_to do |format|\n format.html { redirect_to(simulations_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @test_datum.destroy\n respond_to do |format|\n format.html { redirect_to test_data_url, notice: 'Test datum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @visit = Visit.find(params[:id])\n @visit.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n Audit.find(params[:id]).destroy\n head :no_content\n end", "def destroy\n @aws_datum.destroy\n respond_to do |format|\n format.html { redirect_to aws_data_url, notice: 'Aws datum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @atr = Atr.find(params[:id])\n @atr.destroy\n\n respond_to do |format|\n format.html { redirect_to atrs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @test1.destroy\n respond_to do |format|\n format.html { redirect_to test1s_url, notice: \"Test1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @forest.destroy\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end", "def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end", "def destroy\n @exercise_plan = ExercisePlan.find(params[:id])\n @exercise_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @invest = Invest.find(params[:id])\n @invest.destroy\n\n respond_to do |format|\n format.html { redirect_to(invests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @testis = Teste.find(params[:id])\n @testis.destroy\n\n respond_to do |format|\n format.html { redirect_to testes_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7375703", "0.7375703", "0.70845735", "0.70742697", "0.6888593", "0.68539464", "0.6818487", "0.6757967", "0.6746333", "0.67379695", "0.6719186", "0.6700015", "0.66478366", "0.66345173", "0.66298896", "0.65979904", "0.659366", "0.6583303", "0.65820277", "0.65814215", "0.65283954", "0.65263826", "0.65202445", "0.6448051", "0.6445385", "0.6444535", "0.6443874", "0.6439067", "0.64338", "0.64296365", "0.64255947", "0.64202625", "0.6416872", "0.64142025", "0.63966495", "0.63956374", "0.63936853", "0.6374077", "0.6361432", "0.6360039", "0.63581175", "0.63530713", "0.6352183", "0.63513744", "0.63478315", "0.63465726", "0.6342711", "0.634208", "0.633774", "0.63375515", "0.633579", "0.63352484", "0.6334105", "0.6328227", "0.6326083", "0.6322191", "0.6321178", "0.6317257", "0.63166505", "0.6313805", "0.6310274", "0.62990916", "0.62977", "0.6296635", "0.6295266", "0.62937176", "0.6291857", "0.6291058", "0.6290618", "0.628965", "0.628965", "0.628965", "0.628965", "0.62894124", "0.62853456", "0.6281652", "0.62789553", "0.6277874", "0.6274887", "0.6272918", "0.62718064", "0.6271753", "0.6271497", "0.62710977", "0.6270509", "0.62703425", "0.6267205", "0.62668896", "0.6266769", "0.62616104", "0.626005", "0.6259334", "0.6258823", "0.6258796", "0.6258297", "0.62539303", "0.62498564", "0.6244641", "0.6244447", "0.6243962" ]
0.76779664
0
Public: Initialize a new Gollum Repo. path The String path to the Git repository that holds the Gollum site. options Optional Hash: :universal_toc Table of contents on all pages. Default: false :base_path String base path for all Wiki links. Default: "/" :page_file_dir String the directory in which all page files reside :ref String the repository ref to retrieve pages from :mathjax Set to false to disable mathjax. :user_icons Enable user icons on the history page. [gravatar, identicon, none]. Default: none :global_tag_lookup Enable 4.x compatibility behavior for links :hyphened_tag_lookup Spaces in tag paths are treated as dashes () :case_insensitive_tag_lookup Paths in tags are compared case_insensitively :css Include the custom.css file from the repo. :emoji Parse and interpret emoji tags (e.g. :heart:). :h1_title Concatenate all h1's on a page to form the page title. :display_metadata Whether or not to render a page's metadata on the page. Default: true :index_page The default page to retrieve or create if the a directory is accessed. :bar_side Where the sidebar should be displayed, may be: :left :right :allow_editing Set whether wiki content can be edited. Default: true :allow_uploads Set to true to allow file uploads. :per_page_uploads Whether uploads should be stored in a central 'uploads' directory, or in a directory named for the page they were uploaded to. :filter_chain Override the default filter chain with your own. Returns a fresh Gollum::Repo.
def initialize(path, options = {}) options = self.class.default_options.merge(options) if path.is_a?(GitAccess) options[:access] = path path = path.path end @path = path @repo_is_bare = options.fetch :repo_is_bare, nil @page_file_dir = options.fetch :page_file_dir, nil @page_file_dir = Pathname.new("/#{@page_file_dir}").cleanpath.to_s[1..-1] if @page_file_dir @access = options.fetch :access, GitAccess.new(path, @page_file_dir, @repo_is_bare) @base_path = options.fetch :base_path, "/" @repo = @access.repo @ref = options.fetch :ref, self.class.default_ref @universal_toc = options.fetch :universal_toc, false @mathjax = options.fetch :mathjax, false @global_tag_lookup = options.fetch :global_tag_lookup, false @hyphened_tag_lookup = options.fetch :hyphened_tag_lookup, false @case_insensitive_tag_lookup = options.fetch :case_insensitive_tag_lookup, false @css = options.fetch :css, false @emoji = options.fetch :emoji, false @critic_markup = options.fetch :critic_markup, false @h1_title = options.fetch :h1_title, false @display_metadata = options.fetch :display_metadata, true @index_page = options.fetch :index_page, 'Home' @bar_side = options.fetch :sidebar, :right @user_icons = ['gravatar', 'identicon'].include?(options[:user_icons]) ? options[:user_icons] : 'none' @allow_editing = options.fetch :allow_editing, true @allow_uploads = options.fetch :allow_uploads, false @per_page_uploads = options.fetch :per_page_uploads, false @metadata = options.fetch :metadata, {} @filter_chain = options.fetch :filter_chain, [:YAML, :BibTeX, :PlainText, :CriticMarkup, :TOC, :RemoteCode, :Code, :Macro, :Emoji, :Sanitize, :PlantUML, :Tags, :PandocBib, :Render] @filter_chain.delete(:Emoji) unless options.fetch :emoji, false @filter_chain.delete(:PandocBib) unless ::Gollum::MarkupRegisterUtils.using_pandoc? @filter_chain.delete(:CriticMarkup) unless options.fetch :critic_markup, false Hook.execute(:post_wiki_initialize, self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(path=Dir.pwd, options={})\n @grit = path.kind_of?(Grit::Repo) ? path : Grit::Repo.new(path, options)\n @sandbox = false\n @branch = nil\n @work_dir = path(options[:work_dir] || DEFAULT_WORK_DIR)\n @work_tree = options[:work_tree] || File.join(work_dir, 'tmp', object_id.to_s)\n @index_file = options[:index_file] || File.join(work_dir, 'tmp', \"#{object_id}.index\")\n \n self.author = options[:author] || nil\n self.checkout options[:branch] || DEFAULT_BRANCH\n self.default_blob_mode = options[:default_blob_mode] || DEFAULT_BLOB_MODE\n self.default_tree_mode = options[:default_tree_mode] || DEFAULT_TREE_MODE\n end", "def initialize(path, options = {})\n if path.is_a?(GitAccess)\n options[:access] = path\n path = path.path\n end\n @path = path\n @access = options[:access] || GitAccess.new(path)\n @base_path = options[:base_path] || \"/\"\n @page_class = options[:page_class] || self.class.page_class\n @file_class = options[:file_class] || self.class.file_class\n @markup_class = options[:markup_class] || self.class.markup_class\n @repo = @access.repo\n @sanitization = options[:sanitization] || self.class.sanitization\n @history_sanitization = options[:history_sanitization] || \n self.class.history_sanitization\n end", "def initialize(path)\n super path\n\n @grit_repo = Grit::Repo.new(path)\n end", "def initialize(repository_path, options = {})\n if File.exists? \"#{repository_path}/.git\"\n @git = Git.open(repository_path)\n else\n @git = Git.bare(repository_path)\n end\n @title = options[:title] || \"Gitfeed for #{repository_path.sub(/.*\\//, '')}\"\n @url = options[:url] || 'http://github.com/scotchi/gitfeed'\n @description = options[:description] || repository_path\n @template = options[:template] || File.expand_path('../entry.haml', __FILE__)\n @include_diffs = options[:include_diffs].nil? ? true : options[:include_diffs]\n @haml = Haml::Engine.new(File.read(@template))\n end", "def initialize(path)\n @repo = Grit::Repo.new(path)\n @param = File.split(path).last\n @name = @param\n @description = @repo.description\n #@description = \"Please edit the #{@repo.path}/description file for this repository and set the description for it.\" if /^Unnamed repository;/.match(@description)\n @description = '' if /^Unnamed repository;/.match(@description)\n end", "def initialize(path)\n @repository = Rugged::Repository.init_at(path, :bare)\n end", "def git\n @git ||= Grit::Repo.new(path)\n end", "def git\n @git ||= Grit::Repo.new(path)\n end", "def repo() \n\t\treturn @repo if @repo != nil\n\t\t@repo = Grit::Repo.new(self[:path])\n\tend", "def initialize(options)\n @git = Git.open(options[:repo])\n @repo_dir = options[:repo]\n @skip_existing = options[:skip_existing]\n @weekly_dir = options[:weeklies]\n end", "def initialize(path=\"\", create=false, config=nil)\n super(path, create, config)\n @hg = working_join \".hg\"\n @file_opener = Amp::Opener.new @root\n @file_opener.default = :open_file # these two are the same, pretty much\n @hg_opener = Amp::Opener.new @root\n @hg_opener.default = :open_hg # just with different defaults\n @filters = {}\n @changelog = nil\n @manifest = nil\n @dirstate = nil\n @staging_area = StagingArea.new(self)\n @working_lock_ref = @lock_ref = nil\n requirements = []\n \n # make a repo if necessary\n unless File.directory? @hg\n if create\n then requirements = init config\n else raise RepoError.new(\"Repository #{path} not found\")\n end\n end\n \n # no point in reading what we _just_ wrote...\n unless create\n # read requires\n # save it if something's up\n @hg_opener.open(\"requires\", 'r') {|f| f.each {|r| requirements << r.strip } } rescue nil\n end\n \n @store = Stores.pick requirements, @hg, Amp::Opener\n @config = Amp::AmpConfig.new :parent_config => config\n @config.read_file join(\"hgrc\")\n end", "def initialize(uri, options = {})\n raise Errors::InvalidURI if invalid_uri?(uri)\n @uri = uri\n @options = DEFAULTS.merge(options)\n raise Errors::InvalidFormat if invalid_format?(@options[:format])\n @repo = nil\n @data = {}\n fetch_repo\n setup_data_hash\n end", "def initialize(path)\n super(DIR)\n \n @store = GitStore.new(path)\n @store.handler['md'] = PageHandler.new\n @store.load\n end", "def initialize(path, options = {})\n @gl_admin = Grit::Repo.new(path)\n\n @conf = options[:conf] || CONF\n @confdir = options[:confdir] || CONFDIR\n @keydir = options[:keydir] || KEYDIR\n\n @ssh_keys = load_keys(File.join(path, @keydir))\n @config = Config.new(File.join(path, @confdir, @conf))\n end", "def initialize(repo, options)\n @repo = repo\n\n options[:type] ||= 'changelog'\n options[:format] ||= 'ansi'\n\n @options = OpenStruct.new(options)\n\n @options.level ||= 0\n end", "def initialize repo_name, options\n self.repo_name = repo_name\n self.options = options\n end", "def initialize(path)\n @path = path\n @name = path.split(\"/\").last\n raise NoRepository.new('no repository for such path') unless check_repo_present? \n Gitlab::Git::CacheHost.set_cache_host(path)\n end", "def initialize(name, opts)\n @name = name\n @url_prefix = \"#{@name}:\"\n @read_only = (opts[:read_only] == true)\n # Do not expose in search result\n @hidden = (opts[:hidden] == true)\n @no_access = (opts[:no_access] == true)\n\n if @top_dir = opts[:top_dir]\n if @top_dir.start_with?('.') && ContentRepository.reference_dir\n @top_dir = File.join(ContentRepository.reference_dir, @top_dir)\n end\n unless @top_dir =~ /^.+@.+:(.+)\\.git$/\n @top_dir = File.expand_path(@top_dir)\n end\n debug \"Creating repo '#{name} with top dir: #{@top_dir}\"\n\n _create_if_not_exists if opts[:create_if_not_exists]\n end\n end", "def initialize(repo, opts={})\n @repo = repo\n end", "def initialize(path, commit)\n @repo = self\n @dir = path\n @path = \"\"\n @commit = commit\n\n raise NoRepo if git(\"status\") =~ /not a git repo/i\n\n super(self, \"\", @path, nil, @commit, File.stat(@dir).mode)\n end", "def initialize(path)\n path.chomp(GIT_DIR) if path.end_with? GIT_DIR\n @path = (path.empty?) ? '.' : path\n\n # TODO: get last branch tag from repo\n # prob as a git-config\n @last_branch_tag = DEFAULT_TAG.dup\n @current_branch = DEFAULT_BRANCH.dup\n @staging_index = nil\n @saved_stages = {}\n\n super(@path + GIT_DIR)\n end", "def git_init(repo_path)\n git_repo = Git.init repo_path\n git_repo.config('user.name', @@git_user_name)\n git_repo.config('user.email', @@git_user_email)\n return git_repo\n end", "def repo\n if @repo == NRSER::NO_ARG\n @repo = QB::Repo.from_path root_path\n end\n \n @repo\n end", "def init(path = Dir.pwd, options = {})\n exit_status = FalkorLib::Git.init(path, options)\n unless command?('git-flow')\n # Check (mainly for Linux) if the command is not available under `/usr/lib/git-core`\n git_lib = '/usr/lib/git-core/'\n error \"you shall install git-flow: see https://github.com/nvie/gitflow/wiki/Installation\" unless File.exist?(File.join(git_lib, 'git-flow'))\n end\n remotes = FalkorLib::Git.remotes(path)\n git_root_dir = FalkorLib::Git.rootdir( path )\n Dir.chdir( git_root_dir ) do\n unless FalkorLib::Git.commits?( git_root_dir)\n warn \"Not yet any commit detected in this repository.\"\n readme = 'README.md'\n unless File.exist?( readme )\n answer = ask(cyan(\"=> initialize a commit with an [empty] #{readme} file (Y|n)?\"), 'Yes')\n exit 0 if answer =~ /n.*/i\n FileUtils.touch(readme)\n end\n FalkorLib::Git.add(readme, \"Initiate the repository with a '#{readme}' file\")\n end\n branches = FalkorLib::Git.list_branch(path)\n gitflow_branches = FalkorLib.config.gitflow[:branches].clone\n # correct eventually the considered branch from the options\n gitflow_branches.each do |t, _b|\n gitflow_branches[t] = options[t.to_sym] if options[t.to_sym]\n confs = FalkorLib::Git.config('gitflow*', path, :hash => true)\n gitflow_branches[t] = confs[\"gitflow.branch.#{t}\"] unless confs.empty?\n end\n if options[:interactive]\n gitflow_branches[:master] = ask(\"=> branch name for production releases\", gitflow_branches[:master])\n gitflow_branches[:develop] = ask(\"=> branch name for development commits\", gitflow_branches[:develop])\n end\n ap gitflow_branches if options[:debug]\n if remotes.include?( 'origin' )\n info \"=> configure remote (tracked) branches\"\n exit_status = FalkorLib::Git.fetch(path)\n gitflow_branches.each do |_type, branch|\n if branches.include? \"remotes/origin/#{branch}\"\n exit_status = FalkorLib::Git.grab(branch, path)\n else\n unless branches.include? branch\n info \"=> creating the branch '#{branch}'\"\n FalkorLib::Git.create_branch( branch, path )\n end\n exit_status = FalkorLib::Git.publish(branch, path )\n end\n end\n else\n gitflow_branches.each do |_type, branch|\n unless branches.include? branch\n info \" => creating the branch '#{branch}'\"\n exit_status = FalkorLib::Git.create_branch( branch, path )\n end\n end\n end\n #info \"initialize git flow configs\"\n gitflow_branches.each do |t, branch|\n exit_status = execute \"git config gitflow.branch.#{t} #{branch}\"\n end\n FalkorLib.config.gitflow[:prefix].each do |t, prefix|\n exit_status = execute \"git config gitflow.prefix.#{t} #{prefix}\"\n end\n devel_branch = gitflow_branches[:develop]\n #info \"checkout to the main development branch '#{devel_branch}'\"\n exit_status = run %(\n git checkout #{devel_branch}\n )\n # git config branch.$(git rev-parse --abbrev-ref HEAD).mergeoptions --no-edit for the develop branch\n exit_status = execute \"git config branch.#{devel_branch}.mergeoptions --no-edit\"\n if branches.include?('master') && !gitflow_branches.values.include?( 'master' )\n warn \"Your git-flow confuguration does not hold the 'master' branch any more\"\n warn \"You probably want to get rid of it asap by running 'git branch -d master'\"\n end\n if devel_branch != 'master' &&\n remotes.include?( 'origin' ) &&\n branches.include?( 'remotes/origin/master')\n warn \"You might want to change the remote default branch to point to '#{devel_branch}\"\n puts \"=> On github: Settings > Default Branch > #{devel_branch}\"\n puts \"=> On the remote bare Git repository: 'git symbolic-ref HEAD refs/head/#{devel_branch}'\"\n end\n end\n exit_status\n end", "def initialize(path = nil, options = nil)\n self.path = path\n self.options = options\n self.source = options[:source] if options\n self.source = LaravelRepo if not @source\n end", "def initialize(repos_url)\n self.repos_url = repos_url\n end", "def initialize(path, settings = {})\n @path = path\n @settings = DEFAULTS.merge(settings)\n\n # Ensure SSH key settings exist\n @settings.fetch(:public_key)\n @settings.fetch(:private_key)\n\n # Set repository instance variable\n @repo = set_repo\n\n # Update repository if asked\n update if @settings[:update_on_init]\n\n # Load Gitolite config\n reload!\n end", "def initialize(repo_name, repo_url, user_email, repo_branch = 'master')\n @repo_name = repo_name\n @repo_url = repo_url\n @repo_branch = repo_branch\n @user_email = user_email\n end", "def repo(path = root)\n @repo ||= {}\n @repo[path] ||= begin\n new_repo = Grit::Repo.init(path)\n Dir.chdir(path) # TODO This is not ideal but otherwise it would be necessary to pass\n # a :chdir option in all calls to Grit. This may be a bug in Grit related with the\n # --work-tree flag\n\n unless new_repo.branches.any? { |b| b.name == 'master' } # Check if master exists\n index = new_repo.index\n index.add('k', '')\n index.commit(\"init\")\n end\n new_repo # If this has been done before, the above command will do nothing\n end\n end", "def initialize(options = {})\n self.base_path = options[:base_path] || Dir.pwd\n self.settings = options[:settings] || load_config\n self.lang = options[:lang] || setting_value(\"settings\", \"default_locale\")\n self.web_path = \"#{options[:web_path]}/\"\n self.indent = options[:indent] || 1\n self.extension = get_extension\n self.filename = options[:filename] || file_name\n self.childs = []\n self.browsers = []\n self.repository = options[:repository]\n self.commit = options[:commit]\n end", "def repo=(_arg0); end", "def repo=(_arg0); end", "def repo=(_arg0); end", "def repo=(_arg0); end", "def init_repo\n @logger.info \"repository url: #{@repository[:url]}\"\n\n if FileTest.exist?(@repository[:path])\n @logger.info \"repository path exists: #{@repository[:path]}\"\n @rgit = Git.open(@repository[:path], :log => @logger)\n @logger.info @rgit.fetch\n else\n @logger.info \"repository path doesn't exist: #{@repository[:path]}\"\n # Create LogDevice to log to websocket message\n @rgit = Git.clone(@repository[:url], @repository[:name],\n :path => @work_dir,\n :log => @logger)\n end\n end", "def initialize(user = nil, api_token = nil, repo_name = \"cookie_monster\") \n if user.nil?\n puts \"No user provided, getting from git config\"\n user = `git config --get github.user`.chomp\n end\n\n if api_token.nil?\n puts \"No API token provided, getting from git config\"\n api_token = `git config --get github.token`.chomp\n end\n\n\n @user = user.chomp # chomp in case user passes in bad data\n @api_token = api_token.chomp # chomp in case user passes in bad data\n @repo_name = repo_name\n\n # Authenticated client\n #@client = Octopussy::Client.new({:login => @user, :token => @api_token})\n\n # Location of local git repository. Necessary for pushing to Github.\n # Put it in .cloud_path so it doesn't conflict with anything\n @git_dir_path = File.expand_path(\"~/.cloud_path/\" + @repo_name)\n\n create_repo\n create_git_dir\n \n # For whatever reason, Repository.find raises Octopi::NotFound when\n # we've just created the repository in this run of the script.\n # Possibly a caching error.\n begin\n repo = Repository.find(:user => @user, :repo => @repo_name)\n rescue Octopi::NotFound\n puts \"Repository not found. Probably just created repository, please\"\n puts \"run this script again.\"\n exit 0\n end\n end", "def initialize(name, repository, reference, submodules = false)\n super repository\n\n @name = name\n @repository = repository\n @reference = reference\n @need_submodules = submodules\n\n @remote = true\n @root_dir = Gem.dir\n @git = ENV['git'] || 'git'\n end", "def create\n url = repo_params[:html_url]\n params = Repo.get_repo(url, current_user)\n if params == nil\n redirect_to :back, notice: 'Error with API access token.'\n return\n end\n if params == -1\n redirect_to :back, alert: 'Repo already exists' and return\n end\n\n params[:user_id] = current_user.id\n @repo = Repo.new(params)\n\n respond_to do |format|\n if @repo.save\n format.html { redirect_to @repo, notice: 'Repo was successfully created.' }\n format.json { render :show, status: :created, location: @repo }\n else\n format.html { render :new }\n format.json { render json: @repo.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(ref, remote, basedir, dirname = nil)\n\n @remote = remote\n @basedir = basedir\n @dirname = dirname || ref\n\n @full_path = File.join(@basedir, @dirname)\n @git_dir = File.join(@full_path, '.git')\n\n @cache = R10K::Git::Cache.generate(@remote)\n\n if ref.is_a? String\n @ref = R10K::Git::Ref.new(ref, self)\n else\n @ref = ref\n @ref.repository = self\n end\n end", "def initialize(container, path = nil)\n @container = container\n @path = path || PathUtils.join(@container.container_dir, 'git', \"#{@container.application_name}.git\")\n end", "def initialize( args = {} )\n\n ::Octokit.configure do |c|\n c.access_token = args[:github_auth] || ENV['GITHUB_AUTH']\n c.auto_paginate = true\n end\n\n @params = {}\n @params[:context] = args[:context] or raise \"Requires a context\"\n @params[:target_url] = args[:url]\n \n path = args[:repo] || '.'\n @repo = GithubInformer.determine_repo(path)\n @sha = GithubInformer.determine_sha(path)\n end", "def get_repo_info path=\".\", shell=nil\n defaults = {:type => @scm, :url => @url, :path => path}\n\n defaults.merge self.class.get_info(path, shell)\n end", "def repo; end", "def repo; end", "def repo; end", "def repo; end", "def initialize(repository, options={})\n raise 'Missing base directory' unless options[:basedir]\n @repository = repository\n @max_bytes = options[:max_bytes] || nil\n @max_seconds = options[:max_seconds] || nil\n @basedir = options[:basedir]\n @repo_dir = RightScraper::Retrievers::Base.repo_dir(@basedir, repository)\n unless @logger = options[:logger]\n raise ::ArgumentError, ':logger is required'\n end\n @logger.operation(:initialize, \"setting up in #{@repo_dir}\") do\n ::FileUtils.mkdir_p(@repo_dir)\n end\n end", "def initialize name, repository, reference, submodules = false\n super(nil)\n\n @name = name\n @repository = repository\n @reference = reference\n @need_submodules = submodules\n\n @git = ENV['git'] || 'git'\n end", "def initialize(path, workdir:, **options)\n @url = ::Pathname.new(mangle(path))\n @workdir = ::Pathname.new(workdir)\n end", "def repository(repo, options = {})\n get Repository.path(repo), options\n end", "def url\n RepoURL.new(@repo[:html_url]).repo_url\n end", "def repo_url(path = \"\")\n if @repo.url\n url = URI::parse(@repo.url)\n url.path = (url.path + \"/\" + path).gsub(%r'//+', '/')\n url.to_s\n else\n compose_url \"/svc/repo\", @repo.name, path\n end\n end", "def repository(project)\n Grit::Repo.new(project.folder)\n end", "def clone(path, options={})\n with_env do\n grit.git.clone(options, grit.path, path)\n clone = Grit::Repo.new(path)\n\n if options[:bare]\n # bare origins directly copy branch heads without mapping them to\n # 'refs/remotes/origin/' (see git-clone docs). this maps the branch\n # head so the bare grit can checkout branch\n clone.git.remote({}, \"add\", \"origin\", grit.path)\n clone.git.fetch({}, \"origin\")\n clone.git.branch({}, \"-D\", branch)\n end\n\n # sets up branch to track the origin to enable pulls\n clone.git.branch({:track => true}, branch, \"origin/#{branch}\")\n self.class.new(clone, :branch => branch, :author => author)\n end\n end", "def initialize(ref, remote, basedir, dirname = nil)\n @ref = ref\n @remote = remote\n @basedir = basedir\n @dirname = dirname || ref\n\n @full_path = File.join(@basedir, @dirname)\n\n @cache = R10K::Git::Cache.new(@remote)\n end", "def repo\n @repo ||= OctocatHerder::Repository.new(@raw['repo'], connection)\n end", "def git_repo\n @git_repo ||= GitRepo.new(\n git_config: project.repo_config,\n provider_credential: provider_credential\n )\n end", "def initialize(repo, name)\r\n @name = name\r\n @repo = repo\r\n end", "def create_repo\n Rugged::Repository.init_at(repo_path, :bare).tap do |repo|\n repo.remotes.create('origin', \"git@github.com:#{project.gh_path}\")\n repo.remotes.add_fetch_refspec('origin', GITHUB_PULLS_REFSPEC)\n end\n end", "def repo(user_name, repo_name)\n Github::Repo.new @access_token, user_name, repo_name\n end", "def initialize(path)\n @path = path\n \n rev,path = path.split(\":\",2)\n raise ArgumentError.new(\"Must supply a git revision\") unless rev\n path = File.expand_path(path) if path\n init_git(path || '.')\n @file_pattern = if @search_path == ''\n \"**.rb\"\n elsif @search_path =~ /\\.rb#{File::SEPARATOR}$/\n # So appending each piece into the search path during init_git\n # causes the search path to always end with a /\n @search_path[0...-1]\n else\n File.join(@search_path,\"**.rb\")\n end\n \n @files = []\n \n FileUtils.cd(@working_dir) do\n git_list = git \"ls-tree -r #{rev}\"\n git_list.each_line do |line|\n file = GitFile.new(*line.chomp.split(/\\s+/,4))\n \n if file.type == 'blob' and File.fnmatch(@file_pattern, file.name)\n @files << file \n end\n end\n end\n \n end", "def set_repo\n @path = \"#{params[:login].strip}/#{params[:repo].strip}\"\n @repo = CacheRepo.where(path: @path).first\n if !@repo\n @repo = CacheRepo.new(path: @path)\n @repo.save!\n end\n end", "def juli_repo(path='.')\n $_repo ||= Repo.new(path)\n $_repo.juli_repo\n end", "def repository\n @repository ||= Repository::Content.new(@base_dir)\n end", "def repo(repo_name)\n Repo.new(client: @client, user: self, repo_name: repo_name)\n end", "def initialize(path)\n @path = path\n\n base = path.empty? ? docroot : \"#{docroot}/#{path}\"\n\n if File.directory? base\n @file = \"#{base}/README.md\"\n @dir = base\n @type = :readme\n elsif File.exist? \"#{base}.md\"\n @file = \"#{base}.md\"\n @dir = File.dirname file\n @type = :file\n else\n @file = ''\n @dir = docroot\n @type = :empty\n end\n end", "def init(location = \".\")\n @grit = Mercurial::Repository.create(location)\n end", "def initialize(repository_name)\n @path = in_path(repository_name)\n end", "def initialize(options = {})\n unless options[:remote] && options[:local]\n fail ':remote and :local options must be supplied when instantiating a new RevisionControl object'\n end\n\n @remote = Pathname.new(options[:remote])\n @local = Pathname.new(options[:local]).expand_path\n @remotes_method = :checkout\n initialize_local_dir(options)\n end", "def initialize(working_tree_path)\n raise RubyGit::Error, \"Path '#{working_tree_path}' not valid.\" unless File.directory?(working_tree_path)\n\n @path = root_path(working_tree_path)\n RubyGit.logger.debug(\"Created #{inspect}\")\n end", "def initialize(user)\n @user = user\n @path = File.join(@user.homedir, 'git', \"#{@user.app_name}.git\")\n end", "def initialize(source_url)\n @source_url = source_url\n @token = Figaro.env.github_access_token\n @github_regexp = %r{\n \\A(https?:\\/\\/(w{3}\\.)?)? # protocol and www optional at start\n github\\.com\\/ # domain name\n (?<owner>[\\w\\-\\.]+)\\/ # owner of repo\n (?<name>[\\w\\-\\.]+)\\/?\\z # name of repo at end\n }x\n\n @repo = @source_url ? parse_repo : nil\n @repo_data = @repo ? request_repo_data : nil\n end", "def initialize(repo_url=nil)\n unless repo_url.nil?\n @repository_url = repo_url\n @username = repo_url.split('@').first\n end\n end", "def repo\n options[:repo]\n end", "def initialize( repo=nil, **args )\n\t\t@repo = Pathname( repo ) if repo\n\n\t\t@reader = nil\n\t\t@writer = nil\n\n\t\t@pid = nil\n\n\t\t@byte_input_callback = nil\n\t\t@line_input_callback = nil\n\tend", "def git_init\n @repo = Rugged::Repository.init_at(repo_path.to_s)\n @index = repo.index\n end", "def git_check\n # May throw InvalidRepositoryException\n # - because of invalid path\n # - or broken git repository\n @repo = GitLib::Repo.new(path)\n end", "def initialize opts={}\n @refresh = opts[:refresh]\n @path = opts[:path]\n @clone = opts[:clone]\n @master = opts.fetch :master, false\n\n if @refresh\n refresh\n else\n update_branches\n update_tags\n end\n end", "def initialize(full_name)\n # GitHub login, uses MORPH_ prefix to make morph.io happy\n @login = [ENV['MORPH_UNAME'], ENV['MORPH_PWD']]\n abort 'Set $MORPH_UNAME and $MORPH_PWD' unless @login.any?\n @api_url = ROOT + '/repos/' + full_name\n # Check if rate limited\n abort 'Rate limited' if rate_limited?\n fetch_json\n info\n end", "def git_data(options = {})\n @git_data ||= ApiFactory.new 'GitData', options\n end", "def initialize_grit_repos (git_repos)\n\tgit_repos['rugged'] = []\n\tgit_repos['includes'].each do | path |\n\t\tgit_repos['rugged'].push(Rugged::Repository.new(path))\n\tend\nend", "def repository!\n Repository.find_or_create_by!(url: repository_url) do |repo|\n repo.organization_id = org_id\n repo.name = repository_name\n end\n end", "def initialize(location, options)\n @location = location\n @origin = options[:origin]\n @repo_name = File.basename location\n @documents = get_repo_files\n @fachklassen_strings = get_fachklassen_strings\n @textbausteine = get_textbausteine\n @enabled = true\n end", "def GitSimple(*args) # rubocop:disable Naming/MethodName\n GitSimple.new(*args)\nend", "def initialize(options={})\n @id = options[\"id\"].to_i\n @description = options[\"description\"]\n @git_repo = options[\"git_repo\"]\n end", "def load_git\n @git = Gittastic.new(root_path)\n end", "def repository\n unless Colonel.config.rugged_backend.nil?\n @repo ||= Rugged::Repository.init_at(File.join(Colonel.config.storage_path, id), :bare, backend: Colonel.config.rugged_backend)\n else\n @repo ||= Rugged::Repository.init_at(File.join(Colonel.config.storage_path, id), :bare)\n end\n end", "def url\n \"http://github.com/#{@account}/#{name}/tree/master\"\n end", "def initialize archive_path = nil, upload_archive = false\n @wiki_url = nil\n @client = nil\n @archive_path = archive_path\n @upload_archive = upload_archive\n end", "def gitrepo(repo, name, ref = 'master')\n mod name.split('/').join('-'),\n :git => \"https://#{repo}/#{name}.git\",\n :ref => ref\nend", "def git\n @git ||= MiniGit.new('.')\n end", "def initialize(location)\n @repository = JGit::Api::Git.open(location.to_jfile) \n end", "def initialize( name, options={} )\n @parent = options[:parent]\n @name = name\n @repositories = Array.new\n @badges_static = Array.new\n @badges_dynamic = Array.new\n end", "def repository\n @repository ||= Github::Repository.find user: user, name: name\n end", "def initialize(path, username=nil, email=nil)\n @stale = true # DB is always stale until it is initialized\n\n init = false\n if not File.exist? path\n Repo.create(path)\n init = true\n end\n\n super(path)\n @stale = false # DB is connected!\n\n if init\n # initial commit is needed for branches to work smoothly\n stage { |idx| idx.add('.git-ds/version', \"1.0\\n\") }\n staging.commit('Database initialized.')\n unstage\n end\n\n @actor = Grit::Actor.new(username, email) if username\n @subscribers = {}\n\n end", "def repo\n @repo ||= Gerrit::Repo.new(@config)\n end", "def git_init\n @repo = Rugged::Repository.init_at repo_path.to_s\n @index = repo.index\n end", "def url\n \"http://github.com/#{repo.owner.login}/#{repo.name}/#{name}\"\n end", "def initialize(name, repository_name=nil, git_branch=nil)\n @name = name\n @repository_name = repository_name\n @git_branch = git_branch\n end", "def initialize( repo, tag:, node:, rev: 0, type: '' )\n\t\t@repo = repo\n\t\t@name = tag\n\t\t@node = node\n\t\t@rev = rev\n\t\t@type = type\n\tend" ]
[ "0.7109744", "0.7041847", "0.6848038", "0.66577363", "0.6619191", "0.6599755", "0.64829564", "0.64829564", "0.64089274", "0.6382232", "0.63275844", "0.63234204", "0.6310823", "0.62418413", "0.619803", "0.6170417", "0.611312", "0.6064326", "0.6048316", "0.60084414", "0.598814", "0.5965331", "0.59480625", "0.59224766", "0.5919461", "0.58739656", "0.58640844", "0.58528394", "0.58452797", "0.5839675", "0.5796683", "0.5796683", "0.5796683", "0.5796683", "0.5757313", "0.57400244", "0.5732514", "0.5701444", "0.57003975", "0.56881064", "0.5680029", "0.5677548", "0.5664063", "0.5664063", "0.5664063", "0.5664063", "0.56600165", "0.5658122", "0.56355876", "0.56352305", "0.5627963", "0.5605683", "0.5595447", "0.55772847", "0.5557141", "0.5554193", "0.5549938", "0.552625", "0.5519248", "0.5511862", "0.5502431", "0.5496088", "0.54781514", "0.54731536", "0.54647917", "0.5447498", "0.54444766", "0.54354143", "0.541281", "0.5402531", "0.5402299", "0.5397724", "0.53863376", "0.53849506", "0.53844535", "0.53787285", "0.53658277", "0.5363221", "0.536047", "0.5358959", "0.53472805", "0.53266954", "0.5322313", "0.5315515", "0.53147894", "0.5305487", "0.5304034", "0.5302727", "0.52952003", "0.5294442", "0.5292816", "0.5290755", "0.52900624", "0.5286909", "0.52838904", "0.52763665", "0.5271089", "0.5265194", "0.52615166", "0.52597106" ]
0.74790776
0
Public: check whether the wiki's git repo exists on the filesystem. Returns true if the repo exists, and false if it does not.
def exist? @access.exist? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists?\n File.exists?(File.join(@repo_dir, '.git'))\n end", "def git_repository?\n @root.join('.git').directory?\n end", "def git_repo?\n !repository_root.to_s.empty?\n end", "def is_git_repo?\n Pkg::Util.in_project_root do\n _, _, ret = Pkg::Util::Execution.capture3(\"#{GIT} rev-parse --git-dir\")\n Pkg::Util::Execution.success?(ret)\n end\n end", "def usable_repository?\n repository_cache.directory? &&\n run_and_output(\"#{git} remote -v | grep origin\").include?(uri)\n end", "def exist?\n File.exist? File.join(path, '.git/HEAD')\n end", "def existing_repo?\n @repo = Repo.where(full_name: repo_full_name).first\n @repo.present?\n end", "def valid_git_repository(path)\n raise \"#{path} is not a directory\" unless File.directory?(path) \n raise \"#{path} is not a git repository\" unless File.exist?(File.join(path,'.git')) && (File.directory?(File.join(path,'.git')))\n return true\n end", "def check_git_repo\n # check local dir\n\n # use Open3 in order to get stderr output from child process\n # `` syntax only returns stdout output which is not enough\n\n # since command are all executed in newly spawned child processes so there's no need to record old dir path\n stdout, stderr = Open3.popen3(\"cd #{@local_path} && git status\")[1..2]\n\n local_branch_name = stdout.gets.to_s.match(/^On branch ([^\\s]+)/)[1]\n unless local_branch_name\n raise GitRepoException, \"local path #{@local_path} is not a git repository\"\n end\n\n # check remote dir\n valid = true\n remote_branch_name = ''\n @ssh.exec!(\"cd #{@remote_path} && git status\") do |ch, stream, data|\n case stream\n when :stdout\n valid = false unless (remote_branch_name = data.match(/^On branch ([^\\s]+)/)[1])\n when :stderr\n valid = false unless (data.nil? or data == '')\n end\n end\n unless valid\n raise GitRepoException, \"remote path #{@remote_path} is not a git repository\"\n end\n\n # check match\n if local_branch_name != remote_branch_name\n raise GitRepoException, \"local branch(#{local_branch_name}) and remote branch(#{remote_branch_name}) don't match\"\n end\n end", "def exist?\n @grit && @grit.git.exists?\n end", "def git_check\n # May throw InvalidRepositoryException\n # - because of invalid path\n # - or broken git repository\n @repo = GitLib::Repo.new(path)\n end", "def is_git_directory?\n Dir.entries('.').include? '.git'\n end", "def git?\n !!git_directory\n end", "def git_directory?\n return if Dir.exist?('.git')\n puts 'You are not in a git project repository.'\n exit!\n end", "def git?\n dir? '.git'\n end", "def git?\n dir? '.git'\n end", "def exists?\n File.exists?(File.join(@repo_dir, '.svn'))\n end", "def local_configuration_repo_exists?\n unless Dir.exist?(Services.ci_config_git_repo_path)\n logger.debug(\"local configuration repo doesn't exist\")\n return false\n end\n\n return true\n end", "def local_valid_repo?\n @local_dir_path.directory?\n end", "def check_repo(url)\n output = `git ls-remote #{url} 2>&1`\n if ($? != 0)\n raise BadRepo.new(url + \"<<<\" + output.to_s + \">>>\")\n end\n end", "def validate_in_repo\n unless File.exist?('.git')\n raise NotInAGitRepository, \"We don't appear to be inside a Git repository!\"\n end\n end", "def validate_repo\n @repo_root = shellout('git rev-parse --show-toplevel').stdout.chomp\n rescue Exception => e\n ui.error \"There doesn't seem to be a git repo at #{@cb_path}\\n#{e}\"\n exit 3\n end", "def fetched?\n return nil if !repo\n return false if !working_dir\n files = Dir.glob(\"#{working_dir}/**/*\")\n\n return true if files.any?\n return false\n end", "def verify_repo_exists(config)\n build_client(config).repo config[:repo]\n end", "def verify_file_under_repo(filepath)\n unless File.expand_path(filepath).starts_with?(GIT_REPO)\n raise \"Invalid path=#{filepath}, must be under git-wiki repository\"\n end\n filepath\n end", "def access_to_repo?(repo_url: nil)\n client.repository?(repo_url.sub(\"https://github.com/\", \"\"))\n end", "def project_is_configured_for_git?\n\t\t\tFile.directory? '.git'\n\t\tend", "def gitdir?(dirpath)\n gitpath = \"#{dirpath}/.git\"\n File.exist?(gitpath) && File.directory?(gitpath)\n end", "def github_repo?\n @url.scan('https://github.com/').present?\n end", "def is_git?\n `git status 2> /dev/null` != \"\"\nend", "def cloned?\n File.directory? git_dir\n end", "def is_repo?\n GIT_CONFIG['config core.repositoryformatversion']\n end", "def local_repository?\n @local_repository.nil? ? true : @local_repository\n end", "def file_exists?(filename, ref)\n return (not `cd #{@path}; git ls-tree #{ref} -- #{filename}`.chomp.strip.empty?)\n end", "def repository?(directory = nil)\n command = 'git rev-parse'\n # expand_path might fail if we're in a directory that was deleted\n begin\n directory = File.expand_path('.') if directory.nil?\n rescue StandardError\n return false\n end\n\n # Directory does not exist, so can't be a git one\n return false unless File.exist?(directory)\n\n # Special .git directory can't be considered a repo\n split = directory.split('/')\n return false if split.include?('.git')\n\n # We temporarily change dir if one is specified\n previous_dir = File.expand_path('.')\n Dir.chdir(directory)\n success = command_success?(command)\n Dir.chdir(previous_dir)\n success\n end", "def import_wiki?\n client_repository&.has_wiki &&\n !project.wiki_repository_exists? &&\n Gitlab::GitalyClient::RemoteService.exists?(wiki_url)\n end", "def clone_repository\n if File.directory?(base_path)\n repo = ::Git.open(base_path)\n repo.checkout(\"master\")\n repo.pull\n repo.fetch\n else\n ::Git.clone(url, base_path)\n end\n true\n end", "def svn_repo?(dir)\n Dir.chdir(dir) { `svn info > /dev/null` }\n $?.success?\n end", "def cloned?\n File.directory? @git_dir\n end", "def git_installed?\n\tbegin\n\t `git config > /dev/null 2>&1`\n\trescue\n\t false\n\tend\n end", "def nothing_to_commit?\n Dir.chdir @root do\n cmd = \"git status\"\n stdout, stderr, status = Open3.capture3 cmd\n if status != 0\n case stderr\n when /Not a git repository/\n raise NotARepositoryError\n else\n raise Error, stderr\n end\n end\n # Check if status indicates nothing to commit\n return /nothing to commit/.match stdout\n end\n end", "def directory?\n repos.stat(fs_path, revision).directory?\n end", "def run_repo_exists?(repo)\n\t\t\tif v.repo_exists?(repo)\n\t\t\t\t$stdout.puts Rainbow(\"Success: '#{repo}' exists and '#{ev.user}' has privileges\").green\n\t\t\telse\n\t\t\t\texit 1\n\t\t\tend\n\t\tend", "def git?(project_path,git_name)\n result = gits(project_path)\n result.find do |x|\n x.name.to_s == git_name\n end\n end", "def in_git?\n Kernel.system('git rev-parse --show-prefix 2>/dev/null')\n end", "def repo_exists?(repo_id)\n return false if repo_id == nil || repo_id == false # It actually returns true without this conditon.\n app_client.repository?(repo_id)\nend", "def git?(location)\n location.location_type == :git_repository\n end", "def has_repository?(id)\n repositories.has_key?(id.to_s)\n end", "def is_working_dir path\n File.exist? File.expand_path \".git\", path\n end", "def repo_object_exists?\n @repo_object_exists ||= batch_item.repo_object_exists?\n end", "def sync_repo(org, repo)\n full_repo_name = \"#{org}/#{repo}\"\n full_repo_path = \"#{@git_dir}/#{org}/#{repo}\"\n\n # check whether repo exists on github.com\n is_github_repo = @github_client.repository?(full_repo_name)\n\n # check whether repo previously cloned\n is_cloned = Dir.exist?(full_repo_path)\n\n # check whether repo exists on ghe host\n is_ghe_repo = @ghe_client.repository?(full_repo_name)\n\n if is_github_repo\n if is_cloned && is_ghe_repo\n fetch_repo(full_repo_path)\n push_repo(full_repo_path)\n elsif is_cloned && !is_ghe_repo\n create_repo(org, repo)\n fetch_repo(full_repo_path)\n push_repo(full_repo_path)\n elsif !is_cloned && is_ghe_repo\n @logger.error 'Repo already exists on ghe'\n else\n clone_repo(full_repo_name, full_repo_path)\n create_repo(org, repo)\n push_repo(full_repo_path)\n end\n else\n @logger.error \"Repo doesn't exist on github.com\"\n end\n end", "def check_repo_status\n porcelain_status, = Executable.capture_command('git', %w(status --porcelain), :capture => :merge, :chdir => repo_dir)\n clean = porcelain_status == ''\n raise Informative, \"The repo `#{@repo}` at #{UI.path repo_dir} is not clean\" unless clean\n end", "def can_access_git?\n true\n end", "def team_repo?(id, owner, repo)\n boolean_request :get, \"/teams/#{id}/repos/#{owner}/#{repo}\"\n end", "def git_installed?\n\t`git config > /dev/null 2>&1`\n end", "def git_installed?\n\t`git config > /dev/null 2>&1`\n end", "def create_repo\n # update gitolite-admin/conf/gitolite.conf file ...\n # but only if there is NOT already an entry for this repo \n # ... to avoid duplicating the entry\n conf_entry = File.read(@@gitolite_conf_file_path).slice(@gitolite_conf_entry)\n if (conf_entry == nil)\n File.open(@@gitolite_conf_file_path, \"a\") { |f| f.write @gitolite_conf_entry}\n # push updates to gitolite-admin repo to create new project repo\n git_push @@gitolite_admin_path, \"Added repo #{@project_label} with users: #{@users}\"\n return true\n else\n LOGGER.error \"Existing gitolite config file entry found for project #{@project_label}, skipping repo creation\"\n return false\n end\n \n end", "def has_remote_tracking_branch(repo)\n return false if $branch_name.empty?\n\n begin\n return !repo.branches[$remote_branch].nil?\n rescue\n return false\n end\nend", "def current_user_repository_access?\n client = Octokit::Client.new(access_token: @current_user.github_token)\n client.repository?(\"#{@project.github_owner}/#{@project.github_name}\")\n end", "def find_git_repo(path=nil)\n # use local_git_repository_path or Dir.pwd if path is not specified\n path = fetch(:local_git_repository_path, Dir.pwd) if path.nil?\n\n # expand the path\n path = File.expand_path(path)\n\n return nil if path == '/'\n\n # try to open the current path\n # if fail, go up a directory\n begin\n ::Git.open(path)\n rescue ArgumentError\n find_git_repo(File.join(path, '..'))\n end\n end", "def exists?(id)\n return Regulate::Git::Interface.exists?(id)\n end", "def raw_gitdir?\n\t\t\twith_dir do\n\t\t\t\treturn DR::Bool.to_bool(%x/git rev-parse --is-inside-git-dir/)\n\t\t\tend\n\t\tend", "def new?\n master_path = File.join @path, %w[ .git refs heads master ]\n not File.exists? master_path\n end", "def has_repo?(local_param)\n !list.find { |r| r.param == local_param }.nil?\n end", "def already_on_repo?(user, repo)\n repo.users.include?(user)\n end", "def test_git!\n result = `which git`\n if $?.exitstatus != 0\n raise IOError, \"Can't find git\"\n end\n end", "def needs_checkout?\n expected = ref.sha1\n actual = rev_parse('HEAD')\n\n ! (expected == actual)\n end", "def cached?\n Dir.exist?(cached_repo_path)\n end", "def exist?\n ruby_gems_fetcher.started?\n end", "def file?\n repos.stat(fs_path, revision).file?\n end", "def git_url?(url)\n url.include?('.git') || url.include?('git@') || url.include?('git://')\n end", "def is_managed?(path)\n # Short circuit if the directory is not present\n return false unless File.directory?(path)\n\n git = Facter::Core::Execution.which('git')\n svn = Facter::Core::Execution.which('svn')\n\n Dir.chdir(path) do\n if git\n %x{#{git} ls-files . --error-unmatch &> /dev/null}\n\n return true if $?.success?\n end\n\n if svn\n %x{#{svn} info &> /dev/null}\n\n return true if $?.success?\n end\n end\n\n return false\nend", "def check_deploy_dir\n if Dir.exist? @deploy_dir\n FileUtils.cd @deploy_dir do\n return `git remote -v`.include? @repo\n end\n end\n end", "def load_repository\n pwd = Pathname.new(ENV['PWD'].nil? ? Dir.getwd : ENV['PWD'])\n begin\n @repository = Grit::Repo.new(pwd + `cd #{pwd} && git rev-parse --git-dir 2>/dev/null`.chomp)\n rescue Grit::InvalidGitRepositoryError\n puts \"Not a valid git repo.\"\n exit!\n end\n end", "def create_site_repo\n begin\n access_token = OAuth2::AccessToken.new(new_client, github_info.access_token)\n github_username = github_info.github_username\n\n repo_data = JSON.parse(access_token.get(\"/api/v2/json/repos/show/#{github_username}\"))\n repo_exists = repo_data[\"repositories\"].any? { |repo| repo[\"name\"] == remote_repo_name }\n p \"repo exists\" if repo_exists\n\n site_repo_created! if repo_exists\n rescue OAuth2::AccessDenied\n self.lost_github_access!\n end\n end", "def find_repo_dir(here=Pathname.pwd)\n if (here + '.git').exist?\n return here\n else\n find_repo_dir(here.dirname) unless '/' == here.to_s\n end\nend", "def has_github?\n !github_url.blank?\n end", "def local_clone_dir_exists?(type,module_name,opts={})\n full_module_name = full_module_name(module_name,opts)\n ret = local_repo_dir(type, full_module_name, opts[:version], opts)\n File.directory?(ret) && ret\n end", "def git?\n is_a?(Git) # :-)\n end", "def exists?\n File.exists?(File.join(@root))\n end", "def installed?\n self.class.installed?(@repo)\n end", "def find_git\n git_path = nil\n ENV['PATH'].split(::File::PATH_SEPARATOR).each do |path|\n git_path = detect_git_path(path)\n break if git_path\n end\n\n unless git_path\n raise GitNotFound\n end\n\n return git_path\n end", "def url_exists?(github_url)\n url = URI.parse(github_url)\n req = Net::HTTP.new(url.host, url.port)\n req.use_ssl = true\n res = req.request_head(url.path)\n if res.is_a?(Net::HTTPRedirection)\n url_exist?(res['location']) # Go after any redirect and make sure you can access the redirected URL\n else\n res.code[0] != '4' # false if http code starts with 4 - error on your side.\n end\nrescue Errno::ENOENT\n false # false if can't find the server\nend", "def available?\n unless @@available\n begin\n require 'git'\n # note that require 'git' does the same version check on load but\n # we don't want to assume any particular implementation.\n #\n # FIX: we might want to parse the result and require a minimum git\n # client version.\n cmd = \"git --version\"\n `#{cmd}`\n if $?.success?\n @@available = true\n else\n raise RetrieverError, \"\\\"#{cmd}\\\" exited with #{$?.exitstatus}\"\n end\n rescue\n @logger.note_error($!, :available, \"git retriever is unavailable\")\n end\n end\n @@available\n end", "def exist?\n workspace_info.exist?\n end", "def remote_repository_access?\n configuration[:remote_repository_access] == true\n end", "def validate_repo(repo)\n repo_valid = true\n if /review\\.fuel-infra\\.org/.match(repo).nil? and /github\\.com\\/fuel-infra/.match(repo).nil?\n repo_valid = false\n end\n repo_valid\n end", "def require_git_repo(urls, commit)\n urls = filter_urls(rewrite_rules, [urls].flatten.compact)\n return if urls.empty?\n set_load_path!(\n checkout!(\n clone_one_of_repos!(urls), \n commit)\n )\n end", "def find_git\n git_path = nil\n ENV[\"PATH\"].split(File::PATH_SEPARATOR).each do |path|\n potential_path = File.join(path, 'git')\n if File.executable?(potential_path)\n git_path = potential_path\n break\n end\n potential_path = File.join(path, 'git.exe')\n if File.executable?(potential_path)\n git_path = potential_path\n break\n end\n end\n\n unless git_path\n raise GitNotFound\n end\n\n return git_path\n end", "def find_invalid_repos\n repos_with_issues = RepositorySet.new(\n Repositext::PARENT_DIR\n ).git_ensure_repos_are_ready(\n :all_content_repos\n ) { |repo_path| puts \" - #{ repo_path.split('/').last }\" }\n # TODO: Use #all_synced_foreign_repos instead of the RepositorySet method. Requires a refactoring.\n repos_with_issues += ensure_st_ops_filenames_are_valid\n if repos_with_issues.any?\n puts\n puts \"Could not proceed because the following git repositories are not ready:\".color(:red)\n puts\n repos_with_issues.each { |repo_path, issues|\n puts repo_path\n puts '-' * 40\n issues.each { |e| puts \" - #{ e }\".color(:red) }\n }\n puts\n raise ReposNotReadyError.new(\n \"\\n\\nCannot proceed with synching subtitles until all content repos are clean!\".color(:red)\n )\n end\n true\n end", "def checkout # :nodoc:\n cache\n\n return false unless File.exist? repo_cache_dir\n\n unless File.exist? install_dir\n system @git, 'clone', '--quiet', '--no-checkout',\n repo_cache_dir, install_dir\n end\n\n Dir.chdir install_dir do\n system @git, 'fetch', '--quiet', '--force', '--tags', install_dir\n\n success = system @git, 'reset', '--quiet', '--hard', rev_parse\n\n if @need_submodules\n _, status = Open3.capture2e(@git, 'submodule', 'update', '--quiet', '--init', '--recursive')\n\n success &&= status.success?\n end\n\n success\n end\n end", "def control_repo_root?(path = Dir.pwd)\n CONTROL_REPO_FILES.any? { |file| PDK::Util::Filesystem.file?(File.join(path, file)) }\n end", "def git_hook_needed?\n !File.executable?(@git_hook_path) || !File.read(@git_hook_path).match(/#{@pf_git_hook_name} \\$1/) || !pf_git_hook_valid?\n end", "def config_repo_installed?\n cmd_test %{-d \"#{config_path}\"}\nend", "def test_clone_repo\n clone_to_path = \"#{TEST_DATA_DIR}/clone.git\"\n \n assert_nothing_raised RuntimeError do\n Gitit.clone(@repo_path, clone_to_path)\n end\n \n assert(File.exist?(\"#{clone_to_path}/HEAD\"), \"Checking HEAD file exists at #{clone_to_path}\")\n \n cleanup_dir(clone_to_path)\n end", "def repo_ident_unique?\n !GitHosting.multi_repos? || GitHostingConf.unique_repo_identifier?\n end", "def status\n #does the plugin exist?\n if File.directory?(File.join(@plugin_path, '.git'))\n #okay...exists.. compare hashes\n if type == 1\n @remote_hash != @plugin_head ? 1 : 2\n else\n 3\n end\n else \n 0\n end\n end", "def git_fetch path\n Open3.popen2e *%W(git fetch origin), chdir: path do |stdin, stdout, _wait|\n not stdout.read.chomp.empty?\n end\n end", "def branch_exists?(branch = branch_name)\n git.capturing.rev_parse({:verify => true, :quiet => true}, \"refs/heads/#{branch}\")\n true\n rescue MiniGit::GitError\n false\n end", "def use_git_metadata_dir?\n false\n end", "def exists?\n factory.system.dir_exists?(@path)\n end" ]
[ "0.8149847", "0.7756363", "0.7594913", "0.75082135", "0.7500999", "0.7350848", "0.73361695", "0.7204345", "0.7179654", "0.7145069", "0.713737", "0.7122003", "0.7074788", "0.7073366", "0.70320404", "0.70320404", "0.7014439", "0.6933787", "0.6904349", "0.68840027", "0.6842989", "0.6738977", "0.6634597", "0.66313756", "0.6558175", "0.6514789", "0.6491288", "0.64885885", "0.6487695", "0.64865994", "0.6450942", "0.64186114", "0.64088786", "0.6406816", "0.6383733", "0.6351291", "0.6347055", "0.63374865", "0.63249147", "0.63248765", "0.6318756", "0.6298482", "0.6296105", "0.62960446", "0.62854415", "0.62745965", "0.6227981", "0.6222854", "0.6208307", "0.6169841", "0.61605716", "0.615149", "0.61445594", "0.6140277", "0.6137913", "0.6137913", "0.611196", "0.6095644", "0.6079496", "0.607704", "0.60670215", "0.6026277", "0.6025062", "0.60197943", "0.6013413", "0.60074645", "0.59808123", "0.5967835", "0.5931766", "0.5923707", "0.5922216", "0.59030837", "0.58839816", "0.584391", "0.5843699", "0.5839408", "0.579215", "0.5789636", "0.5782242", "0.5770055", "0.5761068", "0.5736181", "0.57349336", "0.5718017", "0.57118523", "0.57023364", "0.5665502", "0.56562775", "0.56489307", "0.56266654", "0.5607109", "0.56064874", "0.5583897", "0.5569808", "0.5565366", "0.556496", "0.5543997", "0.5529078", "0.5528442", "0.55276394", "0.5526292" ]
0.0
-1
Public: Get the formatted page for a given page name, version, and dir. path The String path to the the wiki page (may or may not include file extension).
def page(path, version = nil, global_match = false) ::Gollum::Page.find(self, path, version.nil? ? @ref : version, false, global_match) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_path(name, version='master')\n page = wiki.page(name, version)\n if !page.nil?\n \"#{path}/#{page.path}/#{page.version.id}\"\n end\n end", "def wiki_page(name, path = nil, version = nil, exact = true)\n wiki = wiki_new\n path = name if path.nil?\n name = extract_name(name) || wiki.index_page\n path = extract_path(path)\n path = '/' if exact && path.nil?\n\n OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, exact, version),\n :name => name, :path => path)\n end", "def page(path)\n path = normalize_path(path)\n @pages[path]\n end", "def wikifile(path, version=nil)\n log_info \"wikifile: #{path}, #{version}\"\n path = Gollum::Page.cname(path)\n\n ext = File::extname(path)\n if ext == ''\n name = File.basename(path)\n dir = File.dirname(path)\n\n if page = @wiki.paged(name, dir, version)\n WikiFile.find(self, page.filename, version)\n else\n WikiFile.path = path+'.md'\n end\n else\n WikiFile.find(self, path, version)\n end\n end", "def page( lang, path )\n root_page( lang ).descendant( path )\n end", "def write_page(page, path = '')\n self.output_resource_op page\n\n # Note: we assume the current locale is the default one\n page.translated_in.each do |locale|\n default_locale = locale.to_sym == self.mounting_point.default_locale.to_sym\n\n # we do not need the localized version of the filepath\n filepath = page.fullpath.dasherize\n\n Locomotive::Mounter.with_locale(locale) do\n # we assume the filepath is already localized\n self.write_page_to_fs(page, filepath, default_locale ? nil : locale)\n end\n end\n\n self.output_resource_op_status page\n\n # also write the nested pages\n (page.children || []).each do |child|\n self.write_page(child, page.depth == 0 ? '' : page.slug)\n end\n end", "def get_page(path, raw = false)\n\n #head = @repo.commits.first\n #tree = head.tree @branch\n\n tree = @repo.tree @branch\n blob = tree / path\n\n return nil if ! blob.is_a? Grit::Blob\n\n text = blob.data.force_encoding('utf-8').encode\n return [ text, blob.id ]\n end", "def write_page(path, format, data, commit = {})\n write(merge_path_elements(nil, path, format), data, commit)\n end", "def retrieve_pages(dir, dot_pages); end", "def get_page(name, version='master')\n IO.read(page_path(name, version)) if cache_hit?(name, version)\n end", "def page_file page_name\n file_name = File.basename(page_name).gsub('.', '_')\n\n File.join @path, File.dirname(page_name), \"page-#{file_name}.ri\"\n end", "def page(wiki, commit)\n blob = self.blob(wiki.repo)\n page = wiki.page_class.new(wiki).populate(blob, self.dir)\n page.version = commit\n page\n end", "def extract_title_from_page(page_path)\n f = File.open(page_path)\n file_contents = f.read\n f.close\n\n markdown_translator = Yuzu::Translators::Translator.translators[:markdown]\n markdown_translator.extract_title_from_contents(file_contents)\n end", "def page(name, version = 'master')\n @page_class.new(self).find(name, version)\n end", "def build_page(path, silent: false)\n page = sitemap[path]\n out_fname = File.join(BUILD_DIR, path)\n puts \"Rendering #{out_fname}...\" unless silent\n\n # Check page data for info on how to build this path\n if page['template'].present?\n ctx = TemplateContext.new(@config)\n ctx.page = page\n # Check if we have a layout defined, use it\n layout = ctx.page.key?('layout') ? ctx.page['layout'] : config['layout']\n\n # Make sure to render the template inside the layout render so code in the\n # erb layout and template are executed in a sensible order.\n content =\n if layout.present?\n ctx.render(layout) { ctx.render(ctx.page['template']) }\n else\n ctx.render(ctx.page['template'])\n end\n elsif page['json'].present?\n content = page['json'].to_json\n elsif page['file'].present?\n content = File.read(page['file'])\n else\n raise(\n ArgumentError,\n \"Page '#{path}' missing one of required attributes: 'template', 'json', 'file'.\"\n )\n end\n\n # If page data includes a digest flag, add sha1 digest to output filename\n if page['digest'] == true\n ext = VizBuilder.fullextname(path)\n fname = File.basename(path, ext)\n dir = File.dirname(path)\n digest = Digest::SHA1.hexdigest(content)\n digest_fname = \"#{fname}-#{digest}#{ext}\"\n page['digest_path'] = \"#{dir}/#{digest_fname}\"\n out_fname = File.join(BUILD_DIR, dir, digest_fname)\n end\n\n FileUtils.mkdir_p(File.dirname(out_fname))\n File.write(out_fname, content)\n content\n end", "def set_page(name, version, content)\n p \"set page: #{name} : #{version.class}\"\n page = wiki.page(name, version)\n if !page.nil?\n path = page_path(name, version)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(content)\n end\n end\n end", "def new_page_info\n args = Webby.site.args\n\n # TODO: maybe even get rid of this method altogether\n raise \"Usage: webby #{args.rake.first} 'path'\" if args.raw.empty?\n\n [args.page, args.title, args.dir]\n end", "def documentation_page store, generator, path, req, res\n text_name = path.chomp '.html'\n name = text_name.gsub '/', '::'\n\n if klass = store.find_class_or_module(name) then\n res.body = generator.generate_class klass\n elsif page = store.find_text_page(name.sub(/_([^_]*)\\z/, '.\\1')) then\n res.body = generator.generate_page page\n elsif page = store.find_text_page(text_name.sub(/_([^_]*)\\z/, '.\\1')) then\n res.body = generator.generate_page page\n else\n not_found generator, req, res\n end\n end", "def find_page(title, version = nil, load_content: true)\n page_title, page_dir = page_title_and_dir(title)\n\n if page = wiki.page(title: page_title, version: version, dir: page_dir, load_content: load_content)\n WikiPage.new(self, page)\n end\n end", "def initialize(path, page)\n @path = path\n @page_name = page\n end", "def find_by_path(path)\n Pages::Finder.by_path(path)\n end", "def url\n\t\t\"#{base}/wiki/#{page}\"\n\tend", "def update_page(page, name, format, data, commit = {})\n name ||= page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n if page.name == name && page.format == format\n index.add(page.path, normalize(data))\n else\n index.delete(page.path)\n add_to_index(index, dir, name, format, data, :allow_same_ext)\n end\n end\n\n @access.refresh\n update_working_dir(index, dir, page.name, page.format)\n update_working_dir(index, dir, name, format)\n\n sha1\n end", "def page_name\n basename = File.basename @relative_name\n basename =~ /\\.(rb|rdoc|txt|md)$/i\n\n $` || basename\n end", "def page_content(title)\n\tFile.read(\"pages/#{title}.txt\")\n rescue Errno::ENOENT\n \treturn nil\n end", "def update_page(page, name, format, data, commit = {})\n name = name ? ::File.basename(name) : page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n filename = (rename = page.name != name) ? Gollum::Page.cname(name) : page.filename_stripped\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n if !rename && page.format == format\n committer.add(page.path, normalize(data))\n else\n committer.delete(page.path)\n committer.add_to_index(dir, filename, format, data)\n end\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(dir, page.filename_stripped, page.format)\n index.update_working_dir(dir, filename, format)\n end\n\n multi_commit ? committer : committer.commit\n end", "def page\n\t\t@visited_pages = []\n\t\tlogger.debug \"retreiving page for #{name}\"\n\t\tfind_page(name, false)\n\tend", "def index (path)\n extension = FileUtils.extension(path).downcase\n\n if extension == 'txt'\n return IO.read(path)\n end\n\n if extension == 'html' || extension == 'htm'\n return IO.read(path)\n end\n\n tmp = self.temp('html')\n begin\n FileUtils::OpenOffice.convert(path, tmp)\n return IO.read(tmp) if File.exists?(tmp)\n rescue\n ensure\n File.delete(tmp) if File.exists?(tmp) && File.writable?(tmp)\n end\n\n ''\n end", "def page_content(title)\n File.read(\"pages/#{title}.txt\")\nrescue Errno::ENOENT\n return nil\nend", "def path\n File.join Dubya.root_path, 'vendor/wiki'\n end", "def status_page( lang, path, status )\n Rayo::Models::StatusPage.new( self, root_page( lang ), path, status )\n end", "def save_page page\n return unless page.text?\n\n path = page_file page.full_name\n\n FileUtils.mkdir_p File.dirname(path) unless @dry_run\n\n cache[:pages] ||= []\n cache[:pages] << page.full_name\n\n return if @dry_run\n\n File.open path, 'wb' do |io|\n Marshal.dump page, io\n end\n end", "def show(name)\n\t\tif !@wiki.valid?\n\t\t\tstatus 500\n\t\t\t@name = \"Wiki directory not found\"\n\t\t\t@error = \"We couldn't find the wiki directory your configuration is pointing to.<br/>Fix that, then come back - we'll be happier then.\"\n\t\t\terb :error500\n\t\telse\n\t\t\tif @page = @wiki.page(name)\n\t\t\t\t# may success come to those who enter here.\n\t\t\t\t@name = @page.name\n\t\t\t\t@content = @page.content\n\t\t\t\terb :show\n\t\t\telse\n\t\t\t\tstatus 404\n\t\t\t\t@newpage = name\n\t\t\t\t@name = \"404: Page not found\"\n\t\t\t\terb :error404\n\t\t\tend\n\t\tend\n\tend", "def doc( path )\n get \"#{path}.html\" do\n password_protected!\n \n endpoint = path.split('/').last\n \n template_path = File.join( VIEW_PATH, \"#{endpoint}.md\" )\n rendered = GitHub::Markup.render( template_path )\n\n erb :layout, :locals => { :content => rendered }\n end\nend", "def get_content(file_path)\n puts \"getting markdown for: #{file_path}.md\\n\\n\"\n file = File.open(\"data/pages/#{file_path}.md\", \"r\")\n return file.read\nend", "def update_page(page, name, format, data, commit = {})\n name ||= page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = nil if dir == '.'\n rename = (page.name != name || page.format != format)\n new_path = ::File.join([dir, self.page_file_name(name, format)].compact) if rename\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n if !rename\n committer.add(page.path, normalize(data))\n else\n committer.delete(page.path)\n committer.add_to_index(new_path, data)\n end\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(page.path)\n index.update_working_dir(new_path) if rename\n end\n\n multi_commit ? committer : committer.commit\n end", "def write_page(name, format, data, commit = {})\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n add_to_index(index, '', name, format, data)\n end\n\n @access.refresh\n update_working_dir(index, '', name, format)\n\n sha1\n end", "def initialize(path, options = {})\n options = self.class.default_options.merge(options)\n if path.is_a?(GitAccess)\n options[:access] = path\n path = path.path\n end\n\n @path = path\n @repo_is_bare = options.fetch :repo_is_bare, nil\n @page_file_dir = options.fetch :page_file_dir, nil\n @page_file_dir = Pathname.new(\"/#{@page_file_dir}\").cleanpath.to_s[1..-1] if @page_file_dir\n @access = options.fetch :access, GitAccess.new(path, @page_file_dir, @repo_is_bare)\n @base_path = options.fetch :base_path, \"/\"\n @repo = @access.repo\n @ref = options.fetch :ref, self.class.default_ref\n @universal_toc = options.fetch :universal_toc, false\n @mathjax = options.fetch :mathjax, false\n @global_tag_lookup = options.fetch :global_tag_lookup, false\n @hyphened_tag_lookup = options.fetch :hyphened_tag_lookup, false\n @case_insensitive_tag_lookup = options.fetch :case_insensitive_tag_lookup, false\n @css = options.fetch :css, false\n @emoji = options.fetch :emoji, false\n @critic_markup = options.fetch :critic_markup, false\n @h1_title = options.fetch :h1_title, false\n @display_metadata = options.fetch :display_metadata, true\n @index_page = options.fetch :index_page, 'Home'\n @bar_side = options.fetch :sidebar, :right\n @user_icons = ['gravatar', 'identicon'].include?(options[:user_icons]) ?\n options[:user_icons] : 'none'\n @allow_editing = options.fetch :allow_editing, true\n @allow_uploads = options.fetch :allow_uploads, false\n @per_page_uploads = options.fetch :per_page_uploads, false\n @metadata = options.fetch :metadata, {}\n @filter_chain = options.fetch :filter_chain,\n [:YAML, :BibTeX, :PlainText, :CriticMarkup, :TOC, :RemoteCode, :Code, :Macro, :Emoji, :Sanitize, :PlantUML, :Tags, :PandocBib, :Render]\n @filter_chain.delete(:Emoji) unless options.fetch :emoji, false\n @filter_chain.delete(:PandocBib) unless ::Gollum::MarkupRegisterUtils.using_pandoc?\n @filter_chain.delete(:CriticMarkup) unless options.fetch :critic_markup, false\n\n Hook.execute(:post_wiki_initialize, self)\n end", "def get(path)\n uri = URI.join('https://stellar.mit.edu', path)\n page_bytes = @mech.get uri\n end", "def find_file(name)\n if name =~ /^\\//\n @wiki.file(name[1..-1], @version)\n else\n path = @dir == '.' ? name : ::File.join(@dir, name)\n @wiki.file(path, @version)\n end\n end", "def split_wiki_path_wp(path)\n cn, wn, pn = split_wiki_path path\n [\"#{cn}/#{wn}\", pn]\n end", "def view relpath\n (folder_pages+relpath).deserb(self)\n end", "def get_page_by_path(page_path, output = :OBJECT, post_type = 'page')\n slugs = page_path.split('/')\n ancestors = []\n p_class = Railspress::WpPost.find_sti_class(post_type)\n page = nil\n begin\n post_parent = 0\n slugs.each do |slug|\n begin\n page = p_class.where(post_name: slug, post_parent: post_parent).first!\n post_parent = page.id\n ancestors << page\n rescue ActiveRecord::RecordNotFound\n page = nil\n break\n end\n end\n rescue ActiveRecord::RecordNotFound\n page = if slugs.size == 1 # retry without considering the parent\n p_class.where(post_name: params[:slug]).first\n else\n nil\n end\n end\n page\n end", "def wikify_path(path)\n wiki_parts = path.split(File::SEPARATOR).collect do |part|\n wikify(part)\n end\n return File.join(wiki_parts)\n end", "def get_page(id)\n @client.raw('get', \"/content/pages/#{id}\")\n end", "def existing_page_path(page_name, topic)\n Dir[\"#{topic_directory(topic)}/#{page_name}.*\"].first\n end", "def page(name, path = nil, cmd_params = {}, &block)\n name = name.to_s.intern\n p = Page.new(name, @page)\n builder = DSLBuilder.new(p)\n # Parent params pass to child, but overridden by command-line params (in child only)\n puts \"Parent params: #{self.params.inspect}\" if($debug)\n puts \"CMD params: #{cmd_params.inspect}\" if($debug)\n builder.params.merge!(self.params).merge!(cmd_params)\n puts \"Child params: #{builder.params.inspect}\" if($debug)\n if path = clean_path(path)\n p.path = path\n puts \"Loading page from path=#{path} using builder: #{builder}\" if($debug)\n builder.instance_eval(File.read(path))\n puts \"Child params after loading #{path}: #{builder.params.inspect}\" if($debug)\n end\n builder.instance_eval(&block) if(block_given?)\n puts \"Child params after block: #{builder.params.inspect}\" if($debug)\n\n @page.add_page(p)\n end", "def find_file(name, version=@version)\n if name =~ /^\\//\n @wiki.file(name[1..-1], version)\n else\n path = @dir == '.' ? name : ::File.join(@dir, name)\n @wiki.file(path, version)\n end\n end", "def page(permalink)\n\t\t# check if the file exists, return nil if not\n\t\tfile = dir + '/' + permalink + '.md'\n\t\treturn nil unless File.exists? file # bail out if the file doesn't exist\n\t\t\n\t\t# check if we can read content, return nil if not\n\t\tcontent = File.new(file, :encoding => \"UTF-8\").read\n\t\treturn nil if content.nil?\n\t\t\n\t\t# return a new Page instance\n\t\treturn Page.new(content, permalink, self)\n\tend", "def page(permalink)\n\t\t# check if the file exists, return nil if not\n\t\tfile = dir + '/' + permalink + '.md'\n\t\treturn nil unless File.exists? file # bail out if the file doesn't exist\n\t\t\n\t\t# check if we can read content, return nil if not\n\t\tcontent = File.new(file, :encoding => \"UTF-8\").read\n\t\treturn nil if content.nil?\n\t\t\n\t\t# return a new Page instance\n\t\treturn Page.new(content, permalink, self)\n\tend", "def calc_page_and_title_from_wikiword(wiki_word)\n wiki_page_title = wiki_word # as is for now\n page_name = wiki_word.gsub( /\\s*:\\s*/, '/').downcase\n if self.subwiki && !page_name.starts_with?('/') # unless page starts with /, remain in subwiki, so prefix with dir\n page_name = File.join(self.subwiki, page_name)\n end\n page_name = page_name[1..-1] if page_name.starts_with?('/')\n page_name = page_name + HOMEPAGE if page_name.ends_with?('/')\n page_name = page_name.wiki_filename\n page = Page.new(page_name)\n return page, wiki_page_title\n end", "def create(p)\n puts \"Creating page #{p}\"\n Dir.mkdir p unless File.exists? p\n Content.new(\"#{@dir}\", @extension).page p\n end", "def show\n \t\tpath = params[:path]\n \t\t@page = Page.find(:path => path)\n \t\tif @page\n \t\trespond_to do |format|\n \t\t\tformat.html do\n \t\t\t\t@page.layout_template && self.class.layout(@page.layout_template)\n \t\t\tend\n \t\t\tformat.xml do\n \t\t\t\t@pages = @page.children\n \t\t\t\trender :action => \"index\"\n \t\t\tend\n \t\tend\n \t\telse\n \t\t error\n \t\tend\n \tend", "def trace\n \n path = WikiPath.new\n \n page = self\n\n wikipage = Wikipedia.find(title)\n\n # If page has a parent we must stop (we can fetch the cached path or it's a loop)\n # If there's no page... we reached the end of the road\n while !page.blank? and page.parent_id.blank? \n \n path.pages << page\n \n # We must get rid of infoboxes, metadata and Image and FIle links before we get the link title\n first_link_title = wikipage.content.gsub(\"\\n\", \"\").gsub(/\\{\\{[^\\}]*\\}\\}/, \"\").gsub(\"[[Image:\", \"\").gsub(\"[[File:\", \"\").match(/\\[\\[[^\\]]*\\]\\]/)[0]\n first_link_title = first_link_title.split(\"|\").first.gsub(\"]\", \"\").gsub(\"[\", \"\") unless first_link_title.nil?\n\n if first_link_title.nil?\n page.update_attributes :is_root => true\n page = nil\n else\n\n wikipage = Wikipedia.find(first_link_title)\n\n parent_page = WikiPage.find_by_title(first_link_title)\n parent_page ||= WikiPage.create :url => \"\", :title => first_link_title, :fetched_at => Time.now\n\n page.update_attributes :parent_id => parent_page.id\n\n\n page = parent_page \n end\n end\n\n unless page.blank?\n path.pages << page\n unless page.parent_id.blank?\n \n parent_pos = path.pages.index page.parent\n # If parent is not in the path then we have a cached path\n if parent_pos.nil?\n path.pages.concat(page.ancestors.reverse)\n else # If parent is in the path then we have a loop\n\n # remove pages from path\n roots = path.pages.slice! parent_pos, path.pages.length - parent_pos\n\n # create a tree\n tree = WikiTree.create :name => roots.map(&:title).join(\" - \")\n # we remove the parent page to every root and indicate it's a root\n roots.each do |root|\n root.update_attributes :is_root => true, :parent_id => nil\n end\n\n end\n\n end\n end\n\n path.pages.each do |page|\n tree.pages << page\n page.reload\n end\n\n path\n\n end", "def new_page_path(page_name, topic)\n \"#{topic_directory(topic)}/#{page_name}#{@config[:pages_ext]}\"\n end", "def preview_page(name, data, format)\n page = @page_class.new(self)\n ext = @page_class.format_to_ext(format.to_sym)\n path = @page_class.cname(name) + '.' + ext\n blob = OpenStruct.new(:name => path, :data => data)\n page.populate(blob, path)\n page.version = @access.commit('HEAD')\n page\n end", "def pages(page)\n format_pages ||= ''\n if page.count('-') > 0\n format_pages << \"pp.&nbsp;\"\n else\n format_pages << \"p.&nbsp;\"\n end\n format_pages << page\n end", "def index\n page_title = params[:page]\n @page = @wiki.find_or_new_page(page_title)\n if @page.new_record?\n edit\n render :action => 'edit' and return\n end\n @content = @page.content_for_version(params[:version])\n if params[:export] == 'html'\n export = render_to_string :action => 'export', :layout => false\n send_data(export, :type => 'text/html', :filename => \"#{@page.title}.html\")\n return\n elsif params[:export] == 'txt'\n send_data(@content.text, :type => 'text/plain', :filename => \"#{@page.title}.txt\")\n return\n end\n render :action => 'show'\n end", "def page\n @page ||= revision.try(:page)\n end", "def nice_page_path(page)\n \"/#{page.title.parameterize}\"\n end", "def nice_page_path(page)\n \"/#{page.title.parameterize}\"\n end", "def merge_path_elements(dir, name, format)\n result = ::File.join([@page_file_dir, dir, self.page_file_name(name, format)].compact)\n result = Pathname.new(result).cleanpath.to_s\n if @page_file_dir\n raise Gollum::IllegalDirectoryPath unless result.start_with?(\"#{@page_file_dir}/\")\n result\n else\n result[0] == '/' ? result[1..-1] : result\n end\n end", "def page_content(title)\n File.read(\"pages/#{title}.txt\")\nrescue Errno::ENOENT #if file isn't there, we just won't get anything back \n return nil\nend", "def info\n\t\treturn \"\"\n\t\tp = localized_page\n\t\treturn \"\" unless p && p.content\n\t\tlogger.debug \"parsing page #{p.title}\"\n\t\t\t\n\t\t# extract the top-most section (the one before any ToC)\n\t\tc = WikiCloth::Parser.new({ :data => WikiParser::sanitize(p.content) })\n\t\tc = c.sections.first\n\t\t\n\t\tl = I18n.locale\n\t\tret = WikiParser.new({ :data => c }).to_html\n\t\t#I18n.locale = l\n\t\treturn ret\n\tend", "def show\r\n @page = Page.find(params[:id])\r\n data = File.read(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n @page.update_attribute(:html , data)\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @page }\r\n end\r\n end", "def page\n\t\tpage = request.path.split(\"/\")[-1]\n\tend", "def get_page_path\n\n #in rails 2.0, params[:page] comes back as just an Array, so to_s doesn't do join('/')\n if params[:page].is_a? Array\n page_name = params[:page].join(\"/\")\n #in rails 1.x, params[:page] comes back as ActionController::Routing::PathSegment::Result\n elsif params[:page].is_a? ActionController::Routing::PathSegment::Result\n page_name = params[:page].to_s\n else\n logger.debug \"get_page_path - params[:page] is an unrecognized type, may cause problems: #{params[:page].class}\"\n page_name = params[:page].to_s\n end\n\n page_ext = page_name.split('.')[1] unless page_name.empty?\n # TODO: Automatic support for page RSS feeds... ????\n if page_name.nil? or page_name.empty?\n page_name = params[:index]\n params[:cache_path] = \"#{request.request_uri}/index\"\n elsif !params[:index].empty?\n page_name = \"#{params[:index]}/#{page_name}\"\n end\n return page_name, page_ext\n end", "def wikipage(page, subreddit = nil)\n name = extract_attribute(subreddit, :display_name)\n\n path = \"/wiki/#{page}.json\"\n path.prepend(\"/r/#{name}\") if subreddit\n object_from_response :get, path\n end", "def remove_page(name, version='master')\n page = wiki.page(name, version)\n File.delete(page_path(name, version)) if !page.nil? && File.exists?(page_path(name, version))\n end", "def transform_pages(dir = '')\n base = File.join(self.source, dir)\n entries = Dir.entries(base)\n entries = entries.reject { |e| ['.', '_'].include?(e[0..0]) }\n \n entries.each do |f|\n if File.directory?(File.join(base, f))\n transform_pages(File.join(dir, f))\n else\n first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }\n \n if first3 == \"---\"\n page = Page.new(self.source, dir, f)\n page.add_layout(self.layouts, site_payload)\n page.write(self.dest)\n else\n FileUtils.mkdir_p(File.join(self.dest, dir))\n FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))\n end\n end\n end\n end", "def process_path\n unless params[:name].nil?\n #get path from params\n @path = params[:name]\n\n #get last section which is page name\n @name = @path.split(\"/\").last\n end\n end", "def localized_page\n\t\treturn @page if @page\n\t\tl = langtag(I18n.locale)\n\t\t\n\t\tWikipedia.Configure do\n\t\t\tdomain \"#{l}.wikipedia.org\"\n\t\t\tpath \"w/api.php\"\n\t\tend\n\t\tp = page\n\t\tif p == nil || p.content == nil\n\t\t\tlogger.debug \"defaulting to english\"\n\t\t\tWikipedia.Configure do\n\t\t\t\tdomain \"en.wikipedia.org\"\n\t\t\t\tpath \"w/api.php\"\n\t\t\tend\n\t\t\tp = page\n\t\telse\n\t\t\tlogger.debug \"sending translated\"\n\t\tend\n\t\t@page = p\n\t\t@page\n\tend", "def find(path)\n path = full_path(path)\n page_blob = find_blob(path)\n raise MissingResource unless page_blob\n new(page_blob, path)\n end", "def initialize(dir, page_extension)\n @dir = dir\n @extension = page_extension\n end", "def get(path)\n path = Pathname.new(path)\n @bags.lazy.map { |bag| bag.get(path, do_raise: false) }.find { |page| page }\n end", "def path_to_page(page, tag = nil)\n if tag\n blogo_tag_page_path(tag, page)\n else\n blogo_page_path(page)\n end\n end", "def find\n path = clean_content_pathname.join(page_id.tr(\"\\\\\", \"/\")).cleanpath.to_s\n if !path.start_with?(\"#{clean_content_pathname}/\")\n raise InvalidPageIdError.new \"Invalid page id: #{page_id}\"\n end\n path\n rescue ArgumentError\n raise InvalidPageIdError.new \"Invalid page id: #{page_id}\"\n end", "def getPage\n # get specific page from last argument\n page = @arguments[@arguments.length - 1] \n # get url for specific page\n url = \"http://oldschoolrunescape.wikia.com/wiki/#{page}\"\n\n # prints url for debugging\n# puts(url)\n\n # request page\n @page = HTTParty.get(url)\n\n # check to see if this was a valid request\n if @page.include? \"This page does not exist. Mayhaps it should?\"\n # if not valid request, abort \n abort(\"Incorrect input. Make sure you spelling is correct. The syntax is:\\n\\n\\tOSQuery -m This_monster\\n\\nThe first letter of the item must be capitalized with the rest of the letters lowercase, and there must be an underscore between each word with no spaces.\")\n end # -- end check for valid request\n end", "def to_s(page = nil)\n page ||= self.pages['index']\n\n return unless page.translated_in?(Locomotive::Mounter.locale)\n\n puts \"#{\" \" * (page.try(:depth) + 1)} #{page.fullpath.inspect} (#{page.title}, position=#{page.position})\"\n\n (page.children || []).each { |child| self.to_s(child) }\n end", "def page_identifier(path)\n # TODO: Speed this up by adding an index & unique constraint on path attribute\n Integral::Page.not_archived.find_by_path(path)&.id\n end", "def print_wikidump(filename)\n require 'nokogiri'\n require 'date'\n\n doc = Nokogiri::XML(open(filename))\n\n Enumerator.new do |out|\n doc.search(\"page\").each do |page|\n title = page.at(\"title\").inner_text\n rev = page.at(\"revision\")\n date = DateTime.parse(rev.at(\"timestamp\").inner_text).strftime(\"%Y-%m-%d\")\n body = rev.at(\"text\").inner_text\n\n # out << \"<8>=== <15>#{title} <7>(<11>#{date}<7>) <8>=========================\".colorize\n out << \"\\e[30m\\e[1m=== \\e[0m\\e[37m\\e[1m#{title} \\e[0m\\e[37m(\\e[0m\\e[36m\\e[1m#{date}\\e[0m\\e[37m) \\e[0m\\e[30m\\e[1m=========================\\e[0m\"\n out << \"\"\n out << body\n # parsed_page = WikiCloth::Parser.new(params: { \"PAGENAME\" => title }, data: body)\n # out << parsed_page.to_html\n out << \"\"\n out << \"\"\n end\n end\nend", "def page_content(title)\n File.read(\"pages/words.txt\")\nrescue Errno::ENOENT\n return nil\nend", "def document(path); end", "def get_pages_from_path(path,col)\n\ta = []\n\tcol.each do |page|\n\t\tif page.data['title']\n\t\t\tpt = page.url.split(\"/\")\n\t\t\tfl=pt[-1]\n\t\t\tif pt[0..-2].join(\"/\") == path and fl != \"index.html\"\n\t\t\t\ta << page\n\t\t\telsif pt[0..-3].join(\"/\") == path and fl==\"index.html\"\n\t\t\t\ta << page\n\t\t\tend \n\t\tend\n\tend\n\treturn a\nend", "def generate_project_page(p)\n # Redirect page\n write_file(p, '../index.html') { build_from_template('redirect.html') }\n\n # Summaries\n summaries = Dir[\"#{p.path}/*.tsv\"].map do |i|\n b = File.basename(i, '.tsv')\n generate_summary_page(i, p)\n \"<li><a href='s-#{b}.html'>#{format_name(b)}</a></li>\"\n end.join('')\n\n # Project index page\n data = {\n project_active: 'active',\n information: format_metadata(p),\n summaries: summaries.empty? ? 'None' : \"<ul>#{summaries}</ul>\",\n results: format_results(p)\n }\n write_file(p, 'index.html') { build_from_template('index.html', data) }\n end", "def render(path)\n\t\t\tredcarpet = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true)\n\t\t\tredcarpet.render(File.read(path))\n\t\tend", "def show\n @page = Page.find(params[:id])\n @version = @page.versions.last\n @author = User.all\n page = {\n :version => @version.changeset,\n :body => @page.body,\n :author => @author\n }\n respond_to do |format|\n format.html\n format.json { render json: page.to_json }\n end\n end", "def show\n @page = Page.find_by_path(params[:path].join('/'))\n\n return show_404 unless @page\n\n respond_with @page\n end", "def save_page(page, name)\n f = File.new(name,'w')\n f.puts page\n f.close\n end", "def view(title=nil, id=nil)\n if title\n encoded = title.split.join(\"_\")\n endpoint = \"https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=wikitext&page=#{encoded}&redirects\"\n elsif id\n encoded = title.split.join(\"_\")\n endpoint = \"https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=wikitext&pageid=#{encoded}\"\n end\n hash = get(endpoint)\n page = hash[\"parse\"][\"wikitext\"].to_s.gsub( '\\n', \"\\n\" )\n tmp = Tempfile.new(\"wik-#{encoded}-\")\n tmp.puts page\n system \"less #{tmp.path}\"\n tmp.close\n tmp.unlink\n return hash\n end", "def edit_wiki_page(proj_name, page_name)\n # fetch current page contents\n page = wiki_page_client(proj_name, page_name)\n begin\n page_data = JSON.parse(page.get)\n current_src = page_data['text']\n rescue RestClient::ResourceNotFound\n page_data = {}\n current_src = ''\n end\n\n new_src = yield(current_src)\n\n changed = !(new_src.nil? || new_src == current_src)\n\n if changed\n new_data = {\n 'page' => {\n 'text' => new_src,\n 'description' => 'edited with kenai-client',\n 'number' => page_data['number']\n }\n }\n page.put(JSON.dump(new_data), :content_type => 'application/json')\n end\n\n return changed\n end", "def method_missing(*args)\n path = args.first.to_s\n if args.length == 1 && path.end_with?('.md')\n convert(path)\n else\n return super(*args)\n end\n end", "def split_wiki_path(path)\n if path == \"/\"\n [ @default_coll_name, @default_wiki_name, \"/\" ]\n else\n path = path[1..-1] if path[0] == '/'\n path = path[0..-2] if path[-1] == '/'\n path = path.gsub(%r{//+}, '/')\n\n cn, wn, pn = path.split('/', 3)\n if wn.nil?\n [ cn, @default_wiki_name, \"/\" ]\n elsif pn.nil?\n [ cn, wn, \"/\" ]\n else\n [ cn, wn, pn ]\n end\n end\n end", "def pages_path\n @pages_path || root / 'pages'\n end", "def save_print_page(path, **options); end", "def visit(dir)\n # Create the directory.\n Dir.mkdir(target_path(dir))\n\n # Collect links to put on index later.\n links = []\n\n # Convert .md files to .html files.\n render_source_files = Dir.glob(File.join(dir, \"*.md\"))\n posts = render_source_files.collect{|source| Post.load_file(source)}\n\n posts_with_date = posts.select{|post| not post.date.nil?}.sort_by{|post| post.date}\n unless posts_with_date.empty?\n posts_with_date[0..-2].each_with_index do |post, i|\n later_post = posts_with_date[i+1]\n post.next_post = later_post\n later_post.prev_post = post\n end\n end\n\n posts.each do |post|\n rendered_post = POST_TEMPLATE.result(post.get_binding)\n page = Page.new(title: post.title, body: rendered_post)\n result = DEFAULT_TEMPLATE.result(page.get_binding)\n f = File.open(target_path(post.source), \"w\")\n f.write(result)\n\n links << Link.new(\n url: post.url,\n title: post.title,\n date: post.date,\n )\n end\n\n # Copy other files.\n entries = Dir.glob(File.join(dir, \"*\"))\n source_subdirs = entries.select{|e| File.directory?(e)}\n mirror_source_files = entries - render_source_files - source_subdirs\n\n mirror_source_files.each do |source|\n FileUtils.cp(source, target_path(source))\n links << Link.new(url: File.basename(target_path(source)))\n end\n\n # Recursively visit subdirectories.\n source_subdirs.each do |subdir|\n visit(subdir)\n links << Link.new(url: File.basename(target_path(subdir)))\n end\n\n # Create index if it's not already there.\n index_target_path = File.join(target_path(dir), \"index.html\")\n unless File.exist?(index_target_path)\n index = Index.new(\n links: links,\n dirname: File.join(target_url(target_path(dir)), \"/\"),\n )\n result = INDEX_TEMPLATE.result(index.get_binding)\n page = Page.new(title: index.dirname, body: result)\n result = DEFAULT_TEMPLATE.result(page.get_binding)\n f = File.open(index_target_path, \"w\")\n f.write(result)\n end\nend", "def get_pages_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_pages ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PdfApi.get_pages\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/pages\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].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 # Fix header in file\n post_body = nil\n\n # http body (model)\n # Fix header in file\n # post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DocumentPagesResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#get_pages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def initialize(path)\n @path = path\n\n base = path.empty? ? docroot : \"#{docroot}/#{path}\"\n\n if File.directory? base\n @file = \"#{base}/README.md\"\n @dir = base\n @type = :readme\n elsif File.exist? \"#{base}.md\"\n @file = \"#{base}.md\"\n @dir = File.dirname file\n @type = :file\n else\n @file = ''\n @dir = docroot\n @type = :empty\n end\n end", "def documentation_page_path(page)\n \"#{::Documentation::Engine.mounted_path}/#{page.try(:full_permalink)}\"\n end", "def page_by_name(name)\n fetch(:page,\"#{name.gsub!(/\\s/, '_')}\")\n end" ]
[ "0.7022979", "0.68316793", "0.66783845", "0.6618312", "0.63708484", "0.626719", "0.5977951", "0.5949476", "0.5936378", "0.5913472", "0.5903474", "0.5856933", "0.582536", "0.5764518", "0.5661519", "0.5623566", "0.5580037", "0.5560238", "0.5518194", "0.5510842", "0.5478415", "0.54745775", "0.5460974", "0.54448634", "0.54411304", "0.5439727", "0.54333305", "0.5421947", "0.5415198", "0.5394842", "0.53874993", "0.5380792", "0.5374854", "0.5354515", "0.53538096", "0.5335789", "0.5325719", "0.5322143", "0.53157914", "0.5311715", "0.5308336", "0.5302188", "0.528108", "0.52739507", "0.52566254", "0.5248019", "0.52440345", "0.5242389", "0.52254415", "0.52254415", "0.5223251", "0.52199614", "0.52169263", "0.5211879", "0.51802516", "0.51796013", "0.51679987", "0.51537406", "0.5150009", "0.51499146", "0.51499146", "0.5136791", "0.51330894", "0.5101552", "0.5101225", "0.5095212", "0.5076156", "0.5057713", "0.50483286", "0.5020973", "0.5017217", "0.5013314", "0.5011312", "0.49941012", "0.4993376", "0.49903926", "0.49901012", "0.4988513", "0.49820918", "0.49811742", "0.49786833", "0.49707788", "0.49373424", "0.49353698", "0.49301624", "0.49281207", "0.49196488", "0.4915125", "0.48985925", "0.48940414", "0.4893988", "0.48939064", "0.48918325", "0.48858884", "0.48815313", "0.48809382", "0.4876583", "0.48693284", "0.48662063", "0.4864105" ]
0.6145772
6
Public: Get the static file for a given name. name The full String pathname to the file.
def file(name, version = nil, try_on_disk = false) ::Gollum::File.find(self, name, version.nil? ? @ref : version, try_on_disk) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_file(name)\n File.read(\"%s/%s\" % [uri, name])\n end", "def asset(name)\n path = Root.join name.to_s.sub(/^\\//, '')\n path.file? && path.readable? ? path : nil\n end", "def file( name )\n\t\t\t\tKesh::ArgTest::type( \"name\", name, String )\n\t\t\t\tKesh::ArgTest::stringLength( \"name\", name, 1 )\t\t\t\n\t\t\t\treturn Kesh::Loader::FileInfo.new( self, name )\n\t\t\tend", "def file(name)\n begin\n @name=name\n @content=get_rest(\"extra/#{@name}\")\n rescue Stingray::NotFoundError \n nil\n end\n end", "def read(name)\n File.open(path(name)) do |f|\n f.read\n end\n end", "def get_file(name, env)\n name = name + '.rb' unless name =~ /\\.rb$/\n path = search_directories(env).find { |dir| Puppet::FileSystem.exist?(File.join(dir, name)) }\n path and File.join(path, name)\n end", "def path\n File.join(@base, '_static', @name)\n end", "def find_file(name)\n if name =~ /^\\//\n @wiki.file(name[1..-1], @version)\n else\n path = @dir == '.' ? name : ::File.join(@dir, name)\n @wiki.file(path, @version)\n end\n end", "def path_for(name, **options)\n lookup!(name, **options).fetch('file')\n end", "def file(name)\n Rule::File.new(name.to_s, path(name))\n end", "def [](file_name)\n path = absolute_path_to_file(file_name)\n return nil unless File.exist?(path)\n File.read(path)\n end", "def find_file_named name\n @files_hash[name]\n end", "def file(name, version = 'master')\n @file_class.new(self).find(name, version)\n end", "def find_file(name)\n if (explicit = folder/name.to_s).file?\n explicit\n else\n folder.glob(\"#{name}.*\").find{|f| f.file?}\n end\n end", "def find_static_file(path)\n return nil if disallowed_static?(path)\n\n candidates = [\n \"#{config.path}/#{path}\",\n \"#{theme.public_path}/#{path}\",\n ]\n\n candidates.each do |candidate|\n return candidate if File.file? candidate\n end\n\n nil\n end", "def load(name)\n render_rhtml [\"#{name}.rhtml\"]\n return \"\"\n end", "def find_file(name)\n path = File.join(TEST_FILES, name)\n raise \"Can't find #{path}\" unless File.exist?(path)\n\n yield path if block_given?\n path\n end", "def find_file(name, version=@version)\n if name =~ /^\\//\n @wiki.file(name[1..-1], version)\n else\n path = @dir == '.' ? name : ::File.join(@dir, name)\n @wiki.file(path, version)\n end\n end", "def get_page(name, version='master')\n IO.read(page_path(name, version)) if cache_hit?(name, version)\n end", "def partial(name)\n path = self.class.first_path_available(name)\n begin\n File.read(path)\n rescue\n raise if raise_on_context_miss?\n \"\"\n end\n end", "def asset(name:)\n self[:assets].select { |asset| asset[:name] =~ /#{name}/ }.first\n end", "def unique_template(name)\n File.read(unique_filename(name))\n end", "def getFile(file)\n return fileByName.fetch(file, nil)\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 static_url(resource_name, opts = {})\n opts[:language] ||= language\n opts[:platform] ||= platform\n entry = bundle.find_resource_entry(resource_name, opts)\n entry.nil? ? '' : entry.cacheable_url\n end", "def file_name\n # file = full_name\n # file = file.gsub('::', '/')\n # file = file.gsub('#' , '/')\n # file = file.gsub('.' , '-')\n # #file = File.join(output, file + '.html')\n # file\n WebRI.entry_to_path(full_name)\n end", "def find_file_named name\n @store.find_file_named name\n end", "def file(name)\n return CottaFile.new(factory, @path.join(name))\n end", "def read_file name\n\topen(\"https://raw.githubusercontent.com/NotEnoughIdea/Ideas/master/resources/#{name}.txt\").read\nend", "def partial(name)\n partial_name = \"_#{name}.#{Config.template_extension}\"\n template_dir = Pathname.new(self.template_file).dirname\n partial_path = File.expand_path(\"#{template_dir}/#{partial_name}\")\n unless File.file?(partial_path)\n partial_path = \"#{Config.shared_path}/#{partial_name}\"\n end\n File.read(partial_path)\n end", "def fetch(name)\n file_path = file_for(name)\n return File.read(file_path).strip.to_i if File.exist?(file_path)\n store(name)\n end", "def data name\n File.read data_path(name)\nend", "def name\n filename\n end", "def name\n filename\n end", "def getContents( name, dir )\n if( /^https?:\\/\\// =~ name )\n begin\n response = Excon.get( name, :expects => [200] )\n rescue Exception => e\n puts \"Error - failed to load #{name}, got non-200 code.\"\n return ''\n end\n response.body\n else\n open('public/' + name).read\n end\nend", "def page_file page_name\n file_name = File.basename(page_name).gsub('.', '_')\n\n File.join @path, File.dirname(page_name), \"page-#{file_name}.ri\"\n end", "def unique_filename(name)\n File.join(VIEW_PATH, \"#{name}.erb\")\n end", "def resource(name)\n eval('Copy::' + name.to_s.capitalize) rescue nil\n end", "def asset_url name\n host = @app.asset_host_for(name)\n return asset_path(name) if !host\n File.join(host, name)\n end", "def find(name)\n Forgery.load_paths.reverse.each do |path|\n file = \"#{path}/#{@folder}/#{name}\"\n return file if File.exists?(file)\n end\n raise ArgumentError.new(\"File '#{name}' wasn't found in '#{@folder}' folder. Searched paths: \\n#{Forgery.load_paths.join('\\n')}\")\n end", "def files(*name)\n\t\treturn File.join(name)\n\tend", "def get(container_name, file_name)\n validate_path_elements(container_name, file_name)\n\n File.from_response(\n file_name,\n client.request_raw_response(\n method: :get,\n path: \"#{container_name}/#{file_name}\",\n expected: 200,\n )\n )\n end", "def get(name, data = {})\n data = ERB::Context.new(data)\n template = template_root.join(\"#{name}.erb\").read unless name.is_a?(Pathutil)\n template = name.read if name.is_a?(Pathutil)\n template = ERB.new(template)\n\n return template.result(\n data._binding\n )\n end", "def try_read_file(name)\n File.read(name).strip\n rescue StandardError\n name\n end", "def try_read_file(name)\n File.read(name).strip\n rescue StandardError\n name\n end", "def find(name)\n base = remove_prefix(name)\n file = path.join(base)\n if file.exist?\n file.read.strip\n else\n return find(\"#{base}.css\") if base.to_s !~ /\\.css$/\n raise CSSFileNotFound.new(name, base.to_s)\n end\n end", "def get(name)\n path = \"/projects/#{project.name}/resources/#{name}\"\n resp = client.get(path)\n build_resource(resp)\n end", "def get(name)\n name.downcase!\n parts = name.split('::')\n name = name.to_sym\n\n @mutex.synchronize do\n object = @objects[name]\n unless object || @objects.include?(name)\n @directories.each do |directory|\n path = File.join(directory, @subdir, *parts) + '.rb'\n next unless File.exists?(path)\n object = load_file(parts.last, path)\n break\n end\n # Set even if not found to record misses\n @objects[name] = object\n end\n object\n end\n end", "def find_file_named(name)\n top_level.class.find_file_named(name)\n end", "def name\n @name ||= File.basename(path)\n end", "def name\n @name ||= File.basename(path)\n end", "def name\n @name ||= ::File.basename(@path)\n end", "def url\n make_file_name('html', name)\n end", "def find_manifest_entry(name)\n if dev_server_running?\n { 'file' => prefix_vite_asset(name.to_s) }\n else\n manifest[name.to_s]\n end\n end", "def file(name)\n if name.start_with?('/')\n File.new(name)\n elsif name.start_with?('~')\n File.new(name.gsub('~', \"#{ENV['HOME']}\"))\n else\n File.new(File.join(sandbox, name))\n end\n end", "def retrieve_attachment(name)\n { :file => RestClient.get(\"#{ uri }/#{ CGI.escape(name) }\"),\n :content_type => JSON.parse(RestClient.get(uri))['_attachments']['name'] }\n end", "def asset_path name\n fdpath = @app.asset(name)\n\n if fdpath && fdpath.start_with?(@app.assets_dir)\n if fdpath.start_with?(@app.public_dir)\n fdpath[@app.public_dir.length..-1]\n else\n fdpath[@app.assets_dir.length..-1]\n end\n else\n path = File.join('', name)\n [path, *@app.asset_version(name)].compact.join(\"?\")\n end\n end", "def partial(name)\n partial_name = \"_#{name}.#{Stache.template_extension}\"\n template_dir = self.virtual_path.split(\"/\")[0..-2].join(\"/\")\n partial_path = File.expand_path(File.join(Stache.template_base_path, template_dir, partial_name))\n # ::Rails.logger.info \"Checking for #{partial_path} in template_dir: #{template_dir}\"\n unless File.file?(partial_path)\n partial_path = \"#{Stache.shared_path}/#{partial_name}\"\n end\n \n # ::Rails.logger.info \"LOADING PARTIAL: #{partial_path}\"\n File.read(partial_path)\n end", "def get_resource(name)\n resource = Resource.new\n resource.name = name\n resource.get_resource\n yield resource.resource if block_given?\n resource\n end", "def name\n @name ||= File.basename(path)\n end", "def path(name)\n RubyAem::Resources::Path.new(@client, name)\n end", "def read_template(name)\n File.open(\"#{resource_template_dir}/#{name}.yaml\").read\n end", "def file_name(name)\r\n return name.to_s.downcase + '.rb' if name.kind_of?(Symbol)\r\n return ext_name(name).downcase + '.rb'\r\n end", "def filename= name\n #This is a stub, used for indexing\n end", "def get_data_file(dir, file_name)\n File.join(dir, file_name)\n end", "def open_file(name)\n file = File.open(find_file(name), 'r')\n if block_given?\n begin\n return yield file\n ensure\n file.close\n end\n end\n file\n end", "def static_get(path)\n @headers['Content-Type'] = MIME_TYPES[path[/\\.\\w+$/, 0]] || \"text/plain\"\n unless path.include? \"..\" # prevent directory traversal attacks\n\t@headers['X-Sendfile'] = \"#{PATH}/static/#{path}\"\n else\n\t@status = \"403\"\n \"403 - Invalid path\"\n end\n end", "def load_template(name)\n filename = locate_template(name)\n File.read(filename)\n end", "def path(name)\n File.join(@output_dir, name)\n end", "def find_filename(name)\n return name if not File.exists?(name)\n\n new_name = name\n count = 0\n until not File.exists?(new_name)\n count += 1\n new_name = \"#{name}_#{count}\"\n end\n\n new_name\n end", "def template(name)\n File.join TemplatePath, \"#{name}.rb\"\nend", "def by_name( name )\n available.each { |addon| return addon if addon['filename'] == name }\n return nil\n end", "def get_file(path)\n raise FileNotFoundError.new(path) unless @files[path]\n \n return Chance.get_file(@files[path])\n end", "def serve_asset(asset_name)\n asset_path = local_asset_path(asset_name)\n\n # Rudimentary mime type detection\n mime = 'application/octet-stream'\n map = {\n 'ico' => 'image/vnd.microsoft.icon',\n 'png' => 'image/png',\n 'css' => 'text/css'\n }\n\n ext = ::File.extname(asset_name)[1..-1]\n mime = map[ext] if map.key?(ext)\n\n @server.http_response.update_header('Content-Type', mime)\n @server.http_response.update_header('Content-Length', ::File.size(asset_path))\n @server.http_response.update_header('Cache-Control', 'public, max-age=1209600')\n @server.http_response.status = 200\n @server.http_response.body = ::File.open(asset_path, 'r')\n end", "def resource(name)\n name = name.to_sym\n\n resource_info = RESOURCES[name]\n if resource_info.nil?\n raise ArgumentError, sprintf('No resource found with name %s', name)\n end\n\n require_path = sprintf(RESOURCE_PATH, @path_version, resource_info[0],\n resource_info[1])\n require require_path\n\n class_path = RESOURCE_CLASS_PATH\n class_path = COMMON_CLASS_PATH if resource_info.first == 'common'\n class_path = SERVICE_CLASS_PATH if resource_info.first == 'services'\n class_path = sprintf(class_path, @version, resource_info[2])\n return class_for_path(class_path)\n end", "def get_attachment(name)\n assert_attachments_property\n\n attachment = self.attachments[name] if self.attachments\n\n unless self.id && attachment\n nil\n else\n adapter = repository.adapter\n http = Net::HTTP.new(adapter.uri.host, adapter.uri.port)\n uri = Addressable::URI.encode_component(attachment_path(name))\n response, data = http.get(uri, 'Content-Type' => attachment['content_type'])\n\n unless response.kind_of?(Net::HTTPSuccess)\n nil\n else\n data\n end\n end\n\n end", "def dyn_local_file_for(request, from)\n file = request.dup\n extension = File.extname(request)\n # Remove extension\n file.gsub!(/#{extension}$/, \"\")\n # Remove cache-buster (/js/app.28389 => /js/app)\n file.gsub!(/\\.[a-f0-9]{32}$/, \"\")\n\n matches = Dir[File.join(expand_from(from), \"#{file}.*\")]\n\n # Fix for filenames with dots (can't do this with glob)\n matches = matches.select { |f| f =~ /#{file}\\.[^.]+$/ }\n\n # Sort static file match, weighting exact file extension matches\n # first, then registered Tilt formats\n matches.sort! do |candidate, _|\n cfmt = File.extname(candidate)[1..-1]\n efmt = extension[1..-1]\n (cfmt == efmt or AssetPack.tilt_formats[cfmt] == efmt) ? -1 : 1\n end\n matches.first\n end", "def get_file(path)\n if not @files[path]\n file_not_found(path)\n end\n \n return Chance.get_file(@files[path])\n end", "def pack_path(name)\n path = WebpackerLite::Configuration.base_path\n file = WebpackerLite::Manifest.lookup(name)\n \"#{path}/#{file}\"\n end", "def relative_path\n @relative_path ||= File.join('_static', @name)\n end", "def resource(gem_name, path)\n if not loaded? gem_name\n raise PluginNotLoaded.new(\"Plugin #{gem_name} not loaded when getting resource #{path}\")\n end\n\n file = File.join(@gems[gem_name], \"resources\", path)\n\n if File.exist? file\n return file\n else\n return nil\n end\n end", "def file\n @file ||= File.basename(link)\n end", "def file_from_sanitized(sanitized_name)\n current_revision = change['current_revision']\n change['revisions'][current_revision]['files'].keys.find { |k| sanitize(k) == sanitized_name }\n end", "def get_internal_file(url)\n return nil if url.match?(/^https?:/)\n\n url = url.sub(/\\?.*/, \"\")\n url = URI.decode(url)\n file = \"#{@site.path}#{url}\"\n file = File.join(file, \"index.html\") if Fs.directory?(file)\n Fs.file?(file) ? file : nil\n end", "def version_file_from( name )\n\t\treturn name.\n\t\t\tsplit( /-/ ).\n\t\t\treject {|word| PACKAGE_IGNORE_WORDS.include?(word) }.\n\t\t\tjoin( '/' )\n\tend", "def image(name)\n File.expand_path(\"tex/#{name}\", File.dirname(__FILE__))\nend", "def get_file(params)\n if params[:name] == 'conference'\n params[:conference][:custom_file]\n else\n params[:static_page][:custom_file]\n end\n end", "def package(name)\n if name.respond_to? :cache_path\n name\n elsif @versions[name]\n Package.for(@sources[name], @versions[name], @files[name])\n end\n end", "def get_asset(url)\n uri = URI.parse(url)\n\n unless File.exists?(File.join(['public', uri.path]))\n FileManager.new(['public', uri.path], Downloader.get(url, URI.decode_www_form(uri.query)), true).write!\n end\n\n replace_url(url, uri.path)\n end", "def contents_by_name(name)\n contents.select { |content| content.name == name.to_s }\n end", "def filename\n get \"filename\"\n end", "def get_file(filename, options={})\n end", "def find_file( dirs, lang, name, exts, hidden = false )\n glob_files( dirs, lang, name, exts, hidden ) { |file,base,ext| return file }\n nil\n end", "def name\n ::File.basename(path)\n end", "def try_static(dir = config[:public_dir])\n\t\t\t\tfile = File.join(dir, URI.decode(request.path_info))\n\t\t\t\treturn nil unless File.exist?(file) && File.file?(file)\n\t\t\t\treturn_static(file)\n\t\t\tend", "def load_template(name)\r\n f = lam_path(name)\r\n if File.exist?(f)\r\n File.open(f).read\r\n else\r\n raise \"Missing template file #{f}\"\r\n end\r\n end", "def get(name)\n path = File.join(@home, name)\n IFolder.new(path)\n end", "def resource_get class_name, resource_name\n\t\t\tpath = \"#{class_to_basefile(class_name)}.#{resource_name}\"\n\t\t\tdata, readed = nil, false\n\t\t\tif File.exist? path\n\t\t\t\tdata = File.read path\n\t\t\t\treaded = true\n\t\t\telse\n\t\t\t\tpath = \"#{class_to_basefile(class_name)}.res/#{resource_name}\"\n\t\t\t\tif File.exist? path\n\t\t\t\t\tdata = File.read path\n\t\t\t\t\treaded = true\n\t\t\t\tend\n\t\t\tend\n\t\t\traise Resource::NotExist unless readed\t\t\t\t\t\n\t\t\treturn data\n\t\tend", "def get_internal_file(url)\n return nil if url.match?(/^https?:/)\n\n url = url.sub(/\\?.*/, \"\")\n url = Addressable::URI.unencode(url)\n file = \"#{@site.path}#{url}\"\n file = File.join(file, \"index.html\") if Fs.directory?(file)\n Fs.file?(file) ? file : nil\n end", "def template_path(name)\n \"https://#{@templates_bucket}.s3.amazonaws.com/#{@templates_version}/#{name}.yaml\"\n end" ]
[ "0.7485978", "0.665862", "0.65115386", "0.64184266", "0.639946", "0.6292126", "0.6229353", "0.61551964", "0.6091743", "0.6045", "0.5980185", "0.5978757", "0.59780645", "0.5977316", "0.5968465", "0.5939294", "0.5924837", "0.5912804", "0.5891153", "0.5890666", "0.58866966", "0.58649576", "0.5847619", "0.58434165", "0.5823036", "0.5822494", "0.5788624", "0.5777775", "0.576602", "0.5764862", "0.57538885", "0.5750564", "0.57423043", "0.57423043", "0.57242537", "0.5705375", "0.56902134", "0.56878513", "0.5685477", "0.56791264", "0.56767815", "0.5666912", "0.5658467", "0.56519854", "0.56519854", "0.5633703", "0.56282574", "0.5626215", "0.56131583", "0.5576835", "0.5576835", "0.5571746", "0.55696285", "0.5564292", "0.5545937", "0.5543755", "0.5537453", "0.55297863", "0.55269134", "0.550791", "0.5492603", "0.54834044", "0.54766744", "0.5474085", "0.54689217", "0.546388", "0.5447538", "0.5445901", "0.5445413", "0.5432602", "0.54281306", "0.5417978", "0.53961515", "0.53775024", "0.5371286", "0.5362265", "0.5359935", "0.53550315", "0.5353365", "0.53499323", "0.53476816", "0.5343612", "0.5341974", "0.5329896", "0.5327566", "0.5320097", "0.5318622", "0.53099144", "0.5304506", "0.53023815", "0.5302365", "0.5299056", "0.5292417", "0.526703", "0.526614", "0.5262372", "0.52611303", "0.52515405", "0.5251023", "0.52501315" ]
0.56507397
45
Public: Create an inmemory Page with the given data and format. This is useful for previewing what content will look like before committing it to the repository. name The String name of the page. format The Symbol format of the page. data The new String contents of the page. Returns the inmemory Gollum::Page.
def preview_page(name, data, format) ::Gollum::PreviewPage.new(self, "#{name}.#{::Gollum::Page.format_to_ext(format.to_sym)}", data, @access.commit(@ref)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preview_page(name, data, format)\n page = @page_class.new(self)\n ext = @page_class.format_to_ext(format.to_sym)\n path = @page_class.cname(name) + '.' + ext\n blob = OpenStruct.new(:name => path, :data => data)\n page.populate(blob, path)\n page.version = @access.commit('HEAD')\n page\n end", "def write_page(name, format, data, commit = {})\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n add_to_index(index, '', name, format, data)\n end\n\n @access.refresh\n update_working_dir(index, '', name, format)\n\n sha1\n end", "def update_page(page, name, format, data, commit = {})\n name = name ? ::File.basename(name) : page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n filename = (rename = page.name != name) ? Gollum::Page.cname(name) : page.filename_stripped\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n if !rename && page.format == format\n committer.add(page.path, normalize(data))\n else\n committer.delete(page.path)\n committer.add_to_index(dir, filename, format, data)\n end\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(dir, page.filename_stripped, page.format)\n index.update_working_dir(dir, filename, format)\n end\n\n multi_commit ? committer : committer.commit\n end", "def update_page(page, name, format, data, commit = {})\n name ||= page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n if page.name == name && page.format == format\n index.add(page.path, normalize(data))\n else\n index.delete(page.path)\n add_to_index(index, dir, name, format, data, :allow_same_ext)\n end\n end\n\n @access.refresh\n update_working_dir(index, dir, page.name, page.format)\n update_working_dir(index, dir, name, format)\n\n sha1\n end", "def update_page(page, name, format, data, commit = {})\n name ||= page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = nil if dir == '.'\n rename = (page.name != name || page.format != format)\n new_path = ::File.join([dir, self.page_file_name(name, format)].compact) if rename\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n if !rename\n committer.add(page.path, normalize(data))\n else\n committer.delete(page.path)\n committer.add_to_index(new_path, data)\n end\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(page.path)\n index.update_working_dir(new_path) if rename\n end\n\n multi_commit ? committer : committer.commit\n end", "def wiki_page(name, path = nil, version = nil, exact = true)\n wiki = wiki_new\n path = name if path.nil?\n name = extract_name(name) || wiki.index_page\n path = extract_path(path)\n path = '/' if exact && path.nil?\n\n OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, exact, version),\n :name => name, :path => path)\n end", "def write_page(path, format, data, commit = {})\n write(merge_path_elements(nil, path, format), data, commit)\n end", "def create_page_content(page_id, data)\n create_content(Voog::API::Contents::ParentKind::Page, page_id, data)\n end", "def load_page page_name\n file = page_file page_name\n\n File.open file, 'rb' do |io|\n obj = Marshal.load io.read\n obj.store = self\n obj\n end\n rescue Errno::ENOENT => e\n error = MissingFileError.new(self, file, page_name)\n error.set_backtrace e.backtrace\n raise error\n end", "def page(name, version = 'master')\n @page_class.new(self).find(name, version)\n end", "def set_page(name, version, content)\n p \"set page: #{name} : #{version.class}\"\n page = wiki.page(name, version)\n if !page.nil?\n path = page_path(name, version)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(content)\n end\n end\n end", "def render_default data, format=:markdown, name='render_default.md'\n # set instance vars so we're able to render data without a wiki or page.\n @format = format\n @name = name\n\n chain = [:Metadata, :PlainText, :TOC, :RemoteCode, :Code, :Sanitize, :WSD, :Tags, :Render]\n\n filter_chain = chain.map do |r|\n Gollum::Filter.const_get(r).new(self)\n end\n\n process_chain data, filter_chain\n end", "def create(p)\n puts \"Creating page #{p}\"\n Dir.mkdir p unless File.exists? p\n Content.new(\"#{@dir}\", @extension).page p\n end", "def new\n #creates a new page only in memory\n @page = Page.new\n end", "def render(data, opts = {})\n opts = { :template_klass => Tilt::StringTemplate }.merge(opts)\n Parched::Page.new(@repo, opts[:template_klass], data).render\n end", "def save_page page\n return unless page.text?\n\n path = page_file page.full_name\n\n FileUtils.mkdir_p File.dirname(path) unless @dry_run\n\n cache[:pages] ||= []\n cache[:pages] << page.full_name\n\n return if @dry_run\n\n File.open path, 'wb' do |io|\n Marshal.dump page, io\n end\n end", "def page=(page)\n @page = page\n @objects = page.objects\n @font_stack = [build_fonts(page.fonts)]\n @xobject_stack = [page.xobjects]\n @content = {}\n @stack = [DEFAULT_GRAPHICS_STATE]\n end", "def page_by_name(name)\n fetch(:page,\"#{name.gsub!(/\\s/, '_')}\")\n end", "def put_new_page(name, page_name, opts = {})\n data, _status_code, _headers = put_new_page_with_http_info(name, page_name, opts)\n return data\n end", "def set_page_by_name\n name = params[:page] || Rails.application.config.MAIN_PAGE\n\n @page = Page.new(name)\n end", "def create_page(title, content, ancestor_id)\n url = host + '/rest/api/content?expand=version,ancestors,space'\n payload = {\n title: title,\n type: 'page',\n space: {key: space},\n ancestors: Array(ancestor_id).map { |ans_id| { id: ans_id } },\n body: {\n storage: {\n value: content,\n representation: 'storage'\n }\n }\n }\n\n req_result = send_request(:post, url, payload, default_headers)\n Model::Page.new req_result[:body] if req_result[:success]\n end", "def page_by_name(name)\n fetch(:page, name)\n end", "def page(page_name, &block)\n method_name = page_name.computerize + '_page'\n send method_name, &block\n end", "def save_page(page, name)\n f = File.new(name,'w')\n f.puts page\n f.close\n end", "def write(data)\n return 0 unless data.is_a?(String)\n\n size = data.bytesize\n return 0 if size == 0\n\n # TBD verify this overflow calc\n raise(PageHandlerError, \"data size=#{data.bytesize} is larger than usable page size=#{@page_usable_size} (#{@page_size} - #{2 * INT_BYTES})\") if size > @page_usable_size\n\n offset = @meta.head_page_offset\n if size > (@page_usable_size - offset)\n # data size is larger than usable data size left, move head to next page\n @meta.head_page_index += 1\n @meta.head_page_offset = offset = 0\n end\n buffer = mmap_buffer(@meta.head_page_index)\n buffer.position = offset\n buffer.put_int(size)\n buffer.put_bytes(data)\n\n # write a trailing 0 after the data. on next push, this will be overwritten with next data size\n # since offset will be set on this trailing zero, otherwise if we changed page, trailing zero\n # will be set.\n buffer.put_int(0)\n @meta.head_page_offset = offset + size + INT_BYTES\n @meta.size += 1\n\n size\n end", "def page(permalink)\n\t\t# check if the file exists, return nil if not\n\t\tfile = dir + '/' + permalink + '.md'\n\t\treturn nil unless File.exists? file # bail out if the file doesn't exist\n\t\t\n\t\t# check if we can read content, return nil if not\n\t\tcontent = File.new(file, :encoding => \"UTF-8\").read\n\t\treturn nil if content.nil?\n\t\t\n\t\t# return a new Page instance\n\t\treturn Page.new(content, permalink, self)\n\tend", "def page(permalink)\n\t\t# check if the file exists, return nil if not\n\t\tfile = dir + '/' + permalink + '.md'\n\t\treturn nil unless File.exists? file # bail out if the file doesn't exist\n\t\t\n\t\t# check if we can read content, return nil if not\n\t\tcontent = File.new(file, :encoding => \"UTF-8\").read\n\t\treturn nil if content.nil?\n\t\t\n\t\t# return a new Page instance\n\t\treturn Page.new(content, permalink, self)\n\tend", "def new_page(insert = false, page = nil, pos = :after)\n reset_state_at_page_finish\n\n if insert\n # The id from the PDF::Writer class is the id of the contents of the\n # page, not the page object itself. Query that object to find the\n # parent.\n _new_page = PDF::Writer::Object::Page.new(self, { :rpage => page, :pos => pos })\n else\n _new_page = PDF::Writer::Object::Page.new(self)\n end\n\n reset_state_at_page_start\n\n # If there has been a stroke or fill color set, transfer them.\n fill_color!\n stroke_color!\n stroke_style!\n\n # the call to the page object set @current_contents to the present page,\n # so this can be returned as the page id\n# @current_contents\n _new_page\n end", "def page(name, path = nil, cmd_params = {}, &block)\n name = name.to_s.intern\n p = Page.new(name, @page)\n builder = DSLBuilder.new(p)\n # Parent params pass to child, but overridden by command-line params (in child only)\n puts \"Parent params: #{self.params.inspect}\" if($debug)\n puts \"CMD params: #{cmd_params.inspect}\" if($debug)\n builder.params.merge!(self.params).merge!(cmd_params)\n puts \"Child params: #{builder.params.inspect}\" if($debug)\n if path = clean_path(path)\n p.path = path\n puts \"Loading page from path=#{path} using builder: #{builder}\" if($debug)\n builder.instance_eval(File.read(path))\n puts \"Child params after loading #{path}: #{builder.params.inspect}\" if($debug)\n end\n builder.instance_eval(&block) if(block_given?)\n puts \"Child params after block: #{builder.params.inspect}\" if($debug)\n\n @page.add_page(p)\n end", "def default_data_for_template(name)\n data = {}\n data[:name] = name\n data[:version] = '0.0.1'\n data[:summary] = \"A short description of #{name}.\"\n data[:homepage] = \"http://EXAMPLE/#{name}\"\n data[:author_name] = `git config --get user.name`.strip\n data[:author_email] = `git config --get user.email`.strip\n data[:source_url] = \"http://EXAMPLE/#{name}.git\"\n data[:ref_type] = ':tag'\n data[:ref] = '0.0.1'\n data\n end", "def default_data_for_template(name)\n data = {}\n data[:name] = name\n data[:version] = '0.0.1'\n data[:summary] = \"A short description of #{name}.\"\n data[:homepage] = \"http://EXAMPLE/#{name}\"\n data[:author_name] = `git config --get user.name`.strip\n data[:author_email] = `git config --get user.email`.strip\n data[:source_url] = \"http://EXAMPLE/#{name}.git\"\n data[:ref_type] = ':tag'\n data[:ref] = '0.0.1'\n data\n end", "def insert_object(name, type = :text, options = {}, html_options = {})\n extend ActionView::Helpers::TagHelper\n extend ActionView::Helpers::TextHelper\n \n @page_objects ||= {}\n \n key = \"obj-#{type.to_s}-#{name.gsub(/[^\\w]/, '_')}\"\n case type.to_sym\n when :string\n content = substitute_placeholders(@page_objects[key] || '', @pg)\n content = erb_render(content)\n content = auto_link(content, :all, :target => '_blank') unless options[:disable_auto_link]\n content_tag :span, content, html_options\n when :text\n content = substitute_placeholders(@page_objects[key] || '', @pg)\n content = erb_render(content)\n content = auto_link(content, :all, :target => '_blank') unless options[:disable_auto_link]\n content_tag :div, content, html_options\n when :page_list\n @rss_feeds ||= []\n @rss_feeds << name\n \n case @page_objects[\"#{key}-style-display-as\"]\n when 'calendar'\n pages = page_list_items(@pg, key, options).compact.uniq.\n sort { |a,b| (a.position || 0) <=> (b.position || 0) }.\n sort { |a,b| (b.article_date || b.published_date || Time.now) <=>\n (a.article_date || a.published_date || Time.now) }\n render :partial => 'page_list_calendar', :locals => { :key => key, :pages => pages }\n else # display as 'list'\n today = Time.mktime(Time.now.year, Time.now.month, Time.now.day)\n case @page_objects[\"#{key}-date-range\"]\n when 'all'\n when 'past'\n options[:end_date] ||= today\n when 'future'\n options[:start_date] ||= today\n when 'custom'\n options[:start_date] ||= @page_objects[\"#{key}-date-range-custom-start\"]\n options[:end_date] ||= @page_objects[\"#{key}-date-range-custom-end\"]\n end\n \n pages = page_list_items(@pg, key, options).compact.uniq\n \n options[:wrapper_div] = true\n \n # make options specified in snippets and templates accessible to\n # page list segments and rss feeds\n @page_objects[\"#{key}-template\"] = options[:template] if @page_objects[\"#{key}-template\"].empty?\n \n render_page_list_segment(name, pages, options, html_options)\n end\n when :snippet\n @snippet = CmsSnippet.find_by_name(name)\n if @snippet\n erb_render(substitute_placeholders(@snippet.content, @pg))\n else\n 'Could not find snippet \"' + name + '\" in the database.'\n end\n when :photo_gallery\n gallery_dir = File.join('images', 'content', @pg.path, File.basename(name))\n Dir.chdir(File.join(RAILS_ROOT, 'public'))\n all_images = Dir.glob(\"#{gallery_dir}/*.{jpg,jpeg,png,gif}\")\n Dir.chdir(RAILS_ROOT)\n all_images.sort! { |a,b| File.basename(a).to_i <=> File.basename(b).to_i }\n images = all_images.reject { |img| img =~ /-thumb/ }\n thumbs = all_images.reject { |img| img !~ /-thumb/ }\n render_to_string :partial => 'photo_gallery', :locals => { :name => name, :images => images, :thumbs => thumbs }\n end\n end", "def instantiate_page_data_object(data_key = self.class.data_class.default_data)\n @fillable_form_fields = form_field_order()\n @current_page_data_object = self.class.data_class.new(data_key)\n end", "def page=(page)\n @page = page\n @cache = page.cache\n @objects = page.objects\n @font_stack = [build_fonts(page.fonts)]\n @xobject_stack = [page.xobjects]\n @cs_stack = [page.color_spaces]\n @stack = [DEFAULT_GRAPHICS_STATE.dup]\n @show_text_callback = lambda{ |string, kerning| }\n state[:ctm] = identity_matrix\n invalidate_cached_values\n end", "def initialize(site, base, index_files, dir, data, name, title, template, extension, defaults = {})\n @site = site\n @base = base\n\n # @dir is the directory where we want to output the page\n # @name is the name of the page to generate\n #\n # the value of these variables changes according to whether we\n # want to generate named folders or not\n if data[name] == nil\n puts \"error (datapage_gen). empty value for field '#{name}' in record #{data}\"\n else\n filename = sanitize_filename(data[name]).to_s\n\n @dir = dir + (index_files ? \"/\" + filename + \"/\" : \"\")\n @name = (index_files ? \"index\" : filename) + \".\" + extension.to_s\n\n self.process(@name)\n self.read_yaml(File.join(base, '_layouts'), template + \".html\")\n\n # original method to set page title to data[name]\n # self.data['title'] = data[name]\n\n if title\n self.data['title'] = data[title]\n elsif data['publiccode'] && data['publiccode']['name']\n self.data['title'] = data['publiccode']['name'] + ' - ' + defaults['title_suffix']\n else\n self.data['title'] = data[name]\n end\n\n self.data.merge!(defaults)\n # add all the information defined in _data for the current record to the\n # current page (so that we can access it with liquid tags)\n self.data.merge!(data)\n end\n end", "def show\r\n @page = Page.find(params[:id])\r\n data = File.read(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n @page.update_attribute(:html , data)\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @page }\r\n end\r\n end", "def create\n url = params['url']\n doc = Crawl::PageHandler.fetch_page(url)\n page_data = Crawl::PageHandler.parse_page(url, doc)\n page = Page.create(url: url,\n chksum: Zlib.crc32(url),\n parsed: page_data.to_json)\n render json: { url: page[:url],\n chksum: page[:chksum],\n parsed: page[:parsed] }\n end", "def create_pages(page)\n skip_count = 0\n page[:content].split( SEP_PAGES ).each_with_index do |content,i|\n if content =~ PTN_METADATA\n page[:title] = $1;page[:tag] = $2\n page[:created_at] = str2time( $3 ) if !$3.blank?\n h = {};$4.split('|').each{|e| pair = e.split('=') ; h[pair[0].to_sym] = pair[1] }\n h[:public_flag] = false if !h[:public_flag] || h[:public_flag] != \"true\"\n h[:page_type] = 'N' if !h[:page_type]\n page.merge!(h)\n #$lgr.info page.inspect\n content.gsub! PTN_METADATA , \"\"\n end\n page[:content] = content\n extract_data Page.create!(page)\n end.length\n end", "def page(wiki, commit)\n blob = self.blob(wiki.repo)\n page = wiki.page_class.new(wiki).populate(blob, self.dir)\n page.version = commit\n page\n end", "def part(name, attrs={})\n remove name\n @parts << PagePart.new(attrs.merge(:name => name))\n end", "def build_for_page page_name\n raise NotImplementedError\n end", "def put_new_page_with_http_info(name, page_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PageApi.put_new_page ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PageApi.put_new_page\"\n end\n # verify the required parameter 'page_name' is set\n if @api_client.config.client_side_validation && page_name.nil?\n fail ArgumentError, \"Missing the required parameter 'page_name' when calling PageApi.put_new_page\"\n end\n # resource path\n local_var_path = \"/diagram/{name}/pages/addNew\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'pageName'] = page_name\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].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 = ['JWT']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ModifyResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PageApi#put_new_page\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def page(name, options = {})\n options[:layout] = true unless options.has_key?(:layout)\n view(name, options)\n end", "def create\n #Each Page could be tied to an ApiKey or set of ApiKeys for security\n @page = Page.new(page_params)\n #Render the object created or errors\n respond_to do |format|\n if @page.save\n #Cache bust pages\n Rails.cache.delete(\"pages\")\n format.json { render action: 'show', status: :created, location: api_page_url(@page) }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def page\n\t\t@visited_pages = []\n\t\tlogger.debug \"retreiving page for #{name}\"\n\t\tfind_page(name, false)\n\tend", "def new\n @page = Page.find_by_title('Huren bij Xposers')\n end", "def get_page(name, version='master')\n IO.read(page_path(name, version)) if cache_hit?(name, version)\n end", "def page=( page )\n init_db_from_page( page )\n @page = page.deep_clone\n end", "def create_page 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_create_page_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Dialogflow::CX::V3::Page.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def store(object, message = object.inspect)\n diary = open pathf % extract_values(object), 'w'\n diary.pages.create object, message\n end", "def render(no_follow = false)\n sanitize = no_follow ?\n @wiki.history_sanitizer :\n @wiki.sanitizer\n\n data = extract_tex(@data.dup)\n data = extract_code(data)\n data = extract_tags(data)\n begin\n data = GitHub::Markup.render(@name, data)\n if data.nil?\n raise \"There was an error converting #{@name} to HTML.\"\n end\n rescue Object => e\n data = %{<p class=\"gollum-error\">#{e.message}</p>}\n end\n data = process_tags(data)\n data = process_code(data)\n if sanitize || block_given?\n doc = Nokogiri::HTML::DocumentFragment.parse(data)\n doc = sanitize.clean_node!(doc) if sanitize\n yield doc if block_given?\n data = doc_to_html(doc)\n end\n data = process_tex(data)\n data.gsub!(/<p><\\/p>/, '')\n data\n end", "def stub(page, name)\n Domain.new(page: page, page_id: page.id, name: name)\n end", "def page(name, attributes = {}, &block)\n page = Elements::Page.new(name, nil, @resolver, attributes, &block)\n pages << page if page.visible?\n end", "def save_page(title, attr)\n title = normalize_title(title)\n \n page = find_page(title)\n page.set(attr)\n \n transaction \"update `#{page.title}'\" do\n store[page.title + '.md'] = page\n end\n end", "def page_file_name(name, format)\n format.nil? ? name : \"#{name}.#{::Gollum::Page.format_to_ext(format)}\"\n end", "def create\n\t\t@page = Page.new(params[:page])\n\n\t\trespond_to do |format|\n\t\t\tif @page.save\n\t\t\t\tformat.html { redirect_to @page, notice: 'Boom, page created.' }\n\t\t\t\tformat.json { render json: @page, status: :created, location: @page }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"Create new page\"}\n\t\t\t\tformat.json { render json: @page.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create_from_data(location, data, options = {:tidy => true})\n # check tidy option\n if (((options[:tidy] == true) and (Tidy_enable == true)) and \n ((File.extname(location) == '.htm') or (File.extname(location) == '.html') or (File.extname(location) == '.xhtml'))) \n \n # apply tidy on data\n data_to_write = Tidy.open(:show_warnings => false) do |tidy|\n tidy.options.output_xhtml = true\n tidy.options.tidy_mark = false\n xhtml = tidy.clean(data)\n xhtml\n end\n else\n data_to_write = data\n end\n \n # write data\n super(location, data_to_write, options)\n end", "def post page_name\n redirect(\"/login?return_to=#{CGI::escape(@env['REQUEST_URI'])}\") and return unless logged_in?\n page_name_spc = page_name.gsub(/_/,' ')\n if input.submit = 'save'\n attrs = { :body => input.post_body, :title => input.post_title, :user_id =>@state.user.id }\n attrs[:readonly] = input.post_readonly if is_admin?\n @page = Page.find_by_title(page_name_spc)\n if @page.nil?\n # new page\n @page = Page.create(attrs)\n else\n @page.update_attributes(attrs)\n end\n redirect Show, input.post_title.gsub(/ /,'_')\n elsif input.submit == 'minor edit'\n attrs = { :body => input.post_body }\n attrs[:readonly] = input.post_readonly if is_admin?\n page = Page.find_by_title(page_name_spc)\n current_version = page.find_version(page.version)\n current_version.update_attributes(attrs)\n page.without_revision { page.update_attributes(attrs) }\n redirect Show, input.post_title.gsub(/ /,'_')\n else # cancel\n redirect Show, page_name\n end\n end", "def create\n @page = Page.new(params[:page])\n \n if @page.save\n respond_to do |format|\n format.json { render :json => @page, :status => :created }\n format.xml { render :xml => @page, :status => :created }\n end\n else\n respond_to do |format|\n format.json { raise Palani::Api::InvalidRecordJSONException }\n format.xml { raise Palani::Api::InvalidRecordXMLException }\n end\n end\n end", "def update_page(name=nil)\n logger.debug \"DB ********** calling item_category#update_page ********** \"\n logger.debug \"DB ********** passed in name: #{name.to_s} ********** \"\n name ||= self.item.name #(force_reload = true) # force reload ensures item is pulled from DB instead of memory\n logger.debug \"DB ********** name after lookup: #{name.to_s} ********** \"\n page = self.page ? self.page : self.build_page\n unless name.blank?\n page.title = name\n page.menu_name = name\n page.set_safe_shortcut(name)\n end\n page.displayed = item.display\n page.parent = category.page\n end", "def create\n @structure_page = Structure::Page.new(params[:structure_page])\n\n respond_to do |format|\n if @structure_page.save\n format.html { redirect_to @structure_page, notice: 'Page was successfully created.' }\n format.json { render json: @structure_page, status: :created, location: @structure_page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @structure_page.errors, status: :unprocessable_entity }\n end\n end\n end", "def load_page_from_raw\n @current_page.data_size = @page_raw[0]\n @current_page.next_page = @page_raw[1]\n @current_page.max = @page_raw[2]\n @current_page.min = @page_raw[3]\n @current_page.id = @page_raw[4]\n @current_page.bytes_to_items @page_raw[6..-1]\n end", "def generate_dataset_page(p, d)\n data = {\n unmiga_name: d.name.unmiga_name,\n information: format_metadata(d),\n results: format_results(d)\n }\n write_file(p, \"d_#{d.name}.html\") do\n build_from_template('dataset.html', data)\n end\n end", "def initialize(page)\n if page\n @wiki = page.wiki\n @name = page.filename\n @data = page.text_data\n @version = page.version.id if page.version\n @format = page.format\n @sub_page = page.sub_page\n @parent_page = page.parent_page\n @page = page\n @dir = ::File.dirname(page.path)\n end\n @metadata = nil\n @to_xml_opts = { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML ^ 1, :indent => 0, :encoding => 'UTF-8' }\n end", "def edit_wiki_page(proj_name, page_name)\n # fetch current page contents\n page = wiki_page_client(proj_name, page_name)\n begin\n page_data = JSON.parse(page.get)\n current_src = page_data['text']\n rescue RestClient::ResourceNotFound\n page_data = {}\n current_src = ''\n end\n\n new_src = yield(current_src)\n\n changed = !(new_src.nil? || new_src == current_src)\n\n if changed\n new_data = {\n 'page' => {\n 'text' => new_src,\n 'description' => 'edited with kenai-client',\n 'number' => page_data['number']\n }\n }\n page.put(JSON.dump(new_data), :content_type => 'application/json')\n end\n\n return changed\n end", "def new\n @page = Page.new\n end", "def new\n @page = Page.new\n end", "def new\n @page = Page.new\n end", "def new\n @page = Page.new\n end", "def page(page_number)\n data = page_data(page_number)\n Innodb::Page.parse(self, data, page_number) if data\n end", "def create\n begin\n ActiveRecord::Base.transaction do\n @page = Page.new(\n page_slug: params[\"page\"][\"page_slug\"],\n title: params[\"page\"][\"title\"],\n tag_list: params[\"page\"][\"tags\"]\n )\n @page.save!\n @version = Version.new(body: params[\"page\"][\"body\"], page: @page)\n @version.save!\n end\n respond_to do |format|\n format.html { redirect_to action: \"show\", slug: page_params[:page_slug] , notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n end\n rescue => @err\n respond_to do |format|\n @page.body = params[\"page\"][\"body\"]\n format.html { render :new }\n format.json { render json: @err, status: :unprocessable_entity }\n end\n end\n end", "def createPages(interface,data)\r\n page = interface.interface_name.first\r\n \r\n headerContent = \"#{@@headerFile1}\\n<title>#{page}</title>\\n<link rel='stylesheet' type='text/css' href='/stylesheets/swui.css' />\\n#{@@javascriptsFile}\\n\"\r\n \r\n footerContent = @@footerFile\r\n \r\n # References in a hash variable\r\n @references = Hash.new\r\n buffer = interface.interface_ref.first\r\n unless buffer.nil?\r\n buffer = buffer.split(\";\")\r\n buffer.each do |value| \r\n value=value.split(\"=\") \r\n @references[value[0]] = value[1]\r\n end\r\n end\r\n \r\n @bodyContent = \"\"\r\n # ajaxcontrolIds variable holds an array with the page ajaxcontrol ids \r\n @ajaxcontrolIds = Array.new\r\n @effectIds = Array.new\r\n @concreteInterfaceIds = Array.new\r\n @eventData = \"// Retrieves the events specification embedded in the page code \\n function readEvents(interfaceName) { \\n\"\r\n @animData = \"// Retrieves the decorations specification embedded in the page code \\n function readDecorations(interfaceName) { \\n\"\r\n @transData = \"// Retrieves the transitions specification embedded in the page code \\n function readTransitions(interfaceName) { \\n\"\r\n success = printInterface(page,interface.concrete_code.first, interface.ajaxcontrols.first, interface.concrete_interfaces.first, interface.effects.first, data)\r\n @eventData << \" return '' \\n}\\n\"\r\n @animData << \" return '' \\n}\\n\"\r\n @transData << \" return '' \\n}\\n\"\r\n @bodyContent << \"\\n\"\r\n @bodyContent << \"<script type='text/javascript'> \\n\"\r\n @bodyContent << printAjaxcontrolJS\r\n @bodyContent << printEffectJS\r\n @bodyContent << \"// Call updateInterface function \\n\"\r\n @bodyContent << \"function callUpdateInterfaces() { \\n\"\r\n if (success)\r\n @bodyContent << \"updateInterfaces('#{page}');\\n\" \r\n end\r\n @bodyContent << \"}\\n\"\r\n if (success)\r\n @bodyContent << \"// Retrieves the JSON Context or Index data embedded in the page code \\n\"\r\n @bodyContent << \"function readJSONData(interfaceName) { \\n\"\r\n @bodyContent << \"if (interfaceName == '#{page}') { \\n\"\r\n @bodyContent << \"return #{data.inspect} \\n\" \r\n @bodyContent << \"} \\n\"\r\n @bodyContent << \"return '' \\n\"\r\n @bodyContent << \"}\\n\"\r\n @bodyContent << @eventData\r\n @bodyContent << @animData\r\n @bodyContent << @transData\r\n end\r\n @bodyContent << \"</script>\"\r\n headerContent << printEffectDep\r\n headerContent << printAjaxControlDep\r\n headerContent << printCSS \r\n headerContent << @@headerFile2\r\n @output = \"#{headerContent}\\n#{@bodyContent}\\n#{footerContent}\"\r\n \r\n end", "def insert(location, data)\n pages_to_add = nil\n if data.is_a? PDF\n @version = [@version, data.version].max\n pages_to_add = data.pages\n actual_value(@names ||= {}.dup).update data.names, &HASH_MERGE_NEW_NO_PAGE\n merge_outlines((@outlines ||= {}.dup), actual_value(data.outlines), location) unless actual_value(data.outlines).empty?\n if actual_value(@forms_data)\n actual_value(@forms_data).update actual_value(data.forms_data), &HASH_MERGE_NEW_NO_PAGE if data.forms_data\n else\n @forms_data = data.forms_data\n end\n warn 'Form data might be lost when combining PDF forms (possible conflicts).' unless data.forms_data.nil? || data.forms_data.empty?\n elsif data.is_a?(Array) && (data.select { |o| !(o.is_a?(Hash) && o[:Type] == :Page) }).empty?\n pages_to_add = data\n elsif data.is_a?(Hash) && data[:Type] == :Page\n pages_to_add = [data]\n else\n warn \"Shouldn't add objects to the file unless they are PDF objects or PDF pages (an Array or a single PDF page).\"\n return false # return false, which will also stop any chaining.\n end\n # pages_to_add.map! {|page| page.copy }\n catalog = rebuild_catalog\n pages_array = catalog[:Pages][:referenced_object][:Kids]\n page_count = pages_array.length\n if location < 0 && (page_count + location < 0)\n location = 0\n elsif location > 0 && (location > page_count)\n location = page_count\n end\n pages_array.insert location, pages_to_add\n pages_array.flatten!\n self\n end", "def page_file_name(name, format)\n ext = @page_class.format_to_ext(format)\n @page_class.cname(name) + '.' + ext\n end", "def new\n\t\t@page = Page.new\n\n\t\trespond_to do |format|\n\t\t\tif @page.save\n\t\t\t\tformat.html { redirect_to @page, notice: 'Boom, page created.' }\n\t\t\t\tformat.json { render json: @page, status: :created, location: @page }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"Create new page\"}\n\t\t\t\tformat.json { render json: @page.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def to_page\n \n u = User.find_by_login(authorid)\n \n UserActionObserver.current_user = u\n \n page = Page.new(\n :title => title,\n :created_at => lastmod,\n :updated_at => lastmod,\n :slug => url_title,\n :status => Status[:published],\n :breadcrumb => title,\n :published_at => posted, \n :enable_comments => annotate.to_s,\n :keywords => keywords,\n :created_by => u,\n :updated_by => u\n )\n \n page.parts << PagePart.new(:name => 'body', :filter_id => \"Textile\", :content => body )\n page.parts << PagePart.new(:name => 'intro', :filter_id => \"Textile\", :content => body.split(/\\r\\n\\s*\\r\\n/).first)\n \n page\n end", "def put_add_new_page(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_add_new_page_with_http_info(name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = put_add_new_page_with_http_info(name, opts)\n else\n raise\n end\n return data\n end", "def display_page name\n store_name, page_name = name.split ':', 2\n\n store = @stores.find { |s| s.source == store_name }\n\n return display_page_list store if page_name.empty?\n\n pages = store.cache[:pages]\n\n unless pages.include? page_name then\n found_names = pages.select do |n|\n n =~ /#{Regexp.escape page_name}\\.[^.]+$/\n end\n\n if found_names.length.zero? then\n return display_page_list store, pages\n elsif found_names.length > 1 then\n return display_page_list store, found_names, page_name\n end\n\n page_name = found_names.first\n end\n\n page = store.load_page page_name\n\n display page.comment\n end", "def read_yaml(base, name)\n begin\n text = File.read(File.join(base, name))\n data = {'layout'=>'default'}\n\n if page_yaml = transfiguration['page_yaml']\n data.merge!(page_yaml)\n end\n\n # commented metadata\n if text =~ /<!--\\s+---\\s*(.*?)-->\\s*$\\n?/m\n text.delete($0)\n data.merge!(YAML.safe_load($1))\n end\n\n self.content = text\n self.data = data\n rescue SyntaxError => e\n puts \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n puts \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n unless self.data['layout']\n self.data['layout'] = 'page'\n end\n\n return self.data\n end", "def create(page, version)\n @page = Page.new(page)\n @page.versions << @version = Version.new(version.merge!(:remote_ip => request.remote_ip, :user => @user))\n if @page.valid? && @version.valid?\n response = check_comment_with_spam_engine(@page.url, @version.content_html)\n if response[:spam]\n Version.create_spam(@page.name,\n :content => @version.content,\n :spaminess => response[:spaminess],\n :signature => response[:signature],\n :remote_ip => @version.remote_ip\n )\n else\n @version.signature = response[:signature]\n @version.spaminess = response[:spaminess]\n @page.save\n end\n redirect url(:pages)\n else\n render :new\n end\n end", "def AddPage(orientation='')\n\t\t#Start a new page\n\t\tif (@state==0)\n\t\t\tOpen();\n\t\tend\n\t\tfamily=@font_family;\n\t\tstyle=@font_style + (@underline ? 'U' : '') + (@deleted ? 'D' : '');\n\t\tsize=@font_size_pt;\n\t\tlw=@line_width;\n\t\tdc=@draw_color;\n\t\tfc=@fill_color;\n\t\ttc=@text_color;\n\t\tcf=@color_flag;\n\t\tif (@page>0)\n\t\t\t#Page footer\n\t\t\t@in_footer=true;\n\t\t\tFooter();\n\t\t\t@in_footer=false;\n\t\t\t#Close page\n\t\t\tendpage();\n\t\tend\n\t\t#Start new page\n\t\tbeginpage(orientation);\n\t\t#Set line cap style to square\n\t\tout('2 J');\n\t\t#Set line width\n\t\t@line_width = lw;\n\t\tout(sprintf('%.2f w', lw*@k));\n\t\t#Set font\n\t\tif (family)\n\t\t\tSetFont(family, style, size);\n\t\tend\n\t\t#Set colors\n\t\t@draw_color = dc;\n\t\tif (dc!='0 G')\n\t\t\tout(dc);\n\t\tend\n\t\t@fill_color = fc;\n\t\tif (fc!='0 g')\n\t\t\tout(fc);\n\t\tend\n\t\t@text_color = tc;\n\t\t@color_flag = cf;\n\t\t#Page header\n\t\tHeader();\n\t\t#Restore line width\n\t\tif (@line_width != lw)\n\t\t\t@line_width = lw;\n\t\t\tout(sprintf('%.2f w', lw*@k));\n\t\tend\n\t\t#Restore font\n\t\tif (family)\n\t\t\tSetFont(family, style, size);\n\t\tend\n\t\t#Restore colors\n\t\tif (@draw_color != dc)\n\t\t\t@draw_color = dc;\n\t\t\tout(dc);\n\t\tend\n\t\tif (@fill_color != fc)\n\t\t\t@fill_color = fc;\n\t\t\tout(fc);\n\t\tend\n\t\t@text_color = tc;\n\t\t@color_flag = cf;\n\tend", "def create\r\n html=params[:page][:html]\r\n @page = Page.new(params[:page])\r\n respond_to do |format|\r\n if @page.save\r\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\r\n format.json { render json: @page, status: :created, location: @page }\r\n target = \"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\"\r\n if !File.directory?(\"#{Rails.public_path}/#{@page.project_id}\")\r\n Dir.mkdir(\"#{Rails.public_path}/#{@page.project_id}\")\r\n Dir.mkdir(\"#{Rails.public_path}/#{@page.project_id}/images\")\r\n end\r\n File.open(target, \"w+\") do |f|\r\n f.write(html)\r\n end\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @page.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create_for_page\n id = params[\"page_id\"]\n owner = Page.find(id)\n attributes = attribute_parameters\n attributes[:page] = owner\n hobo_create_for :page, :attributes => attributes\n end", "def show(name)\n\t\tif !@wiki.valid?\n\t\t\tstatus 500\n\t\t\t@name = \"Wiki directory not found\"\n\t\t\t@error = \"We couldn't find the wiki directory your configuration is pointing to.<br/>Fix that, then come back - we'll be happier then.\"\n\t\t\terb :error500\n\t\telse\n\t\t\tif @page = @wiki.page(name)\n\t\t\t\t# may success come to those who enter here.\n\t\t\t\t@name = @page.name\n\t\t\t\t@content = @page.content\n\t\t\t\terb :show\n\t\t\telse\n\t\t\t\tstatus 404\n\t\t\t\t@newpage = name\n\t\t\t\t@name = \"404: Page not found\"\n\t\t\t\terb :error404\n\t\t\tend\n\t\tend\n\tend", "def new\n @page = Page.new\n\n respond_to do |format|\n format.json { render json: @page }\n format.xml { render xml: @page }\n end\n end", "def new\n\t\t@page = Page.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @page }\n\t\tend\n\tend", "def create\n\t\t@page = Page.new(params[:page])\n\t\trespond_to do |format|\n\t\t\tif @page.save\n\t\t\t\tflash[:notice] = 'Page was successfully created.'\n\t\t\t\tformat.html { redirect_to(@page) }\n\t\t\t\tformat.xml\t{ render :xml => @page, :status => :created, :location => @page }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml\t{ render :xml => @page.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def generate_snapshot_data(name, description = nil)\n { description: description, name: name }\n end", "def save(filename, content)\n\t\t# FIXME - if the file exists, this should bail out\n\t\t\n\t\t# write the contents into the file\n\t\tfile = dir + '/' + filename + '.md'\n\t\tf = File.new(file, \"w\")\n\t\tf.write(content)\n\t\tf.close\n\t\t\n\t\t# return the new file\n\t\treturn page(filename)\n\tend", "def save(filename, content)\n\t\t# FIXME - if the file exists, this should bail out\n\t\t\n\t\t# write the contents into the file\n\t\tfile = dir + '/' + filename + '.md'\n\t\tf = File.new(file, \"w\")\n\t\tf.write(content)\n\t\tf.close\n\t\t\n\t\t# return the new file\n\t\treturn page(filename)\n\tend", "def [](name, default_class=Page)\n default_class = ::Hyde.const_get(default_class) if default_class.is_a? Symbol\n Hyde::Page[name, self, default_class]\n end", "def new\n @wiki_page = MiniWikiPage.new\n if params[:name]\n @wiki_page.name = params[:name]\n end\n \n @wiki_revision = MiniWikiRevision.new\n unless @username.blank?\n @wiki_revision.author = @username\n end\n \n render :template => 'new'\n end", "def create\n unless params[:page][:type].nil?\n object = Object.const_get(params[:page][:type])\n @page = object.new(params[:page]) \n else\n @page = Page.new(params[:page])\n end\n\n @page.layout_template.positions.each{|p|\n @page.blocks << Block.new(:page_id => @page.id, :position_id => p.id)\n }\n \n @page.slug = Page.escape_permalink(@page.name,\"-\")\n existing_pages = Page.find(:first, :conditions => [\"slug = ?\", @page.slug])\n if @page.parent.nil? || @page.parent.children.size == 0\n @page.order = 1\n else\n @page.order = @page.parent.children.size + 1\n end\n\n respond_to do |format|\n if existing_pages.nil? and @page.save\n flash[:notice] = t('message.page.created')\n if @page.type == \"Blog\"\n format.html { redirect_to :controller => 'blogs', :action => 'show', :user => User.find(@page.user_id).login, :language => session[:language].short_name and return}\n else\n format.html { redirect_to(@page) }\n end\n format.xml { render :xml => @page, :status => :created, :location => @page }\n else\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n# format.html { render :xml => @page.errors, :status => :unprocessable_entity }\n format.html { render :action => \"new\" }\n end\n end\n end", "def page\n html = String.new\n html << (model.page_header_for(type, request) || tabs)\n html << \"<div id='autoforme_content' data-url='#{url_for('')}'>\"\n html << yield.to_s\n html << \"</div>\"\n html << model.page_footer_for(type, request).to_s\n html\n end", "def initialize( name )\n @name = name\n get_page_content\n get_total\n end", "def new_for_page\n id = params[\"page_id\"]\n owner = Page.find(id)\n new_text_element = owner.text_elements.new\n new_text_element.page = owner\n hobo_new_for :page, new_text_element\n end", "def create\n flash[:notice] = 'The page was successfully created.' if page.save\n respond_with(page, location: project_page_path(page.project, page))\n end", "def new_page(mediabox = [0, 0, 612.0, 792.0], _location = -1)\n p = PDFWriter.new(mediabox)\n insert(-1, p)\n p\n end", "def create(name,content='')\n @name=name\n @content=content\n end", "def create(name,content='')\n @name=name\n @content=content\n end" ]
[ "0.7734778", "0.6498444", "0.60033786", "0.58993345", "0.587632", "0.5600008", "0.55831236", "0.5442831", "0.5397244", "0.5347892", "0.5341293", "0.532073", "0.5261203", "0.5188034", "0.5129272", "0.50140464", "0.50136095", "0.4997512", "0.49733093", "0.4944775", "0.48992378", "0.48808044", "0.4876808", "0.48538345", "0.48538", "0.48346788", "0.48346788", "0.48266953", "0.48172316", "0.4811782", "0.4811782", "0.47939768", "0.47847176", "0.47792748", "0.47722164", "0.47603717", "0.47541186", "0.47535333", "0.4750551", "0.47439843", "0.47383726", "0.47373188", "0.4731134", "0.46896613", "0.46768332", "0.46695605", "0.46496183", "0.46488503", "0.46368277", "0.4630275", "0.4617687", "0.4616021", "0.46072698", "0.46044013", "0.4602506", "0.45903066", "0.4587905", "0.45844823", "0.45765784", "0.45751217", "0.45690313", "0.456733", "0.4562263", "0.45569032", "0.4548947", "0.45443407", "0.45434064", "0.45434064", "0.45434064", "0.45411962", "0.45388523", "0.45382714", "0.45283026", "0.4516477", "0.4506957", "0.4505308", "0.44995204", "0.44831502", "0.4481585", "0.44741452", "0.44671187", "0.44443163", "0.4444036", "0.44435373", "0.44411948", "0.4437815", "0.44364908", "0.44345966", "0.44328964", "0.44328964", "0.44319236", "0.44296217", "0.44240585", "0.44211552", "0.44098434", "0.44091707", "0.4408234", "0.4404685", "0.44046572", "0.44046572" ]
0.7227259
1
Public: Write a new version of a page to the Gollum repo root. path The String path where the page will be written. format The Symbol format of the page. data The new String contents of the page. commit The commit Hash details: :message The String commit message. :name The String author full name. :email The String email address. :parent Optional Gollum::Git::Commit parent to this update. :tree Optional String SHA of the tree to create the index from. :committer Optional Gollum::Committer instance. If provided, assume that this operation is part of batch of updates and the commit happens later. Returns the String SHA1 of the newly written version, or the Gollum::Committer instance if this is part of a batch update.
def write_page(path, format, data, commit = {}) write(merge_path_elements(nil, path, format), data, commit) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_page(page, name, format, data, commit = {})\n name = name ? ::File.basename(name) : page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n filename = (rename = page.name != name) ? Gollum::Page.cname(name) : page.filename_stripped\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n if !rename && page.format == format\n committer.add(page.path, normalize(data))\n else\n committer.delete(page.path)\n committer.add_to_index(dir, filename, format, data)\n end\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(dir, page.filename_stripped, page.format)\n index.update_working_dir(dir, filename, format)\n end\n\n multi_commit ? committer : committer.commit\n end", "def update_page(page, name, format, data, commit = {})\n name ||= page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = nil if dir == '.'\n rename = (page.name != name || page.format != format)\n new_path = ::File.join([dir, self.page_file_name(name, format)].compact) if rename\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n if !rename\n committer.add(page.path, normalize(data))\n else\n committer.delete(page.path)\n committer.add_to_index(new_path, data)\n end\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(page.path)\n index.update_working_dir(new_path) if rename\n end\n\n multi_commit ? committer : committer.commit\n end", "def write_page(name, format, data, commit = {})\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n add_to_index(index, '', name, format, data)\n end\n\n @access.refresh\n update_working_dir(index, '', name, format)\n\n sha1\n end", "def update_page(page, name, format, data, commit = {})\n name ||= page.name\n format ||= page.format\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n if page.name == name && page.format == format\n index.add(page.path, normalize(data))\n else\n index.delete(page.path)\n add_to_index(index, dir, name, format, data, :allow_same_ext)\n end\n end\n\n @access.refresh\n update_working_dir(index, dir, page.name, page.format)\n update_working_dir(index, dir, name, format)\n\n sha1\n end", "def set_page(path, text, commit_id, email = 'unknown', sline =nil, eline = nil)\n\n cur_head = @repo.commits(@branch, 1).first\n cur_tree = @repo.tree @branch\n\n status = SETPAGE_OK\n\n if commit_id != ''\n # not new file\n\n text_blob = @repo.blob commit_id\n raise \"no path #{path}\" if ! text_blob.is_a? Grit::Blob\n cur_blob = cur_tree / path\n text_blob_data = text_blob.data.force_encoding('utf-8')\n\n if ! sline.nil? && ! eline.nil?\n text = _patch_part(text, text_blob_data, sline, eline)\n end\n\n if cur_blob.id != text_blob.id\n # collision: try append diff\n status = SETPAGE_MERGE_OK\n lmine = 'me'\n lorig = 'original'\n lyour = 'your-concurent-editor'\n newtext, diff3_status = Diff3.diff3(lmine, text,\n lorig, text_blob_data,\n lyour, cur_blob.data.force_encoding('utf-8'))\n\n case diff3_status\n when Diff3::MERGE_COLLISONS\n status = SETPAGE_MERGE_COLLISONS\n\n when Diff3::MERGE_FAIL\n # total fall back (never happens)\n status = SETPAGE_MERGE_DIFF\n diff = Grit::Commit.diff(@repo, text_blob.id, cur_blob.id).map {|d| d.diff}.join\n newtext = text + \"\\n= Collision =\\n{{{\\n#{diff}\\n}}}\\n\"\n end\n text = newtext\n end\n end\n\n index = Grit::Index.new(@repo)\n index.read_tree(cur_tree.id)\n index.add(path, text)\n\n if path =~ /\\.(wiki|txt)$/\n fstline = text.each_line.first.chomp.strip\n comment = \"file: #{path} head: #{fstline}\"\n else\n comment = \"file: #{path}\"\n end\n\n\n comment = comment.force_encoding('ASCII-8BIT')\n\n actor = Grit::Actor.from_string(email)\n\n id = index.commit(comment, parents: [cur_head], actor: actor, last_tree: cur_head, head: @branch)\n return status\n end", "def write(content, message, author = nil)\n if !content.respond_to? :read\n content.gsub!(\"\\r\\n\", \"\\n\")\n\treturn if @object && @object.data == content\n end\n\n Wiki.check do |errors|\n errors << :already_exists.t(:path => @path) if new? && Resource.find(@repository, @path)\n errors << :empty_commit_message.t if message.blank?\n end\n\n repository.transaction(message, author && author.to_git_user) do\n content = content.read if content.respond_to? :read # FIXME\n repository.root[@path] = Gitrb::Blob.new(:data => content)\n end\n\n reload\n @commit = repository.log(1, nil).first\n @object = @commit.tree[@path] || raise(NotFound, path)\n @current = true\n end", "def commit_with_content(page, content, log = nil)\n escaped_page = escape(page)\n wiki = File.read(File.join(@data_path, \"text\", \".wiki\"))\n dir = File.join(@root, wiki, escaped_page).untaint\n revision = last_revision(page) + 1\n page_path = File.join(@data_path, \"text\", escaped_page).untaint\n FileUtils.mkdir_p(dir)\n FileUtils.rm_f(File.join(dir, \".removed\"))\n\n File.open(page_path, \"w+\") do |file|\n file.write(content)\n end\n FileUtils.cp(page_path, File.join(dir, revision.to_s))\n end", "def commit(message = '', author = User.from_config, committer = author)\n root.write\n\n commit = Commit.new(self)\n commit.tree = root\n commit.parent << head.id if head\n commit.author = author\n commit.committer = committer\n commit.message = message\n commit.write\n\n open(head_path, \"wb\") do |file|\n file.write(commit.id)\n end\n\n @head = commit\n end", "def commit(message = '', author = nil, committer = nil)\n return if !root.modified?\n\n author ||= default_user\n committer ||= author\n root.save\n\n commit = Commit.new(:repository => self,\n :tree => root,\n :parents => head,\n :author => author,\n :committer => committer,\n :message => message)\n commit.save\n\n write_head_id(commit.id)\n load\n\n commit\n end", "def update(content, message=nil)\n # normalise content\n content = Page.normalise_body(content)\n \n # create subdirectory if needed\n dirname = File.dirname(@filename)\n FileUtils.mkdir_p(dirname) unless File.exist?(dirname)\n \n # Write changes to file\n File.open(@filename, 'w') { |f| f << content }\n \n # Create commit message\n commit_message = tracked? ? \"edited #{@basename.wikify}\" : \"created #{@basename.wikify}\"\n commit_message += ' : ' + message unless message.blank?\n \n # Commit changes\n begin\n $repo.add(@name)\n $repo.commit(commit_message)\n rescue\n nil\n end\n end", "def preview_page(name, data, format)\n page = @page_class.new(self)\n ext = @page_class.format_to_ext(format.to_sym)\n path = @page_class.cname(name) + '.' + ext\n blob = OpenStruct.new(:name => path, :data => data)\n page.populate(blob, path)\n page.version = @access.commit('HEAD')\n page\n end", "def write_commit_info(tree, parents, message)\n contents = []\n contents << ['tree', tree].join(' ')\n parents.each do |p|\n contents << ['parent', p].join(' ') if p \n end\n\n name = config_get('user.name')\n email = config_get('user.email')\n author_string = \"#{name} <#{email}> #{Time.now.to_i} #{formatted_offset}\"\n contents << ['author', author_string].join(' ')\n contents << ['committer', author_string].join(' ')\n contents << ''\n contents << message\n \n get_raw_repo.put_raw_object(contents.join(\"\\n\"), 'commit') \n end", "def commit!(message, options={})\n now = Time.now\n \n sha = options.delete(:tree) || tree.write_to(self).at(1)\n parents = options.delete(:parents) || (head ? [head] : [])\n author = options[:author] || self.author\n authored_date = options[:authored_date] || now\n committer = options[:committer] || author\n committed_date = options[:committed_date] || now\n\n # commit format:\n #---------------------------------------------------\n # tree sha\n # parent sha\n # author name <email> time_as_int zone_offset\n # committer name <email> time_as_int zone_offset\n # \n # messsage\n # \n #---------------------------------------------------\n # Note there is a trailing newline after the message.\n #\n lines = []\n lines << \"tree #{sha}\"\n parents.each do |parent|\n lines << \"parent #{parent}\"\n end\n lines << \"author #{author.name} <#{author.email}> #{authored_date.strftime(\"%s %z\")}\"\n lines << \"committer #{committer.name} <#{committer.email}> #{committed_date.strftime(\"%s %z\")}\"\n lines << \"\"\n lines << message\n lines << \"\"\n \n @head = set('commit', lines.join(\"\\n\"))\n grit.update_ref(branch, head)\n \n head\n end", "def set_page(name, version, content)\n p \"set page: #{name} : #{version.class}\"\n page = wiki.page(name, version)\n if !page.nil?\n path = page_path(name, version)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(content)\n end\n end\n end", "def save message\n raise NothingToCommitError if nothing_to_commit?\n @git.index.add_all\n @git.index.write\n usr = {name: @git.config['user.name'],\n email: @git.config['user.email'],\n time: Time.now}\n opt = {}\n opt[:tree] = @git.index.write_tree\n opt[:author] = usr\n opt[:committer] = usr\n opt[:message] = message\n opt[:parents] = unless @git.empty?\n begin\n [@git.head.target].compact\n rescue Rugged::ReferenceError\n []\n end\n else [] end\n opt[:update_ref] = 'HEAD'\n Rugged::Commit.create(@git, opt)\n end", "def []=(path, entry)\n raise ArgumentError unless entry && (Reference === entry || GitObject === entry)\n path = normalize_path(path)\n if path.empty?\n raise 'Empty path'\n elsif path.size == 1\n raise 'No blob or tree' if entry.type != :tree && entry.type != :blob\n entry.repository = repository\n @modified = true\n @children[path.first] = entry\n else\n tree = @children[path.first]\n if !tree\n tree = @children[path.first] = Tree.new(:repository => repository)\n @modified = true\n end\n raise 'Not a tree' if tree.type != :tree\n tree[path[1..-1]] = entry\n end\n end", "def update_or_create_page(title: nil, parent_title: nil, space_key: nil, content: '')\n page = find_page_by_title(title: title, space_key: space_key)\n if page.empty?\n puts \"Creating new page: #{title}\"\n parent_page = find_page_by_title(title: parent_title, space_key: Settings.space_key)\n return \"No Parent: #{parent_title}\" if parent_page.empty?\n result = new_child_page(title: title, ancestor_id: parent_page['id'], \n space_key: space_key, content: content)\n else\n puts \"Updating page: #{title}\"\n result = update_page(page: page, space_key: space_key, content: content)\n end\n end", "def create path, body, merger = @options[:merger]\n # remove leading space\n body = body.to_s\n data = body.strip.gsub(/^#{body[/^[ \\t]*(?=\\S)/]}/, '') << \"\\n\"\n\n if File.exist? path\n old_digest = Digest::SHA1.digest(File.read(path))\n new_digest = Digest::SHA1.digest(data)\n\n if old_digest == new_digest\n notify :skip, path\n else\n notify :update, path\n cur, old, new = path, \"#{path}.old\", \"#{path}.new\"\n\n FileUtils.cp cur, old, :preserve => true\n File.write new, data\n\n system merger, old, new, cur if merger\n end\n else\n notify :create, path\n FileUtils.mkdir_p File.dirname(path)\n File.write path, data\n end\n end", "def write_page(page, path = '')\n self.output_resource_op page\n\n # Note: we assume the current locale is the default one\n page.translated_in.each do |locale|\n default_locale = locale.to_sym == self.mounting_point.default_locale.to_sym\n\n # we do not need the localized version of the filepath\n filepath = page.fullpath.dasherize\n\n Locomotive::Mounter.with_locale(locale) do\n # we assume the filepath is already localized\n self.write_page_to_fs(page, filepath, default_locale ? nil : locale)\n end\n end\n\n self.output_resource_op_status page\n\n # also write the nested pages\n (page.children || []).each do |child|\n self.write_page(child, page.depth == 0 ? '' : page.slug)\n end\n end", "def save_file \n Grit.debug = true\n contents = params[:contents]\n message = params[:commit_message]\n @node = Node.new(:name => params[:name], :git_repo_id => params[:git_repo_id], :git_repo_path => params[:git_repo_path])\n save_file_to_disk(contents, @node.abspath)\n stage_and_commit_file(@node.repo_base_path, @node.git_repo_path, message)\n flash[:notice] = \"Created New Version\"\n render :action => :file\n end", "def post page_name\n redirect(\"/login?return_to=#{CGI::escape(@env['REQUEST_URI'])}\") and return unless logged_in?\n page_name_spc = page_name.gsub(/_/,' ')\n if input.submit = 'save'\n attrs = { :body => input.post_body, :title => input.post_title, :user_id =>@state.user.id }\n attrs[:readonly] = input.post_readonly if is_admin?\n @page = Page.find_by_title(page_name_spc)\n if @page.nil?\n # new page\n @page = Page.create(attrs)\n else\n @page.update_attributes(attrs)\n end\n redirect Show, input.post_title.gsub(/ /,'_')\n elsif input.submit == 'minor edit'\n attrs = { :body => input.post_body }\n attrs[:readonly] = input.post_readonly if is_admin?\n page = Page.find_by_title(page_name_spc)\n current_version = page.find_version(page.version)\n current_version.update_attributes(attrs)\n page.without_revision { page.update_attributes(attrs) }\n redirect Show, input.post_title.gsub(/ /,'_')\n else # cancel\n redirect Show, page_name\n end\n end", "def page_path(name, version='master')\n page = wiki.page(name, version)\n if !page.nil?\n \"#{path}/#{page.path}/#{page.version.id}\"\n end\n end", "def save_page(p)\n if p.record.page_entries != p.values.length\n raise RuntimeError, \"page_entries mismatch for node #{p.uid}\"\n end\n begin\n @f.seek(p.uid * @page_size * 8)\n @f.write(p.values.pack('Q*'))\n rescue IOError => e\n PEROBS.log.fatal \"Cannot write cache file #{@file_name}: #{e.message}\"\n end\n end", "def commit(message = nil)\n # Write current index back to the repository\n index = @repo.index\n commit_tree = index.write_tree @repo\n\n # Commit message\n message = \"Affected files: #{@affected_files.uniq.join(', ')}\" if message.nil?\n\n # User handling\n user = ENV['USER']\n user = \"cir-out-commit\" if user.nil?\n\n # Commit author structure for git\n commit_author = {\n email: 'cir-auto-commit@nowhere.cz',\n name: user,\n time: Time.now\n }\n\n # And finally commit itself\n Rugged::Commit.create @repo,\n author: commit_author,\n committer: commit_author,\n message: message,\n parents: @repo.empty? ? [] : [ @repo.head.target ].compact,\n tree: commit_tree,\n update_ref: 'HEAD'\n\n # Reset list of files that were changed since last commit\n @affected_files = []\n end", "def page(wiki, commit)\n blob = self.blob(wiki.repo)\n page = wiki.page_class.new(wiki).populate(blob, self.dir)\n page.version = commit\n page\n end", "def write_file(name, data, commit = {})\n write(merge_path_elements(nil, name, nil), data, commit)\n end", "def import_page(page, parent_slug=nil)\n @db.save_doc({\n :title => page['title'],\n :version => ARGV[0],\n :language => 'en-us',\n :path => \"#{parent_slug}/#{page['url']}\",\n :text => get_content(\"#{parent_slug}/#{page['url']}\"),\n })\n puts \"saving #{page.inspect} to couchdb...\\n\"\nend", "def write_to_file(data)\n\t\t\tref = File.join(@root, \"tarrifs_\" + @page[:name])\n\n\t\t\tif File.exists?(ref)\n\t\t\t\tdiff = \"\"\n\t\t\t\tstatus = Open4::popen4(\"diff #{ref} -\") do |pid, stdin, stdout, stderr|\n\t\t\t\t\tstdin.puts data\n\t\t\t\t\tstdin.close\n\t\t\t\t\tdiff = stdout.read\n\t\t\t\tend\n\t\t\t\t#sent mail if content is different\n\t\t\t\tif status != 0\n\t\t\t\t\twrite \"change detected.\"\n\t\t\t\t\tnotify_changed_site(url, diff)\n\t\t\t\tend\n\t\t\tend\n\t\t\tFile.open(ref, \"w\") do |f|\n\t\t\t\tf.puts data\n\t\t\tend\n\t\tend", "def commit_files(author: nil, message: nil, parent: nil, files: {})\n # check parameters\n raise \"no author given\" if author.nil?\n raise \"no message given\" if message.nil?\n\n # get parent commit\n if not parent.nil?\n parent = @wiki.commit_for(parent)\n elsif parent.nil? and not @wiki.repo.head.commit.nil?\n parent = @wiki.commit_for(@wiki.repo.head.commit.id)\n end\n\n unless parent.nil?\n log_debug \" checkpoint (parent #{parent})\"\n if parent.id != @wiki.repo.head.commit.id\n log_debug \" (parent #{parent} is not head)\"\n\n # now check version of each file individually, if it has been\n # changed in one of the changes since parent.\n #\n # if so, raise error, else proceed\n\n files.each do |path,contents|\n next if @wiki.repo.log(nil, path, {:since => parent.authored_date}).empty?\n log_debug \" file has changed\"\n raise \"repo has changed\"\n end\n end\n end\n\n options = {\n :message => message,\n :author => author,\n }\n unless parent.nil?\n options[:parent] = parent\n end\n\n committer = Gollum::Committer.new(@wiki, options)\n\n files.each do |path,contents|\n path = path.dup.gsub(/^\\.\\//, '')\n if contents.nil?\n committer.index.delete(path)\n else\n committer.index.add(path, normalize(contents))\n end\n # if wikifile_exists? path, parent\n # log_debug \" U path: #{path}, contents: #{normalize(contents)}\"\n # committer.index.add(path.dup, normalize(contents))\n # else\n # log_debug \" A path: #{path}, contents: #{normalize(contents)}\"\n # dir, name, format = split_path path\n # committer.add_to_index(dir, name, format, contents)\n # end\n end\n\n committer.after_commit do |index, sha|\n log_debug \" after_commit: #{index}, #{sha}\"\n @wiki.clear_cache\n\n files.each do |path,contents|\n path = path.gsub(/^\\.\\//, '')\n #dir, name, format = split_path path\n unless @wiki.repo.bare\n Dir.chdir(::File.join(@wiki.repo.path, \"..\")) do\n if contents.nil?\n @wiki.repo.git.rm(path, :force => true)\n else\n @wiki.repo.git.checkout(path, 'HEAD')\n end\n end\n end\n end\n\n @wiki_manager.add_to_index(@wiki, index, sha, files)\n end\n\n sha = committer.commit\n log_debug \"sha #{sha}\"\n end", "def save_page page\n return unless page.text?\n\n path = page_file page.full_name\n\n FileUtils.mkdir_p File.dirname(path) unless @dry_run\n\n cache[:pages] ||= []\n cache[:pages] << page.full_name\n\n return if @dry_run\n\n File.open path, 'wb' do |io|\n Marshal.dump page, io\n end\n end", "def update_wiki\n return unless request.post?\n @page.content = WikiContent.new(:page => @page) if @page.new_record?\n @content = @page.content_for_version(params[:version])\n @content.text = \"h1. #{@page.pretty_title}\" if @content.text.blank?\n @content.comments = nil\n\n if !@page.new_record? && @content.text == params[:content_text]\n # don't save if text wasn't changed\n return\n end\n\n # @content.attributes = params[:content_text]\n @content.text = params[:content_text]\n @content.author = User.find_by_login( params[:user] )\n @content.comments = params[:content_comments]\n if (@page.new_record? ? @page.save : @content.save)\n render :text => 'ok'\n else\n render :text => 'err'\n end\n\n end", "def rename_page(page, rename, commit = {})\n return false if page.nil?\n return false if rename.nil? || rename.empty?\n\n (target_dir, target_name) = ::File.split(rename)\n (source_dir, source_name) = ::File.split(page.path)\n source_name = page.filename_stripped\n\n # File.split gives us relative paths with \".\", commiter.add_to_index doesn't like that.\n target_dir = '' if target_dir == '.'\n source_dir = '' if source_dir == '.'\n target_dir = target_dir.gsub(/^\\//, '') # rubocop:disable Style/RegexpLiteral\n\n # if the rename is a NOOP, abort\n if source_dir == target_dir && source_name == target_name\n return false\n end\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n # This piece only works for multi_commit\n # If we are in a commit batch and one of the previous operations\n # has updated the page, any information we ask to the page can be outdated.\n # Therefore, we should ask first to the current committer tree to see if\n # there is any updated change.\n raw_data = raw_data_in_committer(committer, source_dir, page.filename) ||\n raw_data_in_committer(committer, source_dir, \"#{target_name}.#{Page.format_to_ext(page.format)}\") ||\n page.raw_data\n\n committer.delete(page.path)\n committer.add_to_index(target_dir, target_name, page.format, raw_data)\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(source_dir, source_name, page.format)\n index.update_working_dir(target_dir, target_name, page.format)\n end\n\n multi_commit ? committer : committer.commit\n end", "def edit\n @page = @wiki.find_or_new_page(params[:page]) \n @page.content = WikiContent.new(:page => @page) if @page.new_record?\n \n @content = @page.content_for_version(params[:version])\n @content.text = \"h1. #{@page.pretty_title}\" if @content.text.blank?\n # don't keep previous comment\n @content.comment = nil\n if request.post? \n if @content.text == params[:content][:text]\n # don't save if text wasn't changed\n redirect_to :action => 'index', :id => @project, :page => @page.title\n return\n end\n @content.text = params[:content][:text]\n @content.comment = params[:content][:comment]\n @content.author = logged_in_user\n # if page is new @page.save will also save content, but not if page isn't a new record\n if (@page.new_record? ? @page.save : @content.save)\n redirect_to :action => 'index', :id => @project, :page => @page.title\n end\n end\n end", "def create\n @page = Page.new(params[:page])\n \n\n respond_to do |format|\n if @page.save\n @page.update_attribute('published_at', Time.now) if params[:commit] == 'Publish'\n \n if params[:commit] == 'Publish'\n format.html { redirect_to root_page_path(@page), notice: 'Page was successfully published.' }\n else\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully created.' }\n end\n format.json { render json: @page, status: :created, location: @page, :only => [:title, :content] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(path, content)\n file = pathname(path)\n\n # fail if path is a dir or similar\n fail FileNotFound unless file.file?\n\n # get rid of CRLFs\n content.gsub!(/\\r\\n?/, \"\\n\")\n\n # don't do anything if the contents are identical\n return if file.read == content\n\n # write, add, commit\n file.write(content)\n git :add, path.shellescape\n git :commit, \"-m 'update #{path}' -- #{path.shellescape}\"\n end", "def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to([:admin, @page], notice: 'Page was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated page: #{@page.title}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def commit args = {}\n action = :deleted if self.deleted?\n action ||= self.is_new? ? :added : (self.is_changed? ? :updated : :nothing_to_commit) \n args[:skip_part_data] ||= false\n \n unless action.eql?(:nothing_to_commit)\n message = \"#{action} #{name}\"\n message = args[:m] if args[:m] \n if action.eql?(:deleted)\n repo.remove(self.file_name)\n self.history_count += 1\n else\n repo.add(self.file_name)\n end\n\n active_message = self.commit_messages[:most_recent]\n message = \"#{active_message.gsub(message,\"\")}\" unless self.deleted? || active_message.blank? || active_message.eql?(message)\n self.remove_message_from_temp_store(:most_recent) unless active_message.blank?\n \n repo.commit(message)\n self.last_commit = repo.log(self.local_path, :limit => 1).first.to_s\n end\n unless action.eql?(:deleted) \n self.part_count = parts.count\n self.part_count ||= 0 \n update_part_data unless args[:skip_part_data]\n\n self.history_count = self.history.size\n self.history_count = 1 if self.history_count.eql?(0) \n end\n self.save if self.changed?\n \n synchronize unless args[:dont_sync] || self.attributes[\"sync\"].blank? #rather than calling sync.blank? to skip the JSON parsing step.\n return action\n end", "def update\n if page_params[:body]\n @page.versions << Version.new(body: page_params[:body], title: page_params[:title]).save\n page_params.delete :body\n end\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to controller: \"pages\", action: \"show\", slug: @page[:page_slug], notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete_page(page, commit)\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n index.delete(page.path)\n end\n\n dir = ::File.dirname(page.path)\n dir = '' if dir == '.'\n\n @access.refresh\n update_working_dir(index, dir, page.name, page.format)\n\n sha1\n end", "def edit_wiki_page(proj_name, page_name)\n # fetch current page contents\n page = wiki_page_client(proj_name, page_name)\n begin\n page_data = JSON.parse(page.get)\n current_src = page_data['text']\n rescue RestClient::ResourceNotFound\n page_data = {}\n current_src = ''\n end\n\n new_src = yield(current_src)\n\n changed = !(new_src.nil? || new_src == current_src)\n\n if changed\n new_data = {\n 'page' => {\n 'text' => new_src,\n 'description' => 'edited with kenai-client',\n 'number' => page_data['number']\n }\n }\n page.put(JSON.dump(new_data), :content_type => 'application/json')\n end\n\n return changed\n end", "def save_page(title, attr)\n title = normalize_title(title)\n \n page = find_page(title)\n page.set(attr)\n \n transaction \"update `#{page.title}'\" do\n store[page.title + '.md'] = page\n end\n end", "def create\n begin\n ActiveRecord::Base.transaction do\n @page = Page.new(\n page_slug: params[\"page\"][\"page_slug\"],\n title: params[\"page\"][\"title\"],\n tag_list: params[\"page\"][\"tags\"]\n )\n @page.save!\n @version = Version.new(body: params[\"page\"][\"body\"], page: @page)\n @version.save!\n end\n respond_to do |format|\n format.html { redirect_to action: \"show\", slug: page_params[:page_slug] , notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n end\n rescue => @err\n respond_to do |format|\n @page.body = params[\"page\"][\"body\"]\n format.html { render :new }\n format.json { render json: @err, status: :unprocessable_entity }\n end\n end\n end", "def commit(repopath, file, contents, message)\n # set up repo and index\n repo = Grit::Repo.new repopath\n index = Grit::Index.new repo\n # write file to repo\n fullpath = File.join repopath, file\n File.open(fullpath, 'wb') {|f| f.write contents}\n # commit file\n index.add file, contents\n parent = repo.commits.count > 0 ? [repo.commits.first] : nil\n index.commit message, parent\n end", "def write(data)\n return 0 unless data.is_a?(String)\n\n size = data.bytesize\n return 0 if size == 0\n\n # TBD verify this overflow calc\n raise(PageHandlerError, \"data size=#{data.bytesize} is larger than usable page size=#{@page_usable_size} (#{@page_size} - #{2 * INT_BYTES})\") if size > @page_usable_size\n\n offset = @meta.head_page_offset\n if size > (@page_usable_size - offset)\n # data size is larger than usable data size left, move head to next page\n @meta.head_page_index += 1\n @meta.head_page_offset = offset = 0\n end\n buffer = mmap_buffer(@meta.head_page_index)\n buffer.position = offset\n buffer.put_int(size)\n buffer.put_bytes(data)\n\n # write a trailing 0 after the data. on next push, this will be overwritten with next data size\n # since offset will be set on this trailing zero, otherwise if we changed page, trailing zero\n # will be set.\n buffer.put_int(0)\n @meta.head_page_offset = offset + size + INT_BYTES\n @meta.size += 1\n\n size\n end", "def page(name, path = nil, cmd_params = {}, &block)\n name = name.to_s.intern\n p = Page.new(name, @page)\n builder = DSLBuilder.new(p)\n # Parent params pass to child, but overridden by command-line params (in child only)\n puts \"Parent params: #{self.params.inspect}\" if($debug)\n puts \"CMD params: #{cmd_params.inspect}\" if($debug)\n builder.params.merge!(self.params).merge!(cmd_params)\n puts \"Child params: #{builder.params.inspect}\" if($debug)\n if path = clean_path(path)\n p.path = path\n puts \"Loading page from path=#{path} using builder: #{builder}\" if($debug)\n builder.instance_eval(File.read(path))\n puts \"Child params after loading #{path}: #{builder.params.inspect}\" if($debug)\n end\n builder.instance_eval(&block) if(block_given?)\n puts \"Child params after block: #{builder.params.inspect}\" if($debug)\n\n @page.add_page(p)\n end", "def preview_page(name, data, format)\n ::Gollum::PreviewPage.new(self, \"#{name}.#{::Gollum::Page.format_to_ext(format.to_sym)}\", data, @access.commit(@ref))\n end", "def store(path, content, mode = 0o644)\n put_at(parse_path(path), content && repo.data_sha(content), mode)\n end", "def add_page_to_tree(page)\n if !page.root?\n #puts \"page: #{page}\"\n #puts \"page.fullpath: #{page.fullpath}\"\n #puts \"page.parent_id: #{page.parent_id}\"\n page.parent = @remote_pages_by_id[page.parent_id]\n #puts \"page.parent: #{page.parent}\"\n #puts \"page.parent.class: #{page.parent.class}\"\n #puts \"page.parent.children: #{page.parent.children}\"\n page.parent.children << page\n end\n end", "def rename_page(page, rename, commit = {})\n return false if page.nil?\n return false if rename.nil? or rename.empty?\n\n (target_dir, target_name) = ::File.split(rename)\n (source_dir, source_name) = ::File.split(page.path)\n source_name = page.filename_stripped\n\n # File.split gives us relative paths with \".\", commiter.add_to_index doesn't like that.\n target_dir = '' if target_dir == '.'\n source_dir = '' if source_dir == '.'\n target_dir = target_dir.gsub(/^\\//, '')\n\n # if the rename is a NOOP, abort\n if source_dir == target_dir and source_name == target_name\n return false\n end\n\n multi_commit = !!commit[:committer]\n committer = multi_commit ? commit[:committer] : Committer.new(self, commit)\n\n committer.delete(page.path)\n committer.add_to_index(merge_path_elements(target_dir, target_name, page.format), page.raw_data)\n\n committer.after_commit do |index, _sha|\n @access.refresh\n index.update_working_dir(merge_path_elements(source_dir, source_name, page.format))\n index.update_working_dir(merge_path_elements(target_dir, target_name, page.format))\n end\n\n multi_commit ? committer : committer.commit\n end", "def commit\n read_repo\n if @branches.count < 1\n render :template => 'repositories/commit'\n return\n end\n\n params[:action] = \"commit\"\n\n blank_hash = \"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"\n @commit = @repository.get_commit(@branch)\n @parent = @commit.parent\n @parent = @repository.get_commit(blank_hash) if @parent == nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repository }\n end\n end", "def update_page_data(page_id, id, data)\n put \"pages/#{page_id}/data/#{id}\", {value: data}\n end", "def save_in!(state, author, message = '', timestamp = Time.now)\n ref = \"refs/heads/#{state}\"\n init_repository(repository, timestamp)\n\n previous = revisions[state] || revisions.root_revision\n revision = Revision.new(self, content, author, message, timestamp, previous)\n\n revision.write!(repository, ref)\n\n index.register(id, type.type)\n search_provider.index!(self, revision, state, {name: :save, to: state}) if search_provider\n\n revision\n end", "def put(name, page)\n assert_attributes_set\n path = File.join directory, name\n page.delete 'plugin'\n Store.put_page(path, page, :name => name, :directory => directory)\n end", "def update\r\n @page = Page.find(params[:id])\r\n respond_to do |format|\r\n if @page.update_attributes(params[:page])\r\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\r\n format.json { head :no_content }\r\n target = \"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\"\r\n File.open(target, \"w\") do |f|\r\n f.write(@page.html)\r\n end\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @page.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def put_new_page_with_http_info(name, page_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PageApi.put_new_page ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PageApi.put_new_page\"\n end\n # verify the required parameter 'page_name' is set\n if @api_client.config.client_side_validation && page_name.nil?\n fail ArgumentError, \"Missing the required parameter 'page_name' when calling PageApi.put_new_page\"\n end\n # resource path\n local_var_path = \"/diagram/{name}/pages/addNew\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'pageName'] = page_name\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].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 = ['JWT']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ModifyResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PageApi#put_new_page\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def commit(author, message)\n GIT.add relative_path\n GIT.commit message, :author => \"#{ author.name } <#{ author.email }>\"\n end", "def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @pages_tree[(@page.id).to_s], notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def notebook_commit(revtype, notebook, user, message)\n return nil unless GalleryConfig.storage.track_revisions\n if GalleryConfig.storage.database_notebooks\n commit_id = Digest::SHA1.hexdigest(notebook.content + user.user_name + message + notebook.uuid + DateTime.current.to_s)\n notebookFile = NotebookFile.new(save_type: \"revision\", content: notebook.content, uuid: notebook.uuid)\n else\n commit_id = GitRepo.add_and_commit(notebook, message)\n end\n rev = Revision.from_notebook(notebook, revtype, commit_id, user)\n rev.save\n if GalleryConfig.storage.database_notebooks\n notebookFile.revision_id = rev.id\n notebookFile.save\n end\n commit_id\n end", "def save_page(page, name)\n f = File.new(name,'w')\n f.puts page\n f.close\n end", "def wiki_page(name, path = nil, version = nil, exact = true)\n wiki = wiki_new\n path = name if path.nil?\n name = extract_name(name) || wiki.index_page\n path = extract_path(path)\n path = '/' if exact && path.nil?\n\n OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, exact, version),\n :name => name, :path => path)\n end", "def update\n @page = Page.find_by_slug(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n @page.update_attribute('published_at', Time.now) if params[:commit] == 'Publish'\n @page.update_attribute('published_at', nil) if params[:commit] == 'Unpublish'\n \n if params[:commit] == 'Publish'\n format.html { redirect_to root_page_path(@page), notice: 'Page was successfully published.' }\n else\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully updated.' }\n end\n \n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def build_page(path, silent: false)\n page = sitemap[path]\n out_fname = File.join(BUILD_DIR, path)\n puts \"Rendering #{out_fname}...\" unless silent\n\n # Check page data for info on how to build this path\n if page['template'].present?\n ctx = TemplateContext.new(@config)\n ctx.page = page\n # Check if we have a layout defined, use it\n layout = ctx.page.key?('layout') ? ctx.page['layout'] : config['layout']\n\n # Make sure to render the template inside the layout render so code in the\n # erb layout and template are executed in a sensible order.\n content =\n if layout.present?\n ctx.render(layout) { ctx.render(ctx.page['template']) }\n else\n ctx.render(ctx.page['template'])\n end\n elsif page['json'].present?\n content = page['json'].to_json\n elsif page['file'].present?\n content = File.read(page['file'])\n else\n raise(\n ArgumentError,\n \"Page '#{path}' missing one of required attributes: 'template', 'json', 'file'.\"\n )\n end\n\n # If page data includes a digest flag, add sha1 digest to output filename\n if page['digest'] == true\n ext = VizBuilder.fullextname(path)\n fname = File.basename(path, ext)\n dir = File.dirname(path)\n digest = Digest::SHA1.hexdigest(content)\n digest_fname = \"#{fname}-#{digest}#{ext}\"\n page['digest_path'] = \"#{dir}/#{digest_fname}\"\n out_fname = File.join(BUILD_DIR, dir, digest_fname)\n end\n\n FileUtils.mkdir_p(File.dirname(out_fname))\n File.write(out_fname, content)\n content\n end", "def store_page\n @stored_page = @crwlr.pages.create(:address => @url, :title => @page_title[0..200], :number_of_links => @links.size)\n if @parent_page\n @parent_page.pages << @stored_page\n end\n end", "def store(object, message = object.inspect)\n diary = open pathf % extract_values(object), 'w'\n diary.pages.create object, message\n end", "def new\n @root_pages = [fetch_root_page].flatten\n if request.post?\n @page = ComatosePage.new params[:page]\n @page.author = fetch_author_name\n if @page.save\n flash[:notice] = \"Created page '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n end\n else\n @page = ComatosePage.new :title=>'New Page', :parent_id=>(params[:parent] || nil)\n end\n end", "def create_new_page(page_params, version_params)\n the_page = Page.new :slug => page_params[:slug], \n :title => page_params[:title], \n :breadcrumb => page_params[:slug],\n :class_name => 'Page',\n :parent_id => 1,\n :layout_id => nil,\n :virtual => false\n \n the_version = PageVersion.new :page_id => -1, \n :content_status_id => ContentStatus[:draft].id, \n :body_content => version_params[:body_content],\n :page_title => version_params[:page_title],\n :meta_keywords => version_params[:meta_keywords],\n :meta_description => version_params[:meta_description] \n \n # calling these separate so they both run and we can combine the errors\n page_valid = the_page.valid?\n version_valid = the_version.valid?\n \n if page_valid and version_valid\n if the_page.save\n # add some default content parts to that page\n the_page.update_part_content('body', version_params[:body_content])\n \n the_page.update_part_content('title_tag', '')\n the_page.update_part_content('header_content', '<img class=\"hero\" src=\"/_images/hero_about_us.jpg\" alt=\"Get back to life with Texas Back Institutes back, neck and spine care. Make an appointment now. \" width=\"956\" height=\"119\">')\n the_page.update_part_content('body_class', '')\n the_page.update_part_content('secondary', '') \n \n the_version.page_id = the_page.id\n \n if the_version.save\n self.page_id = the_page.id\n self.name = the_page.title\n \n @page_object = the_page\n @version_object = the_version\n \n return self.save\n end\n end\n end\n \n merge_errors(the_page, the_version)\n \n @page_object = the_page\n @version_object = the_version\n \n return false\n end", "def recursive_create_page(page, parent=nil)\n Globalize.locale = @master_locale\n puts \"#{page['title']}\"\n p = Refinery::Page.find_by_title page['title']\n if not p or p.parent != parent\n puts \"+++ Create page #{page['title']} (#{page['type']})\"\n if parent then\n p = parent.children.create :title => page['title'],\n :deletable => false,\n :view_template => page['type']\n else\n p = Refinery::Page.create :title => page['title'],\n :deletable => false,\n :view_template => page['type']\n end\n else\n puts \" === Found existing page #{page['title']} (#{page['type']})\"\n end\n if page.has_key?('skip_to_first_child') and page['skip_to_first_child'] != p.skip_to_first_child\n p.skip_to_first_child = page['skip_to_first_child']\n p.save\n end\n if page['parts'] then\n page['parts'].each_pair do |key, part|\n puts \" ++ create page part #{key}\"\n pp = p.parts.find_by_title(key)\n pp.body = part.strip\n pp.save\n end\n end\n if page['children'] then\n page['children'].each do |child|\n recursive_create_page child, p\n end\n end\n end", "def update!(**args)\n @author_name = args[:author_name] if args.key?(:author_name)\n @children = args[:children] if args.key?(:children)\n @date = args[:date] if args.key?(:date)\n @docid = args[:docid] if args.key?(:docid)\n @parent = args[:parent] if args.key?(:parent)\n end", "def update\n begin\n MiniWikiPage.transaction do\n @wiki_page = MiniWikiPage.find_by_name(params[:wiki_page])\n @wiki_revision = MiniWikiRevision.new(params[:wiki_revision])\n @wiki_revision.revision = @wiki_page.mini_wiki_revisions.last.revision + 1\n unless @username.blank?\n @wiki_revision.author = @username\n end\n \n @wiki_page.mini_wiki_revisions << @wiki_revision\n @wiki_page.mini_wiki_revision = @wiki_revision\n @wiki_page.save!\n end\n flash[:notice] = 'Page was successfully updated.'\n redirect_to :action => 'show', :wiki_page => @wiki_page.name\n rescue\n render :action => 'edit', :template => 'edit'\n end\n end", "def write_entry(index_file, entry, journal, data)\n curr = self.size - 1\n \n node_map[entry.last] = curr\n \n link = entry.link_rev\n data_file = index_file[0..-3] + \".d\"\n \n entry = pack_entry entry, link\n \n data_file_handle = open(data_file, \"a\")\n index_file_handle = open(index_file, \"a+\")\n \n journal << {:file => data_file, :offset => offset}\n journal << {:file => index_file, :offset => curr * entry.size}\n \n data_file_handle.write data[:compression] if data[:compression].any?\n data_file_handle.write data[:text]\n \n data_file_handle.flush\n index_file_handle.write entry\n end", "def create(page, version)\n @page = Page.new(page)\n @version = Version.new(version.merge!(:user => @user))\n if @page.valid? && @version.valid?\n @page.versions << @version\n @page.save\n redirect url(:page, @page)\n else\n render :new\n end\n end", "def update!(**args)\n @page = args[:page] if args.key?(:page)\n @paragraph = args[:paragraph] if args.key?(:paragraph)\n @reporter = args[:reporter] if args.key?(:reporter)\n @volume = args[:volume] if args.key?(:volume)\n @year = args[:year] if args.key?(:year)\n end", "def receive_push\n return if data['user'] == nil\n return if data['pass'] == nil\n return if data['url'] == nil\n return if data['title'] == nil\n # The line we add looks like: <msg> <commit URL>\n line_add = \"\\n* #{summary_message}: #{summary_url}\"\n # Log in to the install.\n mw = MediaWiki::Gateway.new(data['url'])\n mw.login(data['user'], data['pass'])\n # Good. Fetch page if it exists somehow.\n page_text = mw.get(data['title'])\n if page_text == nil\n mw.create(data['title'], '<!-- autocreated -->', :summary => 'Creating page -- did not exist during push')\n page_text = \"\"\n end\n # Append our line to the end of the page_text\n page_text << line_add\n # Save the page\n mw.edit(data['title'], page_text, :summary => 'Updated commits upon push')\n end", "def commit(msg=status)\n setup unless head\n \n sha = git.commit(msg)\n index.write(sha)\n sha\n end", "def build_page(sha, ref)\n # implement inside child\n end", "def get_page(path, raw = false)\n\n #head = @repo.commits.first\n #tree = head.tree @branch\n\n tree = @repo.tree @branch\n blob = tree / path\n\n return nil if ! blob.is_a? Grit::Blob\n\n text = blob.data.force_encoding('utf-8').encode\n return [ text, blob.id ]\n end", "def insert(location, data)\n pages_to_add = nil\n if data.is_a? PDF\n @version = [@version, data.version].max\n pages_to_add = data.pages\n actual_value(@names ||= {}.dup).update data.names, &HASH_MERGE_NEW_NO_PAGE\n merge_outlines((@outlines ||= {}.dup), actual_value(data.outlines), location) unless actual_value(data.outlines).empty?\n if actual_value(@forms_data)\n actual_value(@forms_data).update actual_value(data.forms_data), &HASH_MERGE_NEW_NO_PAGE if data.forms_data\n else\n @forms_data = data.forms_data\n end\n warn 'Form data might be lost when combining PDF forms (possible conflicts).' unless data.forms_data.nil? || data.forms_data.empty?\n elsif data.is_a?(Array) && (data.select { |o| !(o.is_a?(Hash) && o[:Type] == :Page) }).empty?\n pages_to_add = data\n elsif data.is_a?(Hash) && data[:Type] == :Page\n pages_to_add = [data]\n else\n warn \"Shouldn't add objects to the file unless they are PDF objects or PDF pages (an Array or a single PDF page).\"\n return false # return false, which will also stop any chaining.\n end\n # pages_to_add.map! {|page| page.copy }\n catalog = rebuild_catalog\n pages_array = catalog[:Pages][:referenced_object][:Kids]\n page_count = pages_array.length\n if location < 0 && (page_count + location < 0)\n location = 0\n elsif location > 0 && (location > page_count)\n location = page_count\n end\n pages_array.insert location, pages_to_add\n pages_array.flatten!\n self\n end", "def commit!(msg=status)\n setup unless head\n \n sha = git.commit!(msg)\n index.write(sha)\n sha\n end", "def save(commit_msg = nil)\n # Add all changes to index (staging area)\n index = repo.index\n\n # Process config file (if loaded, i.e. may be modified)\n save_config_file(index) if @config\n\n # Process ssh keys (if loaded, i.e. may be modified)\n save_ssh_keys(index) if @ssh_keys\n\n # Write index to git and resync fs\n commit_tree = index.write_tree(repo)\n index.write\n\n author = commit_author.merge(time: Time.now)\n\n opts = {\n parents: [repo.head.target],\n tree: commit_tree,\n update_ref: 'HEAD',\n message: (commit_msg || @settings[:commit_msg]),\n author: author,\n committer: author\n }\n Rugged::Commit.create(repo, opts)\n end", "def fast_export_commit(time)\n file_mark, file_text = fast_export_file\n stamp = fast_export_timestamp(time)\n parent = @commit_mark || initial_ref\n reset = @commit_mark ? '' : \"reset #{branch}\\n\"\n @commit_mark = next_mark\n return file_text + <<COMMIT\n#{reset}commit #{branch}\nmark #{@commit_mark}\nauthor #{fast_export_user} #{stamp}\ncommitter #{fast_export_user} #{stamp}\n#{fast_export_data 'Yay, a commit!'}\nfrom #{parent}\nM 100644 #{file_mark} yay_a_file.txt\nCOMMIT\nend", "def create\n @commit = Commit.new\n\n #walker = Rugged::Walker.new(@repo)\n #\n #walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE) # optional\n #\n #walker.push('HEAD')\n #walker.each { |c| \n # @commit = Commit.new(sha: c.oid, description:c.message,\n # author: c.author[:name], commit_date: c.author[:time])\n # @commit.save\n #}\n #walker.reset\n\n respond_to do |format|\n format.html { redirect_to @commit, notice: 'Commit was successfully created.' }\n format.json { render :show, status: :created, location: @commit }\n end\n end", "def write(path, data)\n\t\t@connection.write(path, data)\n\tend", "def page(path, version = nil, global_match = false)\n ::Gollum::Page.find(self, path, version.nil? ? @ref : version, false, global_match)\n end", "def write_tree\n invoke(:write_tree)\n end", "def create\n @page = Page.new(page_params)\n respond_to do |format|\n if @page.save\n self.build_pages_tree\n format.html { redirect_to @pages_tree[@page.id], notice: 'Page was successfully created.' }\n format.json { render :show, status: :created, location: @page }\n else\n format.html { render :new }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_data(path, data = \"\", version = -1)\n unless path_exists?(path)\n create_path_recursively(path)\n end\n\n bytes = to_byte_array(data)\n begin\n @zk.set_data(path, bytes, version)\n rescue\n puts \"#$!\"\n end\n end", "def rugged_tree_entry(path)\n rugged_commit.tree.path(path)\n rescue Rugged::TreeError\n nil\n end", "def updateVersion\n # We add 1 because the next commit is probably one more - though this is a race\n commits = %x[git log #{$0} | grep '^commit ' | wc -l].to_i + 1\n vers = \"1.%0.3d\" % commits\n\n t = File.read($0)\n t.gsub!(/^MYVERSION = '(.*)'$/, \"MYVERSION = '#{vers}'\")\n bak = $0+'.bak'\n File.open(bak,'w') { |f| f.puts t }\n perm = File.stat($0).mode & 0xfff\n File.rename(bak,$0)\n File.chmod(perm,$0)\n exit\nend", "def create\n @html_page = HtmlPage.new(params[:html_page])\n @html_page.parent = @parent_node\n\n respond_to do |format|\n if @commit_type == 'preview' && @html_page.valid?\n format.html { render :template => 'admin/shared/create_preview', :locals => { :record => @html_page }, :layout => 'admin/admin_preview' }\n format.xml { render :xml => @html_page, :status => :created, :location => @html_page }\n elsif @commit_type == 'save' && @html_page.save(:user => current_user)\n format.html # create.html.erb\n format.xml { head :ok }\n else\n format.html { render :template => 'admin/shared/new', :locals => { :record => @html_page }, :status => :unprocessable_entity }\n format.xml { render :xml => @html_page.errors, :status => :unprocessable_entity }\n end\n end\n end", "def tree_insert(tree, page)\n node_list = page.path.split(\"/\")\n _tree_insert(tree, page, node_list)\n end", "def put(text, summary = nil, minor = true, bot = true, password = nil)\n #require login\n @site.login(password)\n result = @site.query_prop_info(@normtitle, nil, 'edit') \n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(@normtitle, nil, text, token, summary, minor, nil, bot)\n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\n puts \"content put\"\n end", "def []=(path, content=nil)\n segments = split(path)\n unless basename = segments.pop\n raise \"invalid path: #{path.inspect}\"\n end\n \n tree = @tree.subtree(segments, true)\n tree[basename] = convert_to_entry(content)\n end", "def store(revision, partition, path, template, transaction)\n raise NotImplementedError\n end", "def format_commiturl(data)\n Git.io.generate data[\"compare\"]\n end", "def save\n repository.create_contents(path, \"Upload #{path}\", content)\n end", "def save message\n Dir.chdir @root do\n cmd = \"git add --all && git commit -m \\\"#{message}\\\"\"\n stdout, stderr, status = Open3.capture3 cmd\n if status != 0\n if /nothing to commit/.match stdout\n raise NothingToCommitError\n elsif /Not a git repository/.match stderr\n raise NotARepositoryError\n else\n raise Error, stderr\n end\n end\n end\n end", "def revert_page(page, sha1, sha2 = nil, commit = {})\n return false unless page\n left, right, options = parse_revert_options(sha1, sha2, commit)\n commit_and_update_paths(@repo.git.revert_path(page.path, left, right), [page.path], options)\n end", "def newauthor\n require 'Pashua'\n include Pashua\n\n config = <<EOS\n *.title = Add a new author page\n cb.type = textfield\n cb.label = Name of author page to create\n cb.width = 220\n db.type = cancelbutton\n db.label = Cancel\n db.tooltip = Closes this window without taking action\nEOS\n\n pagetmp = pashua_run config\n exit if pagetmp[\"cancel\"] == 1\n page = pagetmp[\"cb\"]\n pname = \"/wiki/data/pages/a/#{clean_pagename(page)}.txt\"\n\n File.open(pname,\"w\") {|f| f<<\"h1. #{page}\\n\\nh2. Research\\n\\nh2. Links\\n * [[ |Homepage]]\n \\n{{page>abib:#{page}}}\"}\n\n `chmod a+rw \"#{pname}\"`\n\n `open \"http://localhost/wiki/a:#{page}?do=edit\"`\nend\n\n# removes current page and all related pages (ref, skimg etc) after confirmation\ndef delete\n require 'pashua'\n include Pashua\n config = <<EOS\n *.title = Delete this page?\n cb.type = text\n cb.text = This action will delete this page, and all related pages (ref:, notes:, skimg:, kindle:, etc). Are you sure?\n cb.width = 220\n db.type = cancelbutton\n db.label = Cancel\nEOS\n pagetmp = pashua_run config\n exit if pagetmp['db'] == \"1\"\n\n pname = cururl.split(\"/\").last.downcase\n page = pname.split(\":\").last\n ns = pname.split(\":\").first\n\n directories = %w[ref notes skimg kindle clip]\n\n if directories.index(ns)\n paths = directories.map {|f| \"#{Wiki_path}/data/pages/#{f}/#{page}.txt\"}\n\n else\n paths = [\"#{Wiki_path}/data/pages/#{clean_pagename(pname).gsub(\":\", \"/\")}.txt\"]\n end\n\n c = 0\n paths.each do |f|\n c += 1 if try { File.delete(f) }\n end\n\n growl \"#{c ? c : 0} pages deleted\"\nend\n\n#### Running the right function, depending on command line input ####\n\n@chrome = Appscript.app('Google Chrome')\nsend *ARGV unless ARGV == []\n", "def update_path(path)\n return path_nodes(path).insert(1, \"data\").join(\"/\") if path_nodes(path)[1] != \"data\"\n\n path\n end", "def create_page_content(page_id, data)\n create_content(Voog::API::Contents::ParentKind::Page, page_id, data)\n end" ]
[ "0.71911764", "0.71654", "0.7164895", "0.70490754", "0.58375853", "0.5573226", "0.54572463", "0.5356908", "0.5331896", "0.52793103", "0.5252364", "0.5220166", "0.51847", "0.50496584", "0.49997962", "0.49817222", "0.49259976", "0.49062657", "0.4904201", "0.48799556", "0.48566687", "0.4845275", "0.4840212", "0.48057008", "0.47877645", "0.4779332", "0.4751349", "0.47430766", "0.4731487", "0.47279653", "0.4724663", "0.4721327", "0.47114527", "0.47098854", "0.46947002", "0.46835467", "0.46491018", "0.4625497", "0.46052513", "0.46017233", "0.46008328", "0.45616108", "0.45592904", "0.45488644", "0.4546426", "0.45459273", "0.45304242", "0.4523463", "0.4523229", "0.45125568", "0.4493258", "0.4483955", "0.44785398", "0.44784802", "0.44757524", "0.44663638", "0.44656232", "0.4432431", "0.44248945", "0.44236892", "0.44182557", "0.44162112", "0.4409339", "0.44065243", "0.44007966", "0.439713", "0.43924987", "0.43921", "0.43863347", "0.43778625", "0.43716303", "0.4366664", "0.4365999", "0.43584082", "0.43435448", "0.43434468", "0.4339", "0.43347764", "0.43244684", "0.43239263", "0.4323899", "0.4320818", "0.43154183", "0.4307643", "0.4292647", "0.42914757", "0.42888045", "0.42830017", "0.42821428", "0.42773876", "0.42755648", "0.42739424", "0.42725232", "0.4259602", "0.42572722", "0.42502806", "0.42469913", "0.42442334", "0.42389396", "0.42190373" ]
0.69084716
4